:root {
  --ink: #111111;
  --muted: #70706b;
  --line: #e9e4dc;
  --paper: #fffdf9;
  --soft: #f6f1e9;
  --warm: #d7b98e;
  --olive: #6f735a;
  --rose: #a86154;
  --charcoal: #252525;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(22, 20, 16, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Pretendard, "Noto Sans KR", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--white);
  color: var(--charcoal);
  white-space: nowrap;
}

.chip.active,
.chip:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn,
.text-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  min-height: 42px;
  padding: 0 15px;
  color: var(--ink);
}

.icon-btn {
  width: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.primary-btn {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.ghost-btn {
  background: transparent;
}

.danger-btn {
  border-color: rgba(168, 97, 84, 0.38);
  color: #9b3f33;
}

.main {
  min-height: 100vh;
}

.hero {
  min-height: min(78vh, 760px);
  display: grid;
  align-items: end;
  padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 56px);
  color: var(--white);
  background-position: center;
  background-size: cover;
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.08) 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.42), transparent 46%);
  z-index: -1;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 14px;
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 8vw, 98px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  margin: 18px 0 28px;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.section {
  padding: clamp(38px, 6vw, 76px) clamp(18px, 4vw, 56px);
}

.section.alt {
  background: var(--soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}

.section h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 0;
}

.section-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}

.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
}

.textarea {
  min-height: 98px;
  resize: vertical;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
  color: var(--muted);
}

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

.product-card {
  position: relative;
  min-width: 0;
}

.product-card button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: #ebe7df;
  position: relative;
}

.photo img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.product-card:hover .photo img {
  transform: scale(1.035);
}

.badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.badge.dark {
  background: var(--ink);
  color: var(--white);
}

.badge.sale {
  background: var(--rose);
  color: var(--white);
}

.meta {
  padding-top: 12px;
}

.meta h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.strike {
  color: var(--muted);
  text-decoration: line-through;
}

.price {
  font-weight: 900;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 74px);
}

.side {
  border-right: 1px solid var(--line);
  background: #181818;
  color: var(--white);
  padding: 24px;
}

.side .brand {
  color: var(--white);
  padding: 0;
  margin-bottom: 24px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.side-nav button.active,
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.admin-content {
  padding: clamp(22px, 4vw, 44px);
  background: #f7f7f4;
}

.panel,
.modal-panel,
.drawer-panel,
.chat-window,
.admin-chat-room,
.summary-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(20, 18, 12, 0.06);
}

.panel {
  padding: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-size: 13px;
}

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

.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 30px;
}

.detail-main-img {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
  cursor: zoom-in;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.thumbs img {
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
}

.thumbs img.active {
  border-color: var(--ink);
}

.option-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.option {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--white);
}

.option.active {
  background: var(--ink);
  color: var(--white);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.34);
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(440px, 100%);
  height: 100%;
  border-radius: 0;
  padding: 22px;
  overflow: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  height: 94px;
  border-radius: 8px;
  object-fit: cover;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--soft);
}

.summary-box {
  margin-top: 18px;
  padding: 16px;
}

.summary-box div {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
}

.fitroom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.twin-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  margin: 14px 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    var(--soft);
  background-size: 28px 28px;
}

.twin-avatar {
  width: var(--avatar-width);
  height: var(--avatar-height);
  display: grid;
  grid-template-rows: 72px 1fr 34%;
  justify-items: center;
  align-items: start;
}

.face {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #dfc8af;
  border: 3px solid var(--white);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
  color: rgba(0, 0, 0, 0.42);
  font-size: 12px;
  font-weight: 800;
}

.face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.body {
  width: 100%;
  height: 100%;
  border-radius: 44% 44% 18px 18px;
  background: linear-gradient(150deg, var(--charcoal), #747262);
  box-shadow: inset 0 -28px 0 rgba(255, 255, 255, 0.08);
}

.legs {
  width: 58%;
  height: 100%;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(90deg, #242424 0 44%, transparent 44% 56%, #242424 56%);
}

.fit-mini {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.fit-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.fit-result.compact {
  margin-top: 0;
}

.fit-result strong {
  display: block;
  margin-top: 4px;
}

.fit-result ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.fit-score {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  justify-self: start;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
}

.fit-score span {
  font-size: 30px;
  font-weight: 900;
}

.fit-score small {
  margin-top: -28px;
  color: rgba(255, 255, 255, 0.72);
}

.twin-output {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.twin-image {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.twin-image.mini {
  margin-top: 14px;
  max-height: 420px;
}

.twin-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed #cfc7bb;
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--muted);
  text-align: center;
}

.verify-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(168, 97, 84, 0.32);
  background: #fff7f3;
}

.verify-box a {
  color: #9b3f33;
  font-weight: 800;
}

.local-twin {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfaf7, #f2eee6);
  border: 1px solid var(--line);
}

.local-twin-card {
  width: min(320px, 100%);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.local-twin-head {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: var(--shadow);
  background: #dcc7af;
  z-index: 2;
}

.local-twin-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-twin-look {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  margin-top: -22px;
  background: var(--soft);
}

.local-twin-look img {
  height: 100%;
  object-fit: cover;
}

.local-twin-card span {
  color: var(--muted);
  font-size: 13px;
}

.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 22px;
}

.chat-window {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 80;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--white);
}

.chat-body {
  padding: 14px;
  height: 310px;
  overflow: auto;
  background: #fbfaf7;
}

.msg {
  max-width: 78%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
}

.msg.me {
  margin-left: auto;
  background: var(--ink);
  color: var(--white);
}

.msg small {
  display: block;
  margin-top: 4px;
  opacity: 0.62;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.admin-chat {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.chat-list button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  background: var(--white);
  text-align: left;
}

.chat-list button.active {
  background: var(--soft);
}

.footer {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 28px;
  padding: 44px clamp(18px, 4vw, 56px);
  background: var(--ink);
  color: var(--white);
}

.footer p,
.footer a {
  color: rgba(255, 255, 255, 0.72);
}

.hidden {
  display: none !important;
}

@media (max-width: 1060px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-scroll {
    grid-column: 1 / -1;
    order: 3;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

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

  .layout,
  .detail,
  .admin-chat,
  .fitroom {
    grid-template-columns: 1fr;
  }

  .side {
    position: sticky;
    top: 0;
    z-index: 60;
    border-right: 0;
    padding: 14px;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-nav button {
    flex: 0 0 auto;
  }

  .form-grid,
  .footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .nav-actions .text-btn {
    display: none;
  }

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

  .stats {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .hero {
    min-height: 68vh;
  }
}
