:root {
  --bg: #f7f5f2; --surface: #ffffff; --text: #1f1b18; --muted: #6e665f; --line: #e5e0da;
  --accent: #8a4b1f; --accent-ink: #ffffff; --now: #f6e7d8; --ok: #2f7a4f; --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311; --surface: #1e1b18; --text: #ece7e2; --muted: #a39a92; --line: #332e29;
    --accent: #e09a5f; --accent-ink: #1a120c; --now: #3a2a1d; --ok: #6fc794; --bad: #ef6b62;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: .4rem 0 .8rem; line-height: 1.3; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 40px); }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); }
.back { font-size: 1.8rem; line-height: 1; padding: 0 12px 4px 0; margin: -4px 0; color: var(--text); }
.right { margin-left: auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.card.narrow { max-width: 360px; margin: 10vh auto; }
.msg { padding: 10px 12px; border-radius: 8px; background: var(--now); }
.msg.error { color: var(--bad); }
label { display: block; margin: 0 0 12px; }
input:not([type=file]), select, textarea { font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
label input:not([type=file]), textarea { display: block; width: 100%; margin-top: 4px; }
input[type=file] { display: block; margin-top: 4px; max-width: 100%; }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
button { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
button:disabled { opacity: .45; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.link { background: none; border: 0; color: var(--muted); padding: 4px; min-height: 0; }
.danger { color: var(--bad) !important; }
.foot { margin-top: 28px; text-align: center; }

.row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.status-failed { color: var(--bad); }

/* 지금 코드: 기타를 든 채로 멀리서 보여야 한다 */
.now { position: sticky; top: 52px; z-index: 4; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.cur { font-size: clamp(3rem, 16vw, 5.5rem); font-weight: 800; line-height: 1; overflow-wrap: anywhere; }
.now .sub { grid-column: 1; color: var(--muted); min-height: 1.4em; }
.next { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 1.1rem; text-align: right; }
.next b { color: var(--text); font-size: 1.6rem; display: block; }
audio { width: 100%; margin: 4px 0 8px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls label { margin: 0; }

.chips { list-style: none; padding: 0; margin: 12px 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-width: 56px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.chips button b { font-size: 1.05rem; }
.chips button small { color: var(--bad); font-size: .72rem; }
.chips button.bad, .badge.bad { border: 2px dashed var(--bad); }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips button.on small { color: inherit; }
.badge { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: .8rem; }
details summary { cursor: pointer; font-weight: 600; }
details form { margin-top: 10px; }
pre { white-space: pre-wrap; }
