:root {
  --ink: #191716;
  --muted: #77716d;
  --line: #e8e1dc;
  --soft: #f8f4f1;
  --paper: #fff;
  --accent: #b88b67;
  --accent-dark: #7b4f35;
  --rose: #fff5f2;
  --rose-line: #f0d8cf;
  --danger: #c04444;
  --admin: #2b2524;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
}

body.is-crop-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.today-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f1eb 0, #fff 260px);
}

.today-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 44px;
  text-align: center;
}

.today-hero p {
  margin: 10px 0 0;
  color: #111;
  font-size: 18px;
  font-weight: 700;
}

.today-hero h1 {
  margin: 0;
  color: #ff77b9;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0;
}

.today-hero--compact {
  padding-bottom: 24px;
}

.today-feed,
.today-single {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 80px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px 34px;
}

.today-single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.today-card {
  min-width: 0;
}

.today-card__head {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 14px;
}

.today-card__profile {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--soft);
}

.today-card__head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.today-card__head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  word-break: keep-all;
}

.today-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 3px;
}

.today-gallery__main {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.today-gallery__main .swiper-wrapper,
.today-gallery__main .swiper-slide {
  width: 100%;
  height: 100%;
}

.today-gallery__main .swiper-slide {
  overflow: hidden;
  background: var(--soft);
}

.today-gallery__main img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
  backface-visibility: hidden;
}

.today-gallery__thumbs {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.today-thumb {
  position: relative;
  padding: 0;
  border: 0;
  background: #ddd;
  cursor: pointer;
  overflow: hidden;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.today-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
  opacity: .62;
  transition: filter .18s ease, opacity .18s ease, transform .18s ease;
}

.today-thumb.is-active img,
.today-thumb:hover img {
  filter: none;
  opacity: 1;
}

.today-thumb:hover {
  transform: translateY(-1px);
}

.today-thumb:active {
  transform: scale(.965);
}

.today-thumb:focus,
.today-thumb:focus-visible {
  outline: none;
}

.today-thumb.is-active {
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px rgba(255, 119, 185, .85);
}

.today-thumb.is-active img {
  transform: scale(1.035);
}

.empty-state,
.expired-page {
  min-height: 56vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}

.empty-state h2,
.expired-page h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.empty-state p,
.expired-page p {
  margin: 0;
  color: var(--muted);
}

.expired-page a {
  display: inline-flex;
  margin-top: 22px;
  padding: 13px 20px;
  background: var(--ink);
  color: #fff;
}

.admin-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 4%, rgba(184, 139, 103, .13), transparent 300px),
    linear-gradient(180deg, #faf7f5 0, #f2f4f7 360px);
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.admin-nav {
  background: linear-gradient(180deg, #342b29 0, #201c1c 100%);
  color: rgba(255, 255, 255, .72);
  padding: 28px 18px;
  box-shadow: 14px 0 40px rgba(45, 35, 31, .12);
}

.admin-nav strong {
  display: block;
  color: #fff;
  font-size: 21px;
  margin: 0 0 26px;
}

.admin-nav a {
  display: block;
  padding: 12px 14px;
  margin: 4px 0;
  border-radius: 6px;
  font-size: 15px;
}

.admin-nav a.is-active,
.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.admin-main {
  padding: 34px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-top p {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-weight: 700;
}

.admin-top h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.primary-button,
.secondary-button,
.form-actions button,
.form-actions a,
.save-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #2b2524, #6e4b3a);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(75, 49, 37, .18);
}

.secondary-button,
.form-actions a {
  background: #fff;
  color: #222;
  border: 1px solid #d5d9df;
}

.admin-panel,
.admin-form {
  background: rgba(255, 255, 255, .92);
  border: 1px solid #eadfd9;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 46px rgba(73, 55, 47, .09);
  backdrop-filter: blur(8px);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7ebf0;
}

.admin-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #f1e8e2;
}

.admin-tabs a {
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 800;
  color: #747b85;
}

.admin-tabs a.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 6px 18px rgba(105, 72, 56, .12);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #555d68;
}

.admin-filters label,
.admin-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.admin-select {
  margin-left: auto;
}

.admin-select select,
.form-grid input,
.form-grid select {
  height: 40px;
  padding: 0 11px;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  background: #fff;
}

.admin-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.admin-row {
  display: grid;
  grid-template-columns: 42px minmax(190px, .9fr) 294px 162px 82px 210px;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid #eadfd9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(54, 43, 38, .045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.admin-row:hover {
  transform: translateY(-1px);
  border-color: #dcc6bb;
  box-shadow: 0 16px 30px rgba(54, 43, 38, .08);
}

