/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  overflow-wrap: break-word;
}
svg { display: block; flex: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: var(--z-toast);
  background: var(--primary); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  font-weight: 600; transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: calc(12px + var(--safe-top)); }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.text-accent { color: var(--accent-ink); }
.text-danger, .danger-text { color: var(--danger); }
.text-success { color: var(--success); }

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
  position: relative;
  max-width: var(--app-max);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
}
@media (min-width: 520px) {
  body { background: var(--brand-50); }
  .app { box-shadow: 0 0 0 1px var(--line), var(--shadow-2); }
}

.main { outline: none; }
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 40px); }
body[data-chrome="action"] .view { padding-bottom: calc(var(--actionbar-h) + var(--safe-bottom) + 24px); }
body[data-chrome="none"] .view { padding-bottom: calc(var(--safe-bottom) + 16px); }
.view.has-selectbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 190px); }

.page { padding: 8px 20px 0; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding-top: var(--safe-top);
  background: rgba(250, 250, 249, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner {
  height: var(--topbar-h);
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: 0 6px;
}
.topbar__inner--root { grid-template-columns: 1fr auto; padding: 0 16px 0 20px; }
.topbar__title {
  font-size: 17px; font-weight: 600; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__title--root { font-size: 22px; font-weight: 700; text-align: left; letter-spacing: -0.03em; }
.topbar__right { display: flex; justify-content: flex-end; }
.brand-h { font-size: inherit; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.brand__mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 6px 12px -6px rgba(0, 30, 22, .45); }
.brand__word { font-family: var(--font-sans); font-size: 22px; font-weight: 900; line-height: 1; letter-spacing: -0.04em; color: var(--brand); }
.logo-mark { display: block; flex: none; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-grid; place-items: center; color: var(--ink);
  transition: background var(--dur-1);
}
.icon-btn:active { background: var(--surface-2); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); } }

.topbar__actions { display: flex; align-items: center; gap: 4px; }
.noti-btn { position: relative; }
.noti-btn__count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger, #E5484D); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bg, #fff);
}
.noti-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 10px; font-size: 14px; color: var(--text-2); min-height: 36px; }
.noti-head__act { display: flex; gap: 2px; flex: none; }
.noti-item { display: flex; align-items: stretch; }
.noti-item .noti-row { flex: 1; min-width: 0; padding-right: 4px; }
.noti-del { flex: none; width: 48px; display: grid; place-items: center; color: var(--subtle); transition: background var(--dur-1), color var(--dur-1); }
.noti-del:active { background: var(--danger-soft); color: var(--danger); }
@media (hover: hover) { .noti-del:hover { background: var(--danger-soft); color: var(--danger); } }
.noti-row { align-items: flex-start; }
.noti-row__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 8px; background: transparent; }
.noti-row.is-unread .noti-row__dot { background: var(--accent, var(--brand)); }
.noti-row:not(.is-unread) .list-row__title { font-weight: 500; color: var(--text-2); }
.noti-row__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: var(--text-2); margin-top: 2px; white-space: pre-line; }
.noti-row:not(.is-unread) .noti-row__text { color: var(--muted); }
.noti-row.is-open .noti-row__text { display: block; -webkit-line-clamp: unset; overflow: visible; }

.points-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px 0 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 650;
  transition: border-color var(--dur-1);
}
.points-chip::before { content: ""; position: absolute; inset: -4px; }
.points-chip:active { border-color: var(--line-strong); }
.points-chip__dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: var(--lime); font-size: 12px; font-weight: 800;
  display: grid; place-items: center; letter-spacing: 0;
}

/* Tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max); z-index: var(--z-bar);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar ul { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tabbar__item {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--subtle); font-size: 12px; font-weight: 500;
  transition: color var(--dur-1);
}
.tabbar__item[aria-current] { color: var(--brand); font-weight: 700; }
.tabbar__item[aria-current]::before {
  content: ""; position: absolute; top: -1px; width: 22px; height: 2px; border-radius: 2px; background: var(--brand);
}
body[data-chrome="action"] .tabbar,
body[data-chrome="none"] .tabbar { display: none; }

/* 앱(Capacitor): 더블 탭 확대 막기 — js/native.js 가 <html class="is-app"> 을 붙여요 */
html.is-app, html.is-app body { touch-action: manipulation; }
/* 앱: 길게 누르기 메뉴(링크 미리보기·열기·복사·공유), 글자 선택, 끌기 막기 — 입력칸은 그대로 */
html.is-app { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html.is-app a, html.is-app img, html.is-app button { -webkit-user-drag: none; user-drag: none; }
html.is-app input, html.is-app textarea, html.is-app select, html.is-app [contenteditable="true"] {
  -webkit-touch-callout: default; -webkit-user-select: text; user-select: text;
}

/* 관리자 > 회원으로 로그인 중 표시 */
.imp-bar {
  position: fixed; top: calc(6px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; gap: 6px; max-width: calc(100% - 32px);
  padding: 4px 6px 4px 12px; border-radius: 999px; background: #B42318; color: #fff; font-size: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); white-space: nowrap;
}
.imp-bar span { overflow: hidden; text-overflow: ellipsis; }
.imp-bar button { border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255, 255, 255, .2); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Action bar (sticky bottom CTA) */
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max); z-index: var(--z-bar);
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 12px 20px calc(12px + var(--safe-bottom));
}
.actionbar__inner { display: flex; gap: 8px; align-items: center; }
.actionbar__inner > .btn { flex: 1; }
.actionbar__inner > .btn--secondary { flex: 0 0 34%; }
/* 구매 동의 체크박스: 결제 버튼 바로 위에 항상 보이게 */
.actionbar__inner:has(.actionbar__agree) { flex-wrap: wrap; row-gap: 10px; }
.actionbar__agree { flex: 0 0 100%; font-size: 13px; line-height: 1.4; }
body[data-chrome="action"] .view:has(.actionbar__agree) { padding-bottom: calc(var(--actionbar-h) + var(--safe-bottom) + 84px); }

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
  font-family: var(--font-display); font-style: italic; font-weight: 600; letter-spacing: 0;
  font-size: 17px; line-height: 1.2; color: var(--accent-ink); letter-spacing: .01em;
}
.section { margin-top: 40px; }
.section--tight { margin-top: 28px; }
.section--first { margin-top: 16px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section__title { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.section__link {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px;
  font-size: 14px; color: var(--muted); font-weight: 500;
}
.block-title { display: block; font-size: 16px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
.block-title .subtle { font-weight: 500; margin-left: 2px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-head .block-title { margin: 0; }
.page-lead { font-size: 14px; color: var(--muted); margin: 4px 0 16px; }
.body-text { font-size: 15px; color: var(--text-2); line-height: 1.75; }
.unit { font-size: .62em; font-weight: 600; margin-left: 2px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 20px; border-radius: 12px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1) var(--ease-out), opacity var(--dur-1);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn--soft { background: var(--surface-2); color: var(--ink); }
.btn--ghost { color: var(--ink); }
.btn--accent { background: var(--lime); color: var(--brand); font-weight: 700; }
.btn--on-dark { background: rgba(255, 255, 255, .12); color: #fff; }
@media (hover: hover) {
  .btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
  .btn--secondary:hover:not(:disabled) { border-color: var(--ink); }
  .btn--soft:hover:not(:disabled), .btn--ghost:hover:not(:disabled) { background: var(--surface-3); }
  .btn--on-dark:hover { background: rgba(255, 255, 255, .18); }
  .btn--accent:hover:not(:disabled) { background: var(--lime-400); }
}
.btn--lg { height: 56px; font-size: 17px; border-radius: 14px; }
.btn--md { height: 44px; font-size: 15px; padding: 0 16px; }
.btn--sm { height: 36px; font-size: 14px; padding: 0 12px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; min-width: 0; }
.btn-row--icons > .btn { flex-direction: column; gap: 3px; height: 60px; padding: 0 4px; font-size: 13px; }

/* ==========================================================================
   Chips, tabs, segmented
   ========================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.chips--scroll {
  flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 0 20px; scroll-padding: 0 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips--scroll::-webkit-scrollbar { display: none; }
.chips--scroll .chip { flex: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .chips--scroll { cursor: grab; }
  .chips--scroll.is-dragging { cursor: grabbing; user-select: none; }
  .chips--scroll.is-dragging .chip { pointer-events: none; }
}
.chip--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.tabs {
  position: sticky; top: calc(var(--topbar-h) + var(--safe-top)); z-index: 5;
  display: flex; margin: 0 -20px; padding: 0 8px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.tabs__item {
  position: relative; flex: 1;
  min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 15px; font-weight: 500; color: var(--subtle); white-space: nowrap;
}
.tabs__item[aria-current="page"] { color: var(--brand); font-weight: 700; }
.tabs__item[aria-current="page"]::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand);
}
.tabs__count { font-size: 12px; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 360px) { .tabs__item { font-size: 14px; } }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--surface-2);
}
.seg__btn { height: 40px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background var(--dur-1), color var(--dur-1); }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; }
.summary-line { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   Badges & thumbs
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1; white-space: nowrap;
}
.badge--LEGEND { color: var(--lime); background: var(--brand); }
.badge--EPIC { color: var(--g-epic); background: var(--g-epic-bg); }
.badge--RARE { color: var(--g-rare); background: var(--g-rare-bg); }
.badge--COMMON { color: var(--g-common); background: var(--g-common-bg); }
.badge--neutral { color: var(--text-2); background: var(--surface-2); letter-spacing: 0; }
.badge--dark { color: #fff; background: var(--primary); letter-spacing: .02em; }
.badge--accent { color: var(--accent-ink); background: var(--accent-soft); letter-spacing: 0; }
.badge--success { color: var(--success); background: var(--success-soft); letter-spacing: 0; }

.gbg-LEGEND { background: var(--g-legend-bg); } .gfg-LEGEND { color: var(--g-legend); }
.gbg-EPIC { background: var(--g-epic-bg); } .gfg-EPIC { color: var(--g-epic); }
.gbg-RARE { background: var(--g-rare-bg); } .gfg-RARE { color: var(--g-rare); }
.gbg-COMMON { background: var(--g-common-bg); } .gfg-COMMON { color: var(--g-common); }

.thumb {
  position: relative; overflow: hidden;
  display: grid; place-items: center; aspect-ratio: 1 / 1; flex: none;
  border-radius: var(--r-md);
  color: var(--t-fg);
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 60%),
    var(--t-bg);
}
.thumb--sm { width: 44px; border-radius: 10px; }
.thumb--row { width: 56px; border-radius: 12px; }
.thumb--md { width: 100%; }
.thumb--lg { width: 100%; border-radius: var(--r-lg); }
.thumb--xl { width: 100%; border-radius: var(--r-xl); }

/* ==========================================================================
   Cards & lists
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card--flat { background: var(--surface-2); border-color: transparent; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 12px 16px; text-align: left;
  transition: background var(--dur-1);
}
a.list-row:active, button.list-row:active { background: var(--surface-2); }
@media (hover: hover) { a.list-row:hover, button.list-row:hover { background: var(--surface-2); } }
.list-row__icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { display: block; font-size: 15px; font-weight: 600; }
.list-row__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-row__trail { display: flex; align-items: center; gap: 4px; flex: none; color: var(--subtle); font-size: 14px; }
.list-row__trail .badge { margin-right: 2px; }
.row-actions { display: flex; gap: 6px; flex: none; }

.notice {
  display: flex; gap: 10px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.65;
}
.notice svg { color: var(--muted); margin-top: 2px; }
.notice--accent { background: var(--accent-soft); color: var(--accent-ink); }
.notice--accent svg { color: var(--accent); }

.rules { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.rules li { position: relative; padding-left: 12px; }
.rules li::before { content: ""; position: absolute; left: 0; top: .7em; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

.empty { text-align: center; padding: 56px 12px; }
.empty__icon {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.empty__title { font-size: 17px; font-weight: 700; }
.empty__desc { font-size: 14px; color: var(--muted); margin-top: 6px; }
.empty .btn { margin-top: 20px; }

/* Key/value summary */
.summary { display: grid; gap: 10px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.summary__row dt { color: var(--muted); }
.summary__row dd { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.summary__row--total { padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--line); font-size: 17px; }
.summary__row--total dt { color: var(--ink); font-weight: 700; }
.summary__row--total dd { font-weight: 700; }

.info-list { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 20px; }
.info-list > div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; font-size: 14px; }
.info-list dt { color: var(--muted); }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 20px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); font-size: 16px;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.textarea { height: auto; min-height: 88px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2357534E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select--sm { width: auto; height: 40px; padding: 0 36px 0 12px; font-size: 14px; border-radius: 10px; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(1, 47, 38, .12); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(185, 28, 28, .12); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.field__help { font-size: 13px; color: var(--muted); }
.field__error { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--danger); font-weight: 500; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; height: 52px; }

.check {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0;
  font-size: 14px; color: var(--text-2); cursor: pointer; line-height: 1.55;
}
.check input, .check-box {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 22px; height: 22px; margin: 0; border-radius: 6px;
  border: 1.5px solid var(--line-strong); background: var(--surface) center / 16px no-repeat;
  cursor: pointer; transition: background-color var(--dur-1), border-color var(--dur-1);
}
.check input:checked {
  background-color: var(--primary); border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 10px 16px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row.is-disabled { opacity: .45; cursor: not-allowed; }   /* 앱 설정: "알림 받기"가 꺼져 있으면 */
.switch-row__title { display: block; font-size: 15px; font-weight: 600; }
.switch-row__meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  position: relative; width: 48px; height: 28px; border-radius: 999px;
  background: var(--line-strong); cursor: pointer; transition: background var(--dur-2);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--dur-2) var(--ease-out);
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }

.radio-list { display: grid; gap: 8px; }
.radio-card {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.radio-card input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  transition: border var(--dur-1);
}
.radio-card input:checked { border: 6px solid var(--primary); }
.radio-card:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--accent-soft); }
.radio-card__body { flex: 1; min-width: 0; }
.radio-card__title { display: block; font-size: 15px; font-weight: 600; }
.radio-card__meta { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.radio-card__trail { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; }
.stepper button:disabled { color: var(--line-strong); cursor: not-allowed; }
.stepper output { min-width: 40px; text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: var(--lime); font-size: 22px; font-weight: 700;
}
.avatar--sm { width: 40px; height: 40px; font-size: 16px; background: var(--surface-2); color: var(--text-2); }
.avatar--img { overflow: hidden; background: var(--surface-2); }
.avatar--lg { width: 80px; height: 80px; font-size: 30px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.avatar-edit__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.avatar-edit__actions .field__help { flex-basis: 100%; }
.avatar-edit__pick { position: relative; cursor: pointer; }
.avatar-edit__pick:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr 136px; align-items: center; gap: 4px;
  margin-top: 8px; padding: 24px 20px 24px 24px; min-height: 228px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #013A2F 0%, var(--brand) 55%, var(--brand-700) 100%);
  color: #fff;
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: 10px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 238, 68, .26), rgba(201, 238, 68, 0) 68%); pointer-events: none;
}
.hero__text { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--lime); }
.hero__title { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.25; margin: 6px 0 6px; color: #fff; }
.hero__desc { font-size: 14px; color: rgba(255, 255, 255, .78); margin-bottom: 18px; }
.hero__art { position: relative; z-index: 1; margin-right: -8px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.quick__item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0;
  font-size: 13px; font-weight: 500; color: var(--text-2); border-radius: var(--r-md);
}
.quick__icon {
  width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-1);
}
.quick__item:active .quick__icon { transform: scale(.95); }

