:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1c2033;
  --muted: #6b7185;
  --line: #e4e7ef;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --accent: #f97316;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 28px; padding-bottom: 80px; min-height: calc(100vh - 170px); }

/* ── header ─────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header .inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-weight: 800; font-size: 19px; color: var(--text); white-space: nowrap; }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text); font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 5px; border-radius: 4px;
}
.nav-tag.spa { background: #e0f2fe; color: #0369a1; }
.nav-tag.mpa { background: #fef3c7; color: #92400e; }
.nav-tag.hash { background: #f3e8ff; color: #7e22ce; }
.user-box { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 14px; }
.user-box .who { color: var(--muted); }
.user-box .who b { color: var(--text); }

/* ── footer ─────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.site-footer .inner { padding: 20px; }

/* ── common blocks ──────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary);
}
.badge.hot { background: #fff1e6; color: var(--accent); }
.badge.ok { background: #dcfce7; color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── forms ──────────────────────────────────────────── */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
.input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 1em; }
.auth-wrap { max-width: 440px; margin: 20px auto; }

/* ── hero ───────────────────────────────────────────── */
.hero {
  border-radius: 18px; padding: 44px 40px; color: #fff; margin-bottom: 36px;
  background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
}
.hero h1 { font-size: 34px; }
.hero p { opacity: .92; font-size: 17px; max-width: 620px; }
.hero .actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero .btn { border: 0; }
.hero .btn.ghost { background: rgba(255, 255, 255, .18); color: #fff; }

/* ── products ───────────────────────────────────────── */
.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); display: block; transition: transform .12s, box-shadow .12s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.thumb {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; font-size: 54px;
}
.product-card .body { padding: 14px 16px 16px; }
.product-card .name { font-weight: 600; margin-bottom: 4px; }
.price { font-weight: 800; font-size: 17px; }
.price .was { color: var(--muted); font-weight: 400; font-size: 13px; text-decoration: line-through; margin-left: 6px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-family: inherit; color: var(--text);
}
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.pager a, .pager span {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
}
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; }

.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }
.detail .thumb { border-radius: var(--radius); font-size: 120px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; height: 40px; border: 0; background: var(--bg); cursor: pointer; font-size: 18px; }
.qty input { width: 52px; height: 40px; border: 0; text-align: center; font-size: 15px; }

.split-side { grid-template-columns: 1fr 320px; align-items: start; }
.split-profile { grid-template-columns: 280px 1fr; align-items: start; }
@media (max-width: 800px) { .split-side, .split-profile { grid-template-columns: 1fr; } }
.chip:hover { text-decoration: none; }

/* ── tables / lists ─────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.table th { background: #fafbfd; color: var(--muted); font-weight: 600; }
.table tr:hover td { background: #fafbff; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.list-plain li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px; z-index: 50;
  box-shadow: var(--shadow); font-size: 14px;
}
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ── ticket ─────────────────────────────────────────── */
.stage-bar { background: #2e3350; color: #fff; text-align: center; border-radius: 8px; padding: 8px; font-size: 13px; margin-bottom: 18px; letter-spacing: .3em; }
.seats { display: grid; grid-template-columns: 26px repeat(12, 1fr); gap: 6px; }
.seat-row-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.seat {
  aspect-ratio: 1; border-radius: 6px 6px 3px 3px; border: 1px solid #c7cbe0; background: #fff; cursor: pointer;
  font-size: 10px; color: var(--muted); padding: 0;
}
.seat.taken { background: #d9dbe5; border-color: #d9dbe5; cursor: not-allowed; }
.seat.picked { background: var(--primary); border-color: var(--primary); color: #fff; }
.countdown { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid #c7cbe0; }

/* ── test panel ─────────────────────────────────────── */
.bm-panel {
  position: fixed; right: 16px; bottom: 16px; width: 320px; z-index: 40;
  background: #111827; color: #e5e7eb; border-radius: 12px; font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.bm-panel header {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  padding: 10px 14px; font-weight: 700; font-family: inherit;
}
.bm-panel header .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: #6b7280; }
.bm-panel header .dot.loaded { background: #22c55e; }
.bm-panel header .dot.loading { background: #eab308; }
.bm-panel header .dot.error { background: #ef4444; }
.bm-panel .rows { padding: 0 14px 12px; }
.bm-panel .row { display: flex; gap: 8px; padding: 3px 0; }
.bm-panel .row .k { color: #9ca3af; width: 88px; flex: none; }
.bm-panel .row .v { word-break: break-all; }
.bm-panel .calls { margin-top: 6px; border-top: 1px solid #374151; padding-top: 6px; }
.bm-panel .calls div { color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-panel.collapsed .rows { display: none; }
@media (max-width: 600px) { .bm-panel { width: calc(100% - 32px); } }

/* ── mobile ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .site-header .inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .user-box { margin-left: auto; }
  #search { width: 100%; margin-left: 0 !important; }
  #search .input { width: auto !important; flex: 1; min-width: 0; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 26px; }
}