.admin-row.is-dragging {
  opacity: .45;
}

.drag-handle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--rose);
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: grab;
}

.admin-row .drag-handle {
  display: inline-flex;
}

.admin-row strong,
.admin-row span,
.admin-row small,
.admin-row time {
  display: block;
}

.admin-row strong {
  margin-bottom: 4px;
  font-size: 18px;
}

.admin-row > div {
  min-width: 0;
}

.admin-row > div:not(.row-actions):not(.admin-image-strip) span,
.admin-row > div:not(.row-actions):not(.admin-image-strip) small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row small,
.admin-row time {
  color: #818996;
  font-size: 12px;
  white-space: nowrap;
}

.admin-image-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-image-strip img {
  width: 52px;
  height: 68px;
  display: block;
  object-fit: cover;
  border-radius: 7px;
  background: #f2eeeb;
  border: 1px solid #eadfd9;
  box-shadow: 0 7px 14px rgba(40, 31, 28, .08);
}

.state {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1e8e2;
  color: #596271;
  font-weight: 700;
  text-align: center;
}

.state.is-open {
  background: #e5f6ed;
  color: #168049;
}

.state.is-hidden,
.state.is-expired {
  background: #fff3df;
  color: #a36610;
}

.state.is-deleted {
  background: #fee8e8;
  color: var(--danger);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.row-actions a,
.row-actions button {
  width: 60px;
  min-height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-actions .edit {
  background: #2b2524;
  color: #fff;
}

.row-actions .preview {
  width: 78px;
  background: var(--rose);
  color: var(--accent-dark);
  border-color: var(--rose-line);
}

.row-actions .delete {
  background: #fff;
  border-color: #f0d0d0;
  color: var(--danger);
}

.save-order {
  margin-top: 16px;
}

.admin-empty {
  padding: 34px;
  border: 1px dashed #cdd5df;
  border-radius: 8px;
  color: #7c8490;
  text-align: center;
}

.admin-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.admin-pagination a {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d5dbe4;
  border-radius: 5px;
  background: #fff;
  color: #68717c;
}

.admin-pagination a.is-active {
  background: #2b2524;
  color: #fff;
  border-color: #222936;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #3c4450;
  font-weight: 800;
}

.span-2,
.span-all {
  grid-column: 1 / -1;
}

.surgery-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.surgery-picker label {
  padding: 12px;
  border: 1px solid #eadfd9;
  border-radius: 10px;
  background: #fffaf8;
  min-width: 0;
}

.surgery-picker input[type="text"] {
  margin-top: 8px;
}

.surgery-picker select,
.surgery-picker input[type="text"] {
  width: 100%;
  min-width: 0;
}

.form-note {
  margin: 10px 0 0;
  color: #79818c;
  font-size: 13px;
}

.image-field {
  width: 260px;
  min-height: 0;
  padding: 14px;
  border: 1px dashed #d9c4ba;
  border-radius: 10px;
  background: #fffaf8;
  align-content: start;
}

.image-field img {
  width: 112px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  background: #eef1f5;
  box-shadow: 0 8px 18px rgba(58, 43, 37, .1);
}

.image-field:first-of-type img {
  aspect-ratio: 1;
}

.edit-image-section {
  margin-top: 2px;
}

.edit-image-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 16px 0 4px;
  border-top: 1px solid #e7ebf0;
}

.edit-image-head h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.edit-image-head p {
  margin: 0;
  color: #79818c;
  font-size: 13px;
  font-weight: 500;
}

.edit-image-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 2px;
  border-radius: 12px;
  transition: background .16s ease, box-shadow .16s ease;
}

.edit-image-grid.is-sorting {
  background: rgba(184, 139, 103, .08);
  box-shadow: inset 0 0 0 1px rgba(184, 139, 103, .22);
}

.edit-image-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid #eadfd9;
  border-radius: 10px;
  background: #fffaf8;
  cursor: grab;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.edit-image-card.is-dragging {
  opacity: .55;
  transform: scale(.985);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 139, 103, .14);
}

.edit-image-card.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 139, 103, .16), 0 16px 26px rgba(78, 52, 39, .13);
}

.edit-image-card__badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(20, 26, 34, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.edit-image-card__handle {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #232b36;
  cursor: grab;
  font-weight: 900;
  display: grid;
  grid-template-columns: repeat(2, 4px);
  grid-auto-rows: 4px;
  place-content: center;
  gap: 3px;
  box-shadow: 0 8px 16px rgba(43, 37, 36, .15);
}

.edit-image-card__handle span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6e4b3a;
  display: block;
}