.banner {
  display: flex; align-items: center; gap: 16px; margin-top: 40px; padding: 20px;
  border-radius: var(--r-lg); background: var(--primary); color: #fff;
}
.banner__icon { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--lime); }
.banner__body { flex: 1; min-width: 0; }
.banner__eyebrow { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--lime); line-height: 1.2; }
.banner__title { font-size: 17px; font-weight: 700; margin-top: 2px; }
.banner__meta { font-size: 13px; color: rgba(255, 255, 255, .72); margin-top: 2px; }
.banner > svg:last-child { color: rgba(255, 255, 255, .6); }

.feed-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.feed-row__text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; }
.feed-row__text strong { font-weight: 650; }
.feed-row__sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--subtle); }

.footnote { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--subtle); line-height: 1.75; }
.footnote strong { color: var(--muted); font-weight: 600; }
.footnote__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; font-weight: 900; letter-spacing: -0.04em; color: var(--brand); }
.footnote__brand .logo-mark { border-radius: 7px; }

/* ==========================================================================
   Boxes
   ========================================================================== */
.box-art { width: 100%; height: auto; overflow: visible; }
.box-art__lid { transform-box: fill-box; transform-origin: 50% 100%; }

.box-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.box-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2);
}
.box-card:active { transform: scale(.985); }
@media (hover: hover) { .box-card:hover { box-shadow: var(--shadow-2); } }
.box-card__art { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .86; background: var(--tone); }
.box-card__art .box-art { width: 70%; }
.box-card__tag { position: absolute; top: 10px; left: 10px; }
.box-card__body { padding: 12px 14px 14px; }
.box-card__en { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--muted); line-height: 1.2; }
.box-card__name { font-size: 15px; font-weight: 650; margin-top: 2px; }
.box-card__price { font-size: 16px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.box-card__meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 3px; }

