:root {
  --bg: #140e0c;
  --paper: #1e1612;
  --ink: #f4e7d4;
  --muted: #b8a48c;
  --gold: #d4a054;
  --wine: #8b2e3a;
  --ok: #3d8b6e;
  --warn: #c9842a;
  --bad: #8a6a5a;
}
* { box-sizing: border-box; }
html, body, #root { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif; word-break: keep-all; }
.page { max-width: 1260px; margin: 0 auto; padding: 28px 16px 64px; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; border-bottom: 1px solid #3a2c22; padding-bottom: 18px; margin-bottom: 22px; }
.eyebrow { letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-size: 12px; margin: 0 0 6px; }
h1 { margin: 0; font-weight: 700; font-size: 32px; }
.sub, .hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
nav, .pills, .rowbtns { display: flex; gap: 8px; flex-wrap: wrap; }
button { background: #2a1f18; color: var(--ink); border: 1px solid #4a382c; border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; }
button.on, button[type=submit], .rowbtns button:first-child { background: var(--gold); color: #1a120c; border-color: var(--gold); font-weight: 700; }
button.ghost { background: transparent; }
button.tiny { padding: 10px 12px; font-size: 13px; flex-shrink: 0; min-height: 44px; }
button.race { margin-top: 10px; background: var(--wine); border-color: var(--wine); width: 100%; border-radius: 10px; }
button:disabled { opacity: .4; cursor: not-allowed; }
.grid2, .seat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); gap: 22px; }
.sheet-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
table.sheet { width: 100%; min-width: 820px; table-layout: auto; border-collapse: collapse; background: var(--paper); border-radius: 12px; }
table.sheet th, table.sheet td { text-align: left; padding: 10px 10px; border-bottom: 1px solid #2c221c; font-size: 14px; vertical-align: middle; }
table.sheet th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.sheet .col-src { width: 1%; white-space: nowrap; overflow: visible; }
table.sheet .col-ticket { width: 12%; white-space: normal; overflow: visible; text-overflow: clip; word-break: break-all; font-size: 11px; line-height: 1.35; }
table.sheet .col-name { width: 16%; white-space: nowrap; }
table.sheet .col-phone { width: 20%; white-space: nowrap; }
table.sheet .col-session { width: 28%; white-space: nowrap; }
table.sheet .col-status { width: 1%; white-space: nowrap; overflow: visible; }
.person { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: 0; }
.badge { display: inline-block; width: fit-content; max-width: none; white-space: nowrap; overflow: visible; text-overflow: clip; border-radius: 999px; padding: 3px 8px; font-size: 12px; line-height: 1.3; }
.badge.matched { background: #1e3d32; color: #8ee0bf; }
.badge.needs_review { background: #3d2c12; color: #f0c27a; }
.badge.no_match { background: #2a2420; color: #cbb8a6; }
.badge.src.interpark { background: #3d2418; color: #f0c27a; }
.badge.src.yes24 { background: #1e2a3d; color: #9ec0f0; }
.card { background: var(--paper); padding: 16px; border-radius: 12px; border: 1px solid #32261e; }
label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
input { width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid #4a382c; background: #120d0b; color: var(--ink); }
.idents, .reasons { list-style: none; padding: 0; }
.idents li, .reasons li { padding: 8px 0; border-bottom: 1px solid #2c221c; font-size: 14px; }
.idents li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.idents small { display: block; color: var(--muted); }
.flash { background: #2a2114; border: 1px solid var(--gold); padding: 8px 10px; border-radius: 8px; }
.flash.ok { background: #2a2114; border-color: var(--gold); }
.flash.warn { background: #2a2110; border-color: var(--warn); color: #f0c27a; }
.flash.bad { background: #2a1814; border-color: #8b2e3a; color: #f0c0b4; }
.sheet-cue { display: none; color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.seat-actions { margin: 10px 0 8px; }
.seat-actions .rowbtns { margin-top: 8px; }
.seat-actions button { flex: 1; min-height: 40px; }
.idents-toggle { display: inline-flex; margin: 8px 0; }
.idents-heading { display: block; margin: 16px 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.idents-recent { display: block; }
.sheet-retry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seat-actions-dupe { display: none; }
.idents-older { display: none; }
.idents-older.open { display: block; }
.stage { text-align: center; background: linear-gradient(#3a2418, #24160f); padding: 12px; border-radius: 12px 12px 0 0; letter-spacing: .2em; margin-bottom: 12px; }
.map { background: var(--paper); padding: 16px; border-radius: 0 0 12px 12px; }
.map-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 6px; margin: 6px 0; white-space: nowrap; }
.rn { width: 18px; color: var(--gold); font-weight: 700; }
.seat { width: 34px; height: 34px; border-radius: 8px; padding: 0; font-size: 12px; }
.seat.open { background: #2c241c; }
.seat.held { background: #c9842a; color: #1a120c; }
.seat.confirmed { background: #5a2430; color: #f4d4d8; }
.seat.own, .seat.mine { outline: 2px solid #f4e7d4; }
.seat.pending { box-shadow: 0 0 0 2px var(--gold); }
.legend { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.legend .seat { width: 16px; height: 16px; display: inline-block; vertical-align: middle; margin-right: 4px; }
s { color: var(--muted); margin-right: 6px; }
.loading-cue { color: var(--gold); font-size: 13px; margin: 0 0 8px; }
.skel { display: inline-block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, #2c221c 25%, #3a2c22 50%, #2c221c 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-row td { padding-top: 12px; padding-bottom: 12px; }
.seat.skel-seat { background: #2c221c; opacity: .4; pointer-events: none; border-color: #2c221c; }
.ticket-card { margin-top: 14px; padding: 16px 14px 14px; border: 1px dashed var(--gold); border-radius: 12px; text-align: center; background: #24180f; }
.ticket-stamp { display: inline-block; background: var(--wine); color: #f4d4d8; font-weight: 700; letter-spacing: .16em; padding: 4px 12px; border-radius: 4px; margin: 0 0 6px; }
.ticket-seat { font-size: 28px; font-weight: 700; margin: 6px 0 10px; }
.ticket-qr { display: block; margin: 0 auto; background: #f4e7d4; border-radius: 6px; }
.ticket-qr-label { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
@media (max-width: 900px) {
  .grid2, .seat-wrap, .top { display: block; }
  nav { margin-top: 12px; }
  table.sheet { min-width: 760px; }
  .sheet-cue { display: block; }
}

.match-cards { display: none; }
.row-picker { display: none; }
.tabs { gap: 10px; }
.tabs button { min-height: 40px; padding: 10px 16px; }
@media (max-width: 480px) {
  .page { padding: 12px 12px 48px; }
  .top { display: block; padding-bottom: 8px; margin-bottom: 12px; }
  .eyebrow { font-size: 11px; margin: 0 0 2px; letter-spacing: .08em; }
  h1 { font-size: 20px; line-height: 1.25; }
  .sub { display: block; font-size: 13px; }
  nav.tabs, nav { display: flex; gap: 12px; flex-wrap: nowrap; margin-top: 10px; }
  nav button { min-height: 44px; min-width: 0; padding: 10px 10px; flex: 1; font-size: 13px; line-height: 1.3; }
  .grid2 { display: flex; flex-direction: column; gap: 14px; }
  .grid2 > .ident-aside { order: -1; }
  .ident-aside h2 { margin: 0 0 6px; font-size: 16px; }
  .ident-aside > .hint { display: none; }
  .sheet-scroll, table.sheet { display: none; }
  .match-cards { display: flex; flex-direction: column; gap: 10px; }
  .match-card { background: var(--paper); border: 1px solid #32261e; border-radius: 12px; padding: 12px; }
  .match-card.skel-card { display: flex; flex-direction: column; gap: 10px; min-height: 72px; }
  .mc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
  .mc-ticket { margin: 0 0 8px; font-size: 13px; word-break: break-all; overflow: visible; text-overflow: clip; white-space: normal; }
  .mc-dl { margin: 0; }
  .mc-dl > div { display: flex; gap: 10px; padding: 4px 0; font-size: 14px; border-bottom: 1px solid #2c221c; }
  .mc-dl > div:last-child { border-bottom: 0; }
  .mc-dl dt { width: 52px; flex-shrink: 0; color: var(--muted); font-weight: 600; }
  .mc-dl dd { margin: 0; overflow: visible; word-break: break-all; }
  .match-card .person { white-space: normal; }
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .toolbar h2 { margin: 8px 0; font-size: 16px; }
  .pills button { min-height: 36px; }
  .row-picker { display: flex; gap: 8px; margin: 0 0 10px; }
  .row-picker button { min-width: 44px; min-height: 44px; flex: 1; padding: 0; font-weight: 700; }
  .map-row { display: none; }
  .map-row.is-focus { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 3px; margin: 8px 0; white-space: nowrap; }
  .map-row.is-focus .seat, .seat { width: 30px; height: 36px; min-width: 0; min-height: 32px; max-width: 36px; flex: 1 1 0; padding: 0; font-size: 11px; }
  .legend .seat { width: 16px; height: 16px; min-width: 16px; min-height: 16px; max-width: none; flex: none; }
  .map { padding: 12px 8px; }
  input { min-height: 44px; padding: 10px 12px; }
  .ident-aside button[type=submit] { min-height: 44px; width: 100%; }
  .rowbtns button { min-height: 44px; }
  .sheet-cue { display: none; }
  .seat-actions { margin: 12px 0 8px; }
  .seat-actions button { min-height: 44px; }
  .seat-actions-dupe { display: none; }
  .idents-toggle { display: inline-flex; min-height: 36px; }
  .idents-older { display: none; }
  .idents-older.open { display: block; }
}

.landing { min-height: 100vh; padding: 24px 16px 64px; max-width: 980px; margin: 0 auto; }
.land-top { display: flex; justify-content: space-between; align-items: center; }
.brand { letter-spacing: .16em; font-weight: 800; color: var(--gold); }
.land-hero { padding: 48px 0 32px; }
.land-hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.12; max-width: 14ch; }
.lede { max-width: 42ch; color: var(--muted); line-height: 1.65; }
.land-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.primary-link, .primary-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; background: var(--gold); color: #1a120c; font-weight: 700; text-decoration: none; border-radius: 999px; border: 0; }
.ghost-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
.land-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.land-proof article { background: var(--paper); border: 1px solid #32261e; border-radius: 12px; padding: 16px; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(300px, 420px); }
.auth-copy { background: #2a1518; padding: clamp(24px, 6vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.login-card { padding: 28px 20px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.role-buttons { display: grid; gap: 8px; }
.err { color: #f0c0b4; }
@media (max-width: 900px) {
  .auth-page { display: block; }
}
