:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #211d18;
  --ink-2: #4b443b;
  --muted: #6f665c;
  --line: #e7e0d4;
  --soft: #f4f0e8;
  --paper: #fdfbf7;
  --blue: #bc5a38;
  --blue-dark: #a44a2a;
  --accent-text: #9c4728;
  --green: #4f7b5b;
  --amber: #9a6318;
  --red: #b23a2a;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #efe9df; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(253,251,247,.9); position: sticky; top: 0; z-index: 10; }
.topbar__inner, .main, .footer__inner { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.topbar__inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand__mark { width: 26px; height: 26px; background: url("/assets/favicon.svg?v=3") center / contain no-repeat; }
.brand__mark span { display: none; }
.nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

.main { flex: 1; padding: 42px 0 64px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 36px; align-items: start; }
.eyebrow { margin: 0 0 10px; color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
h3 { margin: 0; font-size: 16px; letter-spacing: 0; }
.lead { max-width: 690px; margin: 18px 0 0; color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.service-note { margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.service-note strong { color: var(--ink); }

.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.panel__head, .panel__body, .panel__section { padding: 22px; }
.panel__head { border-bottom: 1px solid var(--line); }
.panel__body, .panel__section { display: grid; gap: 16px; }
.panel__section + .panel__section { border-top: 1px solid var(--line); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid #cdc3b4; border-radius: 8px; background: #fff; padding: 12px 13px; color: var(--ink); }
.field textarea { min-height: 124px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid #e0b7a3; outline-offset: 1px; border-color: var(--blue); }
.refund-guidance { display: grid; gap: 10px; margin: 4px 0; padding: 16px 0 16px 14px; border-left: 3px solid #c15a3c; }
.refund-guidance[hidden] { display: none; }
.refund-guidance > strong { font-size: 15px; }
.refund-guidance > p { margin: 0; font-size: 13px; line-height: 1.65; }
.refund-guidance fieldset { display: grid; gap: 8px; margin: 2px 0; padding: 0; border: 0; }
.refund-guidance legend { margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.refund-guidance label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.refund-guidance input { flex: 0 0 auto; margin-top: 2px; }
.refund-ack { padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; }
.help, .status-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.status-text[data-tone="error"] { color: var(--red); }
.status-text[data-tone="success"] { color: var(--green); }
.button { min-height: 44px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: #fff; padding: 11px 16px; font-weight: 750; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button:hover { background: var(--blue-dark); }
.button:disabled { opacity: .58; cursor: wait; }
.button--quiet { border-color: var(--line); background: #fff; color: var(--ink); }
.button--quiet:hover { background: var(--soft); }
.button--danger { border-color: #d7a39d; background: #fff; color: var(--red); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row .button { flex: 1 1 160px; }

.page-head { margin-bottom: 26px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 18px; align-items: start; }
.stage { display: grid; gap: 18px; }
.stage__top { display: flex; align-items: center; gap: 12px; }
.stage__icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #f6ece4; color: var(--blue); font-weight: 850; }
.stage__icon { flex: 0 0 42px; font-size: 12px; }
.stage[data-stage="active"] .stage__icon { background: #e6efe4; color: var(--green); }
.stage[data-stage="delayed"] .stage__icon { background: #fbeede; color: var(--amber); }
.stage[data-stage="ended"] .stage__icon { background: #f3e7e3; color: var(--red); }
.stage__title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.stage__description { color: var(--ink-2); line-height: 1.65; }
.seat-availability { display: grid; gap: 12px; padding: 16px; border: 1px solid #e0b670; border-radius: 8px; background: #fdf3e0; }
.seat-availability strong { font-size: 15px; }
.seat-availability p { margin: 0; color: #6a5a3f; font-size: 13px; line-height: 1.6; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fact { min-height: 94px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact:nth-child(2n) { border-right: 0; }
.fact:nth-last-child(-n+2) { border-bottom: 0; }
.fact span { color: var(--muted); font-size: 12px; }
.fact strong { display: block; margin-top: 8px; font-size: 15px; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 0; }
.timeline__item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 10px 0; }
.timeline__dot { width: 10px; height: 10px; margin-top: 5px; border: 2px solid #cabfb0; border-radius: 50%; }
.timeline__item[data-state="done"] .timeline__dot { border-color: var(--green); background: var(--green); }
.timeline__item[data-state="current"] .timeline__dot, .timeline__item[data-state="action"] .timeline__dot { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px #f6ece4; }
.timeline__item[data-state="delayed"] .timeline__dot { border-color: var(--amber); background: #fbeede; }
.timeline__item[data-state="pending"] { color: #8a8176; }
.timeline__item strong { display: block; font-size: 14px; }
.timeline__item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.request-list { display: grid; gap: 8px; }
.request { padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.request strong { display: flex; justify-content: space-between; gap: 10px; }
.request span { color: var(--muted); }
.empty { padding: 18px; border: 1px dashed #d9d0c4; border-radius: 8px; color: var(--muted); font-size: 13px; }

.setup-dialog { width: min(620px, calc(100% - 28px)); max-height: min(88vh, 820px); margin: auto; padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 70px rgba(50, 33, 20, .28); }
.setup-dialog::backdrop { background: rgba(38, 30, 24, .6); }
.setup-dialog__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.setup-dialog__head h2 { font-size: 22px; }
.dialog-close { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 27px; line-height: 1; }
.dialog-close:hover { background: var(--soft); }
.setup-dialog__body { display: grid; gap: 16px; padding: 20px 22px; }
.setup-dialog__description { margin: 0; color: var(--ink-2); line-height: 1.65; }
.progress-track { height: 6px; overflow: hidden; border-radius: 3px; background: #ece5db; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s ease; }
.dialog-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.dialog-steps li { min-height: 74px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dialog-step__number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #cabfb0; border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 800; }
.dialog-steps strong { font-size: 14px; }
.dialog-steps p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dialog-step__status { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.dialog-steps li[data-state="done"] .dialog-step__number { border-color: var(--green); background: var(--green); color: #fff; }
.dialog-steps li[data-state="done"] .dialog-step__status { color: var(--green); }
.dialog-steps li[data-state="current"] .dialog-step__number, .dialog-steps li[data-state="action"] .dialog-step__number { border-color: var(--blue); background: #f6ece4; color: var(--blue); }
.dialog-steps li[data-state="current"] .dialog-step__status, .dialog-steps li[data-state="action"] .dialog-step__status { color: var(--blue); }
.dialog-steps li[data-state="delayed"] .dialog-step__number { border-color: var(--amber); background: #fbeede; color: var(--amber); }
.dialog-steps li[data-state="delayed"] .dialog-step__status { color: var(--amber); }
.dialog-guidance { padding: 13px 14px; border-left: 3px solid var(--blue); background: #f7ece4; color: #5a4a3c; font-size: 13px; line-height: 1.6; }
.setup-dialog__actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 22px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.setup-dialog__actions .button { flex: 1 1 170px; }

.renewal { width: min(860px, 100%); margin: 0 auto; }
.renewal__head { max-width: 760px; }
.renewal__head h1 { font-size: clamp(36px, 6vw, 54px); }
.renewal-state { position: relative; display: grid; grid-template-columns: 5px minmax(0, 1fr); gap: 18px; margin-top: 30px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.renewal-state__bar { width: 5px; min-height: 76px; border-radius: 3px; background: #a89e90; }
.renewal-state .eyebrow { margin-bottom: 6px; color: var(--muted); }
.renewal-state__description { margin: 8px 0 0; color: var(--ink-2); line-height: 1.65; }
.renewal-state[data-renewal-state="offered"], .renewal-state[data-renewal-state="checkout_created"], .renewal-state[data-renewal-state="checkout_creating"] { background: #f7ece4; }
.renewal-state[data-renewal-state="offered"] .renewal-state__bar, .renewal-state[data-renewal-state="checkout_created"] .renewal-state__bar, .renewal-state[data-renewal-state="checkout_creating"] .renewal-state__bar { background: var(--blue); }
.renewal-state[data-renewal-state="converted"], .renewal-state[data-renewal-state="transferring"] { background: #eaf3ea; }
.renewal-state[data-renewal-state="converted"] .renewal-state__bar, .renewal-state[data-renewal-state="transferring"] .renewal-state__bar { background: var(--green); }
.renewal-state[data-renewal-state="expired"] { background: #fdf3e0; }
.renewal-state[data-renewal-state="expired"] .renewal-state__bar { background: var(--amber); }
.renewal-state[data-renewal-state="failed"], .renewal-state[data-renewal-state="manual_required"] { background: #fbeee9; }
.renewal-state[data-renewal-state="failed"] .renewal-state__bar, .renewal-state[data-renewal-state="manual_required"] .renewal-state__bar { background: var(--red); }
.renewal__content { display: grid; gap: 22px; margin-top: 22px; }
.renewal-details { display: grid; gap: 22px; }
.renewal-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.renewal-identity > div { min-width: 0; padding: 20px 22px; }
.renewal-identity > div + div { border-left: 1px solid var(--line); }
.renewal-identity dt, .renewal-facts dt { color: var(--muted); font-size: 12px; }
.renewal-identity dd, .renewal-facts dd { margin: 8px 0 0; font-weight: 800; overflow-wrap: anywhere; }
.renewal-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.renewal-trial { flex: 0 0 auto; margin: 0; color: var(--green); font-size: 13px; font-weight: 800; }
.renewal-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.renewal-facts > div { min-width: 0; min-height: 92px; padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.renewal-facts > div:nth-child(2n) { border-right: 0; }
.renewal-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.renewal-facts dd { font-size: 16px; line-height: 1.45; }
.renewal-fact--free dd { font-family: var(--serif); color: var(--green); font-size: 26px; font-weight: 600; }
.renewal-schedule > .help { margin-top: 12px; }
.renewal-checklist { display: grid; gap: 0; margin: 0; padding: 4px 22px; list-style: none; }
.renewal-checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 17px 0; }
.renewal-checklist li + li { border-top: 1px solid var(--line); }
.renewal-check { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #e6efe4; color: var(--green); font-weight: 850; }
.renewal-checklist strong { font-size: 14px; }
.renewal-checklist p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.renewal-action { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .6fr); align-items: center; gap: 24px; padding: 22px; border: 1px solid #e6cdbd; border-radius: 12px; background: #f7ece4; }
.renewal-action p:not(.eyebrow):not(.status-text) { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.renewal-action__controls { display: grid; gap: 9px; }
.renewal-action__controls .status-text:empty { display: none; }
.renewal-next { display: grid; justify-items: start; gap: 10px; }
.renewal-next .button { min-width: 210px; }

.legal { width: min(820px, 100%); }
.legal h1 { font-size: 42px; }
.legal section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.legal p, .legal li { color: var(--ink-2); line-height: 1.75; }
.legal dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }

.footer { border-top: 1px solid var(--line); background: #211d18; color: #d8d0c4; }
.footer__inner { padding: 28px 0 34px; display: grid; gap: 18px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.footer__links a:hover { color: #fff; }
.footer--compact .footer__inner { grid-template-columns: 1fr auto; align-items: center; padding: 20px 0; }

@media (max-width: 820px) {
  .workspace, .dashboard { grid-template-columns: 1fr; }
  .renewal-action { grid-template-columns: 1fr; }
  .nav a:not(.button) { display: none; }
}

@media (max-width: 520px) {
  .topbar__inner, .main, .footer__inner { width: min(100% - 24px, 1120px); }
  .main { padding-top: 28px; }
  h1 { font-size: 36px; }
  .footer--compact .footer__inner { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--line); }
  .fact:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .legal dl { grid-template-columns: 1fr; gap: 4px; }
  .setup-dialog { width: calc(100% - 16px); max-height: 92vh; }
  .setup-dialog__head { padding: 18px 16px 15px; }
  .setup-dialog__body { padding: 16px; }
  .setup-dialog__actions { padding: 12px 16px 16px; }
  .dialog-steps li { grid-template-columns: 30px minmax(0, 1fr); }
  .dialog-step__status { grid-column: 2; justify-self: start; margin-top: -8px; }
  .renewal__head h1 { font-size: 36px; }
  .renewal-state { gap: 13px; padding: 17px 15px; }
  .renewal-identity, .renewal-facts { grid-template-columns: 1fr; }
  .renewal-identity > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .renewal-facts > div { border-right: 0; }
  .renewal-facts > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .renewal-section-head { display: grid; gap: 8px; }
  .renewal-trial { justify-self: start; }
  .renewal-action { padding: 18px 16px; }
  .renewal-action .button, .renewal-next .button { width: 100%; min-width: 0; }
}