.edit-image-card img,
.edit-image-empty {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  background: #eef1f5;
}

.edit-image-empty {
  display: grid;
  place-items: center;
  color: #929aa6;
  font-weight: 800;
}

.edit-file-button {
  margin-top: 8px;
  display: block;
  cursor: pointer;
}

.edit-file-button span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #dcc7bd;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  padding: 0 12px;
}

.edit-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(24, 18, 16, .62);
  backdrop-filter: blur(6px);
}

.crop-modal[hidden] {
  display: none;
}

.crop-dialog {
  width: min(1040px, 100%);
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}

.crop-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #eadfd9;
}

.crop-head p {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.crop-head h2 {
  margin: 0;
  font-size: 24px;
}

.crop-head button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f3ebe6;
  color: #5f4031;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.crop-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  padding: 22px 24px;
}

.crop-stage {
  position: relative;
  height: min(62vh, 620px);
  min-height: 420px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(45deg, #2b2524 25%, transparent 25%),
    linear-gradient(-45deg, #2b2524 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b2524 75%),
    linear-gradient(-45deg, transparent 75%, #2b2524 75%);
  background-color: #3a3331;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  cursor: grab;
  touch-action: none;
}

.crop-stage.is-panning {
  cursor: grabbing;
}

.crop-stage > img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
  transform-origin: 0 0;
}

.crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, .42);
}

.crop-frame {
  position: absolute;
  z-index: 2;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .42), 0 14px 34px rgba(0, 0, 0, .24);
  pointer-events: none;
}

.crop-modal.is-circle-crop .crop-frame {
  border-radius: 50%;
}

.crop-modal.is-circle-crop .crop-frame::before,
.crop-modal.is-circle-crop .crop-frame::after {
  display: none;
}

.crop-modal.is-circle-crop .crop-frame {
  background:
    linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,.4)) center / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.4), rgba(255,255,255,.4)) center / 100% 1px no-repeat;
}

.crop-frame::before,
.crop-frame::after {
  content: "";
  position: absolute;
  inset: 33.333% 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, .55);
}

.crop-frame::after {
  inset: 66.666% 0 auto;
}

.crop-controls {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #eadfd9;
  border-radius: 12px;
  background: #fffaf8;
}

.crop-controls strong {
  font-size: 18px;
}

.crop-controls p {
  margin: 0;
  color: #746b66;
  font-size: 14px;
  line-height: 1.55;
}

.crop-controls label {
  display: grid;
  gap: 8px;
  color: #3c302c;
  font-weight: 800;
}

.crop-controls .crop-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eadfd9;
  font-size: 14px;
}

.crop-controls .crop-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-dark);
}

.crop-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent-dark);
}

.crop-tool-buttons {
  display: grid;
  gap: 8px;
}

.crop-controls button,
.crop-actions button {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #dcc7bd;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid #eadfd9;
}

.crop-actions button {
  min-width: 96px;
  padding: 0 18px;
}

.crop-actions button:last-child {
  border-color: transparent;
  background: linear-gradient(135deg, #2b2524, #6e4b3a);
  color: #fff;
  box-shadow: 0 10px 22px rgba(75, 49, 37, .18);
}

@media (max-width: 1120px) {
  .admin-row {
    grid-template-columns: 36px minmax(180px, 1fr);
  }

  .admin-image-strip,
  .admin-row time,
  .state {
    grid-column: 2 / -1;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .today-hero {
    padding: 42px 18px 24px;
  }

  .today-hero h1 {
    color: #ff77b9;
    font-size: 34px;
  }

  .today-hero p {
    color: #111;
    font-size: 15px;
  }

  .today-feed,
  .today-single {
    width: min(520px, calc(100% - 28px));
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .today-gallery {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .today-gallery__thumbs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 3px;
  }

  .today-thumb {
    aspect-ratio: 3 / 4;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 12px;
  }

  .admin-nav strong {
    display: none;
  }

  .admin-nav a {
    white-space: nowrap;
  }

  .admin-main {
    padding: 20px 14px;
  }

  .admin-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-select {
    margin-left: 0;
  }

  .admin-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .admin-image-strip,
  .admin-row time,
  .state,
  .row-actions {
    grid-column: 1 / -1;
  }

  .form-grid,
  .surgery-picker,
  .edit-image-grid {
    grid-template-columns: 1fr;
  }

  .crop-modal {
    padding: 12px;
  }

  .crop-workspace {
    grid-template-columns: 1fr;
  }

  .crop-stage {
    height: 52vh;
    min-height: 320px;
  }
}