.detail-hero { position: relative; margin: -8px -20px 0; aspect-ratio: 1 / .78; display: grid; place-items: center; background: var(--tone); }
.detail-hero .box-art { width: 56%; }
.detail-head { padding-top: 22px; }
.detail-title { font-size: 25px; font-weight: 700; letter-spacing: -0.04em; margin-top: 4px; line-height: 1.3; }
.detail-desc { font-size: 15px; color: var(--text-2); margin-top: 8px; }
.detail-price { font-size: 27px; font-weight: 750; margin-top: 16px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-off { color: var(--accent-ink); font-weight: 750; margin-right: 6px; }
.price-was { font-size: 14px; color: var(--subtle); text-decoration: line-through; font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.fact { padding: 14px 6px; text-align: center; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact__label { font-size: 12px; color: var(--muted); }
.fact__value { font-size: 16px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.prob-group { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.prob-group + .prob-group { margin-top: 12px; }
.prob-group__head { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; }
.prob-group__total { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prob-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.prob-row + .prob-row { border-top: 1px solid var(--line); }
.prob-row--btn { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.prob-row--btn:hover { background: var(--surface-2); }
.prob-row--btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* 구성 상품 정보 팝업 */
.gallery--sheet { margin: 0 -20px; }
.prod-pop { padding: 14px 0 4px; }
.prod-pop__meta { font-size: 13px; color: var(--muted); }
.prod-pop__name { font-size: 18px; font-weight: 700; margin-top: 4px; line-height: 1.4; }
.prod-pop__price { font-size: 20px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.prod-pop__price .unit { font-size: 14px; font-weight: 600; margin-left: 2px; }
.prod-pop__desc { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.prob-row__body { flex: 1; min-width: 0; }
.prob-row__name { font-size: 14px; font-weight: 550; }
.prob-row__value { font-size: 12px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.prob-row__pct { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

.buy-item { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-top: 8px; }
.buy-item__art { width: 72px; height: 72px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--tone); }
.buy-item__art .box-art { width: 82%; }
.buy-item__name { font-size: 16px; font-weight: 650; }
.buy-item__price { font-size: 14px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.done { text-align: center; padding-top: 32px; }
.done__art { width: 200px; height: 200px; margin: 0 auto 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); }
.done__art .box-art { width: 70%; }
.done__title { font-size: 23px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.4; }
.done p { margin-top: 10px; font-size: 15px; }

/* ==========================================================================
   Open (immersive)
   ========================================================================== */
.view--open { background: radial-gradient(90% 55% at 50% 36%, #FFFFFF 0%, var(--bg) 72%); }
.open {
  display: flex; flex-direction: column; align-items: center;
  min-height: calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--safe-bottom) - 16px);
  padding: 4px 20px 8px;
}
.open__count { min-height: 20px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.open__stage { position: relative; flex: 1; width: 100%; min-height: 360px; display: grid; place-items: center; }
.open__stage > * { grid-area: 1 / 1; }
.open__glow {
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--burst, #EADFCB) 0%, rgba(255, 255, 255, 0) 66%);
  opacity: .55; transition: opacity .4s, transform .6s var(--ease-out);
}
.open__burst {
  width: 340px; height: 340px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0%, var(--burst, #EADFCB) 22%, rgba(255, 255, 255, 0) 62%);
  opacity: 0; transform: scale(.2);
}
.open__box { width: 220px; border-radius: 28px; }
.open__box .box-art { transform-origin: 50% 88%; }
.open__result { width: 100%; max-width: 310px; }
.open__stage[data-grade="LEGEND"] { --burst: #D6F566; }
.open__stage[data-grade="EPIC"] { --burst: #D8C0F2; }
.open__stage[data-grade="RARE"] { --burst: #BCCDF4; }
.open__stage[data-grade="COMMON"] { --burst: #E7E0D3; }
.open__stage[data-state="shaking"] .box-art { animation: rp-shake .72s cubic-bezier(.36, .07, .19, .97) both; }
.open__stage[data-state="bursting"] .box-art__lid { transform: translate(0, -90px) rotate(-16deg); opacity: 0; transition: transform .52s var(--ease-out), opacity .4s ease .12s; }
.open__stage[data-state="bursting"] .open__burst { animation: rp-burst .75s var(--ease-out) forwards; }
.open__stage[data-state="bursting"] .open__glow,
.open__stage[data-state="revealed"] .open__glow { opacity: 1; transform: scale(1.35); }
.open__stage[data-state="revealed"] .open__box { display: none; }
.open__stage[data-state="revealed"] .open__result { animation: rp-reveal .55s var(--ease-spring) both; }
.open__hint { min-height: 24px; margin: 8px 0 18px; font-size: 15px; font-weight: 500; color: var(--muted); text-align: center; }
.open__actions { width: 100%; display: grid; gap: 8px; }

.reveal-card {
  padding: 22px 22px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-3);
}
.reveal-card[data-grade="LEGEND"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--lime), 0 0 0 3px var(--brand), var(--shadow-3); }
.reveal-card .thumb { width: 168px; margin: 16px auto 18px; }
.reveal-card__name { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.35; }
.reveal-card__value { font-size: 14px; color: var(--muted); margin-top: 6px; }

.results { width: 100%; padding-top: 8px; padding-bottom: calc(96px + var(--safe-bottom)); }   /* 아래 떠 있는 버튼 자리 */
.results__head { text-align: center; margin-bottom: 20px; }
.results__title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.results__head p:last-child { margin-top: 4px; font-size: 15px; color: var(--muted); }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.result-mini {
  padding: 8px 8px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  animation: rp-reveal .45s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms);
}
.result-mini[data-grade="LEGEND"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.result-mini .thumb { margin-bottom: 8px; border-radius: 10px; }
.result-mini__name {
  margin-top: 6px; font-size: 12px; font-weight: 550; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-mini__value { margin-top: 4px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 결과 화면 아래 떠 있는 버튼: (남은 박스 이어서 열기) + 상품함 보기 · 박스 더 둘러보기 */
.open__float {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: var(--app-max); display: grid; gap: 8px;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.open__float-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.open__float-row .btn { min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; }

@keyframes rp-shake {
  0%, 100% { transform: rotate(0); }
  12% { transform: rotate(-5deg) translateY(-3px); }
  26% { transform: rotate(5deg); }
  40% { transform: rotate(-4deg) translateY(-4px); }
  54% { transform: rotate(4deg); }
  68% { transform: rotate(-2deg) translateY(-2px); }
  82% { transform: rotate(1deg); }
}
@keyframes rp-burst { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes rp-reveal { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Vault
   ========================================================================== */
.item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.item-card {
  position: relative; display: block; width: 100%; padding: 10px 10px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1) var(--ease-out);
}
.item-card:active { transform: scale(.985); }
.item-card .thumb { margin-bottom: 10px; }
.item-card__name {
  margin-top: 2px; font-size: 14px; font-weight: 600; line-height: 1.45; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.item-card__value { margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-card__lock {
  position: absolute; top: 18px; right: 18px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: var(--shadow-1);
}
.item-card__check {
  position: absolute; top: 18px; left: 18px; width: 26px; height: 26px; border-radius: 50%;
  display: none; place-items: center; color: transparent;
  background: rgba(255, 255, 255, .94); border: 1.5px solid var(--line-strong);
}
.is-selecting .item-card__check { display: grid; }
.item-card[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.item-card[aria-pressed="true"] .item-card__check { background: var(--primary); border-color: var(--primary); color: #fff; }

.selectbar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  width: 100%; max-width: var(--app-max);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px 12px;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
/* 첫 줄: "N개 선택되었습니다." · 둘째 줄: 버튼들을 같은 너비로 */
.selectbar__count { flex: 0 0 100%; font-size: 14px; font-weight: 600; white-space: nowrap; }
.selectbar .btn { flex: 1 1 64px; min-width: 0; padding-left: 6px; padding-right: 6px; gap: 4px; white-space: nowrap; }   /* 좁으면 다음 줄로 */
@media (max-width: 400px) { .selectbar .btn { font-size: 13px; } .selectbar .btn svg { display: none; } }
.selectbar .btn[hidden] { display: none; }

.item-sheet { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
.item-sheet__name { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.35; margin: 8px 0 12px; }
.item-sheet__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; gap: 6px; font-size: 14px; }
.kv > div { display: flex; gap: 10px; }
.kv dt { color: var(--muted); width: 44px; flex: none; }
.kv dd { font-variant-numeric: tabular-nums; }

.box-row { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.box-row + .box-row { margin-top: 10px; }
.box-row__art { width: 84px; height: 84px; border-radius: 16px; flex: none; display: grid; place-items: center; background: var(--tone); }
.box-row__art .box-art { width: 80%; }
.box-row__body { flex: 1; min-width: 0; }
.box-row__en { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--muted); line-height: 1.2; }
.box-row__name { font-size: 16px; font-weight: 650; }
.box-row__meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.box-row__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.gift-row { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.gift-row + .gift-row { margin-top: 10px; }
.gift-row__media { width: 56px; flex: none; }
.gift-row__media .box-row__art { width: 56px; height: 56px; border-radius: 12px; }
.gift-row__body { flex: 1; min-width: 0; }
.gift-row__from { font-size: 13px; color: var(--muted); }
.gift-row__from strong { color: var(--ink); font-weight: 650; }
.gift-row__title { font-size: 15px; font-weight: 650; margin-top: 2px; }
.gift-row__msg { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--text-2); }
.gift-row__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.gift-row__time { font-size: 12px; color: var(--subtle); }

.ship-card { display: block; width: 100%; padding: 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color var(--dur-1); }
.ship-card + .ship-card { margin-top: 10px; }
@media (hover: hover) { .ship-card:hover { border-color: var(--line-strong); } }
.ship-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ship-card__date { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.ship-card__title { margin-top: 10px; font-size: 15px; font-weight: 650; }
.ship-card__meta { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 6px; border-top: 2px solid var(--line); padding-top:16px;}
.steps__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--subtle); text-align: center; }
.steps__item::before { content: ""; position: absolute; top: 5px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.steps__item:first-child::before { display: none; }
.steps__dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); }
.steps__item.is-done { color: var(--ink); font-weight: 600; }
.steps__item.is-done::before { background: var(--brand); }
.steps__item.is-done .steps__dot { background: var(--brand); }
.steps__item.is-current .steps__dot { box-shadow: 0 0 0 4px rgba(1, 47, 38, .14); }

.addr-card { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.addr-card + .addr-card { margin-top: 10px; }
.addr-card--selected { border-color: var(--brand); }
.addr-card__head { display: flex; align-items: center; gap: 8px; }
.addr-card__label { font-size: 16px; font-weight: 700; }
.addr-card__who { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.addr-card__addr { margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.addr-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.addr-empty {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 64px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); font-weight: 600; color: var(--text-2);
}

/* ==========================================================================
   Market
   ========================================================================== */
.prod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }   /* minmax(0): a long name never widens a column */
.prod-card { display: block; position: relative; min-width: 0; }
.prod-card .thumb { border-radius: var(--r-lg); }
.prod-card__tag { position: absolute; top: 10px; left: 10px; }
.prod-card__brand {
  margin-top: 10px; min-height: 18px; font-size: 12px; font-weight: 600; line-height: 18px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Always two lines tall (clamped), so prices line up across the row */
.prod-card__name {
  margin-top: 2px; min-height: calc(14px * 1.45 * 2); font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.prod-card__price { margin-top: 4px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-card__was { margin-top: 1px; font-size: 13px; color: var(--subtle); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.product-hero { margin: -8px -20px 0; padding: 20px 20px 0; background: var(--surface); }
.product-hero .thumb { max-width: 400px; margin: 0 auto; }

/* ==========================================================================
   My page
   ========================================================================== */
.profile { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.profile__body { flex: 1; min-width: 0; }
.profile__name { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.profile__meta { font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wallet { position: relative; overflow: hidden; margin-top: 20px; padding: 22px 20px 20px; border-radius: var(--r-xl); background: var(--primary); color: #fff; }
.wallet::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 201, 121, .22), rgba(232, 201, 121, 0) 70%); pointer-events: none;
}
.wallet__label { font-size: 13px; color: rgba(255, 255, 255, .72); }
.wallet__amount { margin-top: 4px; font-size: 31px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wallet__amount span { font-size: 19px; color: var(--lime); margin-left: 3px; }
.wallet__actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 16px; }
.wallet__actions .btn { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat { display: block; padding: 14px 6px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat__value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--muted); }
.menu-title { margin: 30px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.my-foot { margin-top: 28px; text-align: center; }

.code-card { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--accent-soft); }
.code-card__body { flex: 1; min-width: 0; }
.code-card__label { font-size: 13px; color: var(--accent-ink); }
.code-card__code { font-size: 22px; font-weight: 750; letter-spacing: .08em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.order-row { padding: 14px 16px; }
.order-row__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-row__date { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.order-row__title { margin-top: 6px; font-size: 15px; font-weight: 600; }
.order-row__amount { margin-top: 2px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.log-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.log-row__title { font-size: 15px; font-weight: 600; }
.log-row__date { font-size: 12px; color: var(--subtle); margin-top: 2px; font-variant-numeric: tabular-nums; }
.log-row__amount { text-align: right; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-row__balance { display: block; font-size: 12px; font-weight: 400; color: var(--subtle); margin-top: 2px; }
.balance-head { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.balance-head__label { font-size: 13px; color: var(--muted); }
.balance-head__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.ticket { position: relative; display: flex; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ticket + .ticket { margin-top: 10px; }
.ticket__value {
  width: 104px; flex: none; display: grid; place-items: center; padding: 16px 6px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  border-right: 1.5px dashed var(--line-strong);
}
.ticket__body { flex: 1; min-width: 0; padding: 14px 16px; }
.ticket__name { font-size: 15px; font-weight: 650; }
.ticket__cond { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ticket__exp { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--subtle); margin-top: 8px; }
.ticket.is-off .ticket__value { background: var(--surface-2); color: var(--subtle); }
.ticket.is-off .ticket__name { color: var(--muted); }
.ticket__del { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--subtle); cursor: pointer; }
.ticket__del:hover { background: var(--surface-2); color: var(--text-2); }
.ticket__del:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ==========================================================================
   Ranking & events & charge
   ========================================================================== */
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 8px; align-items: end; margin-top: 16px; }
.podium__col { padding: 14px 8px 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.podium__col--1 { padding-top: 20px; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.podium__rank { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1; color: var(--muted); }
.podium__col--1 .podium__rank { color: var(--accent-ink); }
.podium .thumb, .podium .avatar { width: 56px; height: 56px; margin: 10px auto; }
.podium__col--1 .thumb, .podium__col--1 .avatar { width: 68px; height: 68px; }
.podium__name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__meta { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.podium__value { font-size: 13px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.rank-row__no { width: 24px; flex: none; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row--me { background: var(--accent-soft); }
.rank-row__value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.event-card { display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: transform var(--dur-2) var(--ease-out); }
.event-card + .event-card { margin-top: 12px; }
.event-card:active { transform: scale(.99); }
.event-card__visual { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 128px; padding: 22px 20px; background: var(--tone); color: var(--fg); }
.event-card__big { font-size: 22px; font-weight: 750; letter-spacing: -0.04em; line-height: 1.32; white-space: pre-line; }
.event-card__icon { width: 56px; height: 56px; flex: none; border-radius: 17px; display: grid; place-items: center; background: rgba(255, 255, 255, .55); }
.event-card--dark .event-card__icon { background: rgba(255, 255, 255, .1); color: var(--lime); }
.event-card__body { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; }
.event-card__title { font-size: 15px; font-weight: 650; }
.event-card__period { font-size: 12px; color: var(--muted); margin-top: 1px; }
.event-hero { margin: -8px -20px 0; }
.event-hero .event-card__visual { min-height: 200px; padding: 28px 20px; }
.event-hero .event-card__big { font-size: 27px; }

.stamps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.stamp {
  aspect-ratio: 1 / 1.2; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--subtle); font-size: 12px;
}
.stamp__day { font-weight: 700; font-size: 12px; }
.stamp.is-done { border-style: solid; border-color: var(--primary); background: var(--primary); color: #fff; }
.stamp--bonus { border-color: var(--accent); color: var(--accent-ink); }
.stamp--bonus.is-done { background: var(--lime); border-color: var(--brand); color: var(--brand); }

.pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pkg { position: relative; display: block; padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.pkg input { position: absolute; opacity: 0; pointer-events: none; }
.pkg:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--accent-soft); }
.pkg:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.pkg__amount { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pkg__bonus { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--accent-ink); min-height: 18px; }
.pkg__price { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Sheets / dialogs
   ========================================================================== */
dialog.sheet, dialog.alert {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: inherit;
}
dialog.sheet[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog.alert[open] { display: flex; align-items: center; justify-content: center; padding: 24px; }
dialog::backdrop { background: rgba(1, 20, 16, .5); }
.sheet__panel {
  width: 100%; max-width: var(--app-max); max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding-bottom: var(--safe-bottom);
  animation: rp-sheet-in .34s var(--ease-out);
}
dialog.alert .sheet__panel { max-width: 340px; border-radius: 22px; padding-bottom: 0; animation: rp-alert-in .24s var(--ease-out); }
dialog.is-closing .sheet__panel { animation: rp-sheet-out .2s var(--ease-in) forwards; }
dialog.alert.is-closing .sheet__panel { animation: rp-fade-out .15s var(--ease-in) forwards; }
.sheet__handle { width: 36px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line-strong); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 4px 20px; }
.sheet__title { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.sheet__body { padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet__foot { display: grid; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
dialog.alert .sheet__head { padding: 22px 20px 0; }
dialog.alert .sheet__body { padding: 8px 20px 20px; }
dialog.alert .sheet__foot { border-top: 0; padding-top: 0; }
.alert__msg { font-size: 15px; color: var(--text-2); line-height: 1.6; }

@keyframes rp-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rp-sheet-out { to { transform: translateY(100%); } }
@keyframes rp-alert-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes rp-fade-out { to { opacity: 0; transform: scale(.97); } }

/* Toast */
.toast-root {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: var(--z-toast);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  width: calc(100% - 32px); max-width: 448px; display: grid; gap: 8px; pointer-events: none;
}
body[data-chrome="action"] .toast-root { bottom: calc(var(--actionbar-h) + var(--safe-bottom) + 12px); }
body[data-chrome="none"] .toast-root { bottom: calc(var(--safe-bottom) + 20px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: 14px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 500; line-height: 1.45;
  box-shadow: var(--shadow-3); animation: rp-toast-in .28s var(--ease-out);
}
.toast svg { color: var(--lime); }
.toast--error svg { color: #FCA5A5; }
.toast.is-leaving { animation: rp-toast-out .18s var(--ease-in) forwards; }
@keyframes rp-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rp-toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Destructive confirm button */
.btn--primary.danger-bg { background: var(--danger); }
@media (hover: hover) { .btn--primary.danger-bg:hover:not(:disabled) { background: #991B1B; } }

/* ==========================================================================
   Auth (login)
   ========================================================================== */
.auth {
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px calc(24px + var(--safe-bottom));
}
.auth__brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 36px; }
.auth__brand .logo-mark { border-radius: 18px; box-shadow: 0 14px 28px -12px rgba(0, 30, 22, .5); }
.auth__word { margin-top: 16px; font-size: 32px; font-weight: 900; letter-spacing: -0.04em; color: var(--brand); line-height: 1; }
.auth__tagline { margin-top: 10px; font-size: 14px; color: var(--muted); }
.auth__switch { margin-top: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.auth__switch a { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 10px 4px; }
.auth__demo { margin-top: 20px; text-align: center; font-size: 12px; color: var(--subtle); }
body[data-chrome="bare"] .topbar, body[data-chrome="bare"] .tabbar { display: none; }
body[data-chrome="bare"] .view { padding-bottom: 0; }

/* Boot / error splash */
.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.splash .logo-mark { border-radius: 16px; }
.splash__msg { font-size: 15px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .splash--loading .logo-mark { animation: rp-pulse 1.2s ease-in-out infinite; }
}
@keyframes rp-pulse { 50% { transform: scale(.94); opacity: .8; } }
.auth__links { margin-top: 12px; text-align: center; font-size: 14px; }
.auth__links a { display: inline-block; padding: 10px 8px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.input--picker[readonly] { background: var(--surface); color: var(--ink); cursor: pointer; }
.input--picker + .field__error, .field .input--picker#ad-addr { margin-top: 8px; }

/* ==========================================================================
   Delivery inquiry chat
   ========================================================================== */
.view--chat { background: var(--surface-2); min-height: calc(100dvh - var(--topbar-h) - var(--safe-top)); }
.chat { padding: 0 16px 8px; }
.chat__head { margin: 0 -16px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat__title { font-size: 15px; font-weight: 650; }
.chat__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chat__list { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.chat__day { align-self: center; font-size: 12px; color: var(--subtle); background: rgba(255, 255, 255, .7); padding: 3px 10px; border-radius: 999px; margin: 6px 0; }
.chat__msg { display: flex; flex-direction: column; max-width: 82%; }
.chat__msg--me { align-self: flex-end; align-items: flex-end; }
.chat__msg--admin { align-self: flex-start; align-items: flex-start; }
.chat__who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.chat__who .logo-mark { border-radius: 6px; }
.chat__bubble { padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.chat__msg--me .chat__bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.chat__msg--admin .chat__bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat__time { font-size: 11px; color: var(--subtle); margin-top: 3px; font-variant-numeric: tabular-nums; }
.chat__empty { list-style: none; }
.chat__compose { display: flex; gap: 8px; align-items: flex-end; width: 100%; }
.chat__compose .textarea { flex: 1; min-height: 48px; max-height: 132px; padding: 12px 14px; resize: none; }
.chat__compose .btn { height: 48px; width: 52px; padding: 0; flex: none; }
.chat__compose .chat__attach { width: 44px; color: var(--muted); cursor: pointer; }
.chat__images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat__msg--me .chat__images { justify-content: flex-end; }
.chat__images a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.chat__images img { display: block; width: 120px; height: 120px; object-fit: cover; background: var(--surface-2); }

/* 이미지 첨부 (1:1 문의) */
.attach { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.attach__list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach__list[hidden] { display: none; }
.attach__item { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.attach__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach__del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.attach__add { width: 72px; height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 11px; cursor: pointer; }
.attach__add[hidden] { display: none; }
.attach:focus-within .attach__add, .chat__attach:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.actionbar__inner:has(.attach__list--bar:not([hidden])) { flex-wrap: wrap; row-gap: 8px; }
.attach__list--bar { flex: 0 0 100%; }
.attach__list--bar .attach__item { width: 56px; height: 56px; }
.ship-card__reply { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: var(--lime); font-size: 12px; font-weight: 700; }
.thumb--img { background: var(--surface); }
/* The image is laid over the square box, so a tall/wide photo never stretches it (aspect-ratio lets content grow the box) */
.thumb--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-line { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.item-flag { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.item-flag--out { background: var(--danger-soft); color: var(--danger); }
.item-flag--exp { background: var(--surface-2); color: var(--muted); }
.item-flag--soon { background: var(--accent-soft-2); color: var(--accent-ink); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; margin: -8px -20px 0; background: var(--surface); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: center; }
.gallery__dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.gallery__dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.gallery__dots span.on { background: var(--brand); width: 16px; border-radius: 3px; }
.detail-html { font-size: 15px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; }
.detail-html img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.detail-html p { margin: 0 0 10px; }
.detail-html h1, .detail-html h2, .detail-html h3 { font-size: 18px; margin: 18px 0 8px; color: var(--ink); }
.detail-html ul, .detail-html ol { padding-left: 20px; margin: 0 0 10px; list-style: revert; }
.detail-html table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.detail-html td, .detail-html th { border: 1px solid var(--line); padding: 6px 8px; }
.detail-html a { color: var(--brand); text-decoration: underline; }
.sold-out-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.62); font-weight: 800; color: var(--danger); font-size: 14px; letter-spacing: .04em; }
.gauge__bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gauge__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2E6B5A); border-radius: 999px; }
.gauge__meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; }

/* ---------- Agreements (회원가입) ---------- */
.agree { border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 14px 8px; background: var(--surface); }
.agree__all { padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.agree__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.agree .field__error { margin: -4px 0 4px; }
.link-btn { min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; flex: none; }
.link-btn:hover { color: var(--ink); }

/* ---------- Policy texts (결제·배송 안내) ---------- */
.policies { display: grid; gap: 8px; margin-top: 24px; }
.policy { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.policy summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 48px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--text-2);
  cursor: pointer; list-style: none;
}
.policy summary::-webkit-details-marker { display: none; }
.policy summary svg { color: var(--subtle); transition: transform .2s var(--ease-out); flex: none; }
.policy[open] summary svg { transform: rotate(180deg); }
.policy summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-md); }
.policy__body { padding: 0 14px 14px; font-size: 13px; line-height: 1.65; color: var(--muted); max-height: 320px; overflow: auto; }

/* ---------- Withdraw ---------- */
.withdraw-link { margin: 32px 0 8px; text-align: center; }
.withdraw-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 13px; color: var(--subtle); text-decoration: underline; text-underline-offset: 3px; }
.notice-list { margin: 12px 0 0; padding: 16px 16px 16px 34px; border-radius: var(--r-md); background: var(--surface-2); font-size: 14px; line-height: 1.6; color: var(--text-2); }
.notice-list li + li { margin-top: 6px; }
.notice--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Select mode (상품함) ---------- */
.toolbar__actions { display: flex; align-items: center; gap: 4px; flex: none; }

/* ---------- Popup layers ---------- */
.popup-layer {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 24px 20px;
  background: rgba(1, 28, 23, .55);
  animation: popup-fade .2s var(--ease-out);
}
.popup {
  grid-area: 1 / 1;
  width: min(100%, 360px); max-height: min(78dvh, 620px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-3);
  /* cards behind the top one peek out slightly */
  transform: translateY(calc(var(--depth, 0) * -14px)) scale(calc(1 - var(--depth, 0) * .04));
  transition: transform .25s var(--ease-out);
  animation: popup-in .3s var(--ease-spring);
}
.popup:not(:last-child) { pointer-events: none; }
.popup:not(:last-child) > * { visibility: hidden; }
.popup__body { flex: 1; overflow: auto; padding: 0; font-size: 15px; line-height: 1.6; }
.popup__body img { display: block; max-width: 100%; height: auto; border-radius:0; margin:0;}
.popup__body .detail-html img {margin:0;}
.popup__cta { padding: 0 20px 16px; }
.popup__foot { display: flex; border-top: 1px solid var(--line); }
.popup__foot button { flex: 1; min-height: 52px; background: none; border: 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.popup__foot button + button { border-left: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.popup__foot button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@keyframes popup-fade { from { opacity: 0; } }
@keyframes popup-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .popup-layer, .popup { animation: none; transition: none; } }

/* ---------- 고객센터 ---------- */
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search-field .input { padding-left: 42px; }
.article { padding-top: 16px; }
.article__head { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.article__title { margin: 8px 0 6px; font-size: 19px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.article__meta { font-size: 13px; color: var(--subtle); }
.faq { display: grid; gap: 8px; }
.faq__item summary > span { display: grid; gap: 2px; text-align: left; line-height: 1.45; padding: 12px 0; }
.faq__cat { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.ship-track { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ship-track .copy-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--brand); text-decoration: none; cursor: pointer; }

/* ---------- Mainpay PC payment layer ---------- */
.pay-layer { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(1, 28, 23, .6); }
.pay-layer__box { display: flex; flex-direction: column; width: min(760px, 100%); height: min(720px, 100%); background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-3); }
.pay-layer__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.pay-layer__head span { display: inline-flex; align-items: center; gap: 8px; }
.pay-layer__frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- Infinite lists ---------- */
.inf-foot { display: flex; justify-content: center; min-height: 48px; padding: 12px 0 24px; }
.inf-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: inf-spin .8s linear infinite; }
.inf-end { font-size: 13px; color: var(--subtle); }
@keyframes inf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .inf-spin { animation-duration: 2s; } }
.item-flag--gift { background: #EEF2FB; color: #1E40AF; margin-right: 4px; }

/* ---------- 결제 수단 (카드 / 간편결제) ---------- */
.pm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.pm-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pm-opt:hover { border-color: var(--line-strong); }
.pm-opt[aria-pressed="true"] { border-color: var(--brand); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pm-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pm-opt__logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.pm-opt__logo--text { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.pm-opt__name { display: grid; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.3; word-break: keep-all; }
.pm-opt[hidden] { display: none; }
.pm-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pm-opt__name small { font-size: 10px; font-weight: 500; color: var(--subtle); }

/* 트레이드 카드 (상품함 > 상품 > 트레이드) */
.input-unit { position: relative; display: block; }
.input-unit .input { padding-right: 44px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.input-unit > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--subtle); pointer-events: none; }
.trade-preview { margin: 16px 0 0; }
.trade-preview img { display: block; width: 100%; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow-2, 0 6px 16px rgba(0,0,0,.12)); }

/* 배송 상세: 관리자가 상품별로 배송취소한 상품 */
.list-row.is-cancelled .thumb, .list-row.is-cancelled .list-row__title { opacity: .5; }
.list-row.is-cancelled .list-row__title { text-decoration: line-through; }
.ship-cancel { color: var(--danger); white-space: normal; }

/* 소셜 로그인 (js/social.js) — 각 사이트 버튼 색 가이드 */
.social { margin-top: 24px; }
.auth__tabs { margin-bottom: 24px; }
.auth__panel .social { margin-top: 0; }
.auth__panel .social__divider { margin-bottom: 16px; }
.social--top { margin: 12px 0 8px; }
.social__divider { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.social__divider::before, .social__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social__list { display: grid; gap: 10px; }
.social-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 12px; border: 1px solid transparent; font-size: 16px; font-weight: 600; cursor: pointer; transition: filter var(--dur-1); }
.social-btn:active { filter: brightness(.95); }
.social-btn:disabled { opacity: .6; cursor: default; }
.social-btn__logo { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; }
.social-btn__logo svg { width: 100%; height: 100%; }
.social-btn--kakao { background: #FEE500; color: rgba(0,0,0,.85); }
.social-btn--naver { background: #03C75A; color: #fff; }
.social-btn--google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.social-btn--apple { background: #000; color: #fff; }

/* 실명인증 (간편인증) */
.identity__hero { text-align: center; padding: 28px 0 20px; }
.identity__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--brand); color: var(--lime); }
.identity__title { margin-top: 16px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.identity__desc { margin-top: 8px; color: var(--text-2); line-height: 1.6; }
.identity__list { list-style: none; margin: 8px 0 0; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.identity__list li { display: flex; gap: 8px; align-items: flex-start; }
.identity__list svg { color: var(--brand); flex: none; margin-top: 3px; }
.identity__foot { text-align: center; margin-top: 20px; font-size: 14px; }
.notice--error { background: var(--danger-soft, #FDF1F1); color: var(--danger, #C62F35); margin-bottom: 12px; }
.notice--error svg { color: inherit; }

/* 회원정보 찾기: 찾은 계정 카드 */
.find-acc { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); }
.find-acc__head { margin-bottom: 8px; font-size: 15px; }
.find-acc__line { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 14px; line-height: 1.5; word-break: break-all; }
.find-acc__line svg { flex: none; margin-top: 3px; color: var(--brand); }
.find-acc__form { margin-top: 12px; }

/* 확률표: 등급별 당첨 조건 */
.prob-group__rule { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 600; opacity: .85; margin: 0 8px; line-height: 1.4; }

/* 트레이드: 여러 상품 (한 줄에 2개) */
.trade-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; }
.trade-items__cell { padding: 8px 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.trade-items__cell .thumb { border-radius: 10px; }
.trade-items__name { margin-top: 8px; font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trade-items__price { margin-top: 2px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trade-items__cell .input-unit { margin-top: 8px; }
.trade-items__cell .input { height: 44px; font-size: 15px; padding-left: 10px; padding-right: 30px; }

/* 팝피드 > 배송현황 */
.ship-feed__row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ship-feed__main { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.ship-feed__main strong { flex: none; font-size: 14px; }
.ship-feed__title { min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-feed__times { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ship-feed__times div { display: flex; gap: 4px; }
.ship-feed__times dt { font-weight: 600; }
/* 탭이 4개 이상: 글자 길이만큼 나눠 한 줄에 (좁은 화면) */
.seg--tight { grid-auto-columns: auto; }
.seg--tight .seg__btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; }
@media (max-width: 400px) { .seg--tight .seg__btn { font-size: 13px; } }
.ship-feed__meta { font-size: 12px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* 회사 정보 (홈 · 마이 맨 아래) */
.company { margin-top: 16px; }
.company__links { display: flex; gap: 14px; margin-bottom: 10px; }
.company__links .link-btn { font-size: 12px; color: var(--muted); padding: 0; }
.company__info { display: grid; gap: 2px; }
.company__info div { display: flex; gap: 8px; }
.company__info dt { flex: none; color: var(--muted); }
.company__info dd { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.company__copy { margin-top: 10px; }
