:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #1b1b1f;
  --muted: #6b6b73;
  --faint: #a3a3ab;
  --line: #e7e5e0;
  --accent: #8a1c2b;        /* 버건디 */
  --accent-soft: #f6e9ea;
  --onsale: #1d7a4c;
  --onsale-soft: #e5f3ec;
  --open: #b25a00;
  --open-soft: #fbefdf;
  --plain: #55555e;
  --plain-soft: #eeedea;
  --tour: #1f4fa3;
  --tour-soft: #e6edf9;
  --mark: #fff1a8;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214; --surface: #1b1b1f; --ink: #ececef; --muted: #a1a1aa; --faint: #6b6b73;
    --line: #2b2b31; --accent: #e3707e; --accent-soft: #3a1f24;
    --onsale: #5cc993; --onsale-soft: #17301f; --open: #f0a656; --open-soft: #3a2a14;
    --plain: #b4b4bc; --plain-soft: #26262c; --tour: #86aef0; --tour-soft: #1b2740;
    --mark: #5a4d10; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121214; --surface: #1b1b1f; --ink: #ececef; --muted: #a1a1aa; --faint: #6b6b73;
  --line: #2b2b31; --accent: #e3707e; --accent-soft: #3a1f24;
  --onsale: #5cc993; --onsale-soft: #17301f; --open: #f0a656; --open-soft: #3a2a14;
  --plain: #b4b4bc; --plain-soft: #26262c; --tour: #86aef0; --tour-soft: #1b2740;
  --mark: #5a4d10; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "IBM Plex Sans KR", "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--surface); }
.top .wrap { padding-block: 18px 14px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.brand h1 { margin: 0; text-wrap: balance; font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
.brand h1::before { content: "𝄞"; color: var(--accent); margin-right: 6px; font-weight: 400; }
.sub { margin: 0; color: var(--muted); font-size: 13.5px; }
#updated { color: var(--faint); margin-left: 4px; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; height: 50px; padding: 0 44px 0 44px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px;
  outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--accent); background: var(--surface); }
.search input::-webkit-search-cancel-button { display: none; }
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.clear:hover { background: var(--plain-soft); }

.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.suggest button { border: 0; background: var(--plain-soft); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.suggest button:hover { background: var(--accent-soft); color: var(--accent); }

.filters { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; background: var(--plain-soft); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- opening soon ---------- */
.opening { margin-top: 24px; }
h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -.01em; }
h2 small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.opening-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.op-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.op-dday { display: flex; align-items: baseline; gap: 8px; }
.op-dday b { color: var(--open); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.op-dday span { color: var(--muted); font-size: 13px; }
.op-name { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.op-meta { color: var(--muted); font-size: 12.5px; }
.op-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ---------- list ---------- */
.result-bar { display: flex; justify-content: space-between; margin: 26px 0 4px; color: var(--muted); font-size: 13.5px; }
.month { margin-top: 18px; }
.month h3 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.month h3 b { color: var(--ink); font-size: 18px; }

.body { min-width: 0; }
.card { display: grid; grid-template-columns: 74px 1fr 170px; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.card.tour { border-left: 4px solid var(--tour); }
.date { text-align: center; padding-top: 2px; }
.date .d { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.date .w { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.date .t { font-size: 12.5px; color: var(--faint); margin-top: 2px; font-variant-numeric: tabular-nums; }
.date .more { font-size: 11.5px; color: var(--accent); margin-top: 6px; font-weight: 600; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.b-onsale { background: var(--onsale-soft); color: var(--onsale); }
.b-open { background: var(--open-soft); color: var(--open); }
.b-plain { background: var(--plain-soft); color: var(--plain); }
.b-tour { background: var(--tour-soft); color: var(--tour); }
.orch { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; margin: 0; }
.title { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.people { font-size: 14px; margin-top: 8px; }
.people span + span::before { content: "·"; margin: 0 7px; color: var(--faint); }
.people em { font-style: normal; color: var(--muted); font-size: 12.5px; margin-right: 3px; }
.venue { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

.program { list-style: none; margin: 12px 0 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.program li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 3px 0; font-size: 14px; }
.program li + li { border-top: 1px dashed var(--line); }
.program .c { font-weight: 700; }
.program .c small, .program .w small { display: block; color: var(--faint); font-weight: 500; font-size: 11.5px; }
.program li.hit { background: var(--mark); margin: 0 -12px; padding: 3px 12px; border-radius: 4px; }
.program.none { color: var(--faint); font-size: 13.5px; }

.side { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 150px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px; border: 1px solid var(--line);
  background: var(--surface); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.open-box { background: var(--open-soft); color: var(--open); border-radius: 10px; padding: 8px 12px; text-align: center; }
.open-box b { display: block; font-size: 16px; }
.open-box span { font-size: 12.5px; }
.price { font-size: 12px; color: var(--muted); text-align: center; }
.links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; }
.links a { color: var(--muted); }
.star { border: 0; background: none; font-size: 20px; color: var(--faint); align-self: flex-end; padding: 0 2px; line-height: 1; }
.star.on { color: #e0a800; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.foot { color: var(--faint); font-size: 12.5px; padding-block: 30px 40px; }

@media (max-width: 720px) {
  .card { grid-template-columns: 56px 1fr; gap: 12px; padding: 14px; }
  .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .side .btn.primary, .open-box { flex: 1; }
  .star { order: 9; align-self: center; }
  .date .d { font-size: 24px; }
  .program li { grid-template-columns: 1fr; gap: 0; }
  .filters { flex-direction: column; align-items: flex-start; }
  .top { position: static; }
}
