:root {
  color-scheme: dark;
  --bg: #0c1013; --panel: #131a1e; --panel-2: #192227; --line: #26323a; --fg: #e6e3da; --fg-dim: #8f9ba3;
  --brass: #e0a64a; --brass-dim: #7a5a26; --ok: #6fbf8e; --hot: #e5604d;
  --font-display: "Space Grotesk", system-ui, sans-serif; --font-body: "Inter", system-ui, sans-serif; --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font-body); }
body { padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(140px + var(--safe-b)); }
.bar { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.bar h1 { font: 700 20px/1.1 var(--font-display); margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub, .hint { color: var(--fg-dim); font-size: 13px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.btn { font: 500 14px var(--font-display); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.btn:hover { border-color: var(--brass-dim); }
.btn.primary { background: var(--brass); color: #1a1205; border-color: var(--brass); }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-mono); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; background: transparent; cursor: pointer; min-height: 34px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-dim); }
.dot.ready { background: var(--ok); } .dot.starting { background: var(--brass); animation: pulse 1.2s infinite; } .dot.off { background: #4a565e; }
@keyframes pulse { 50% { opacity: .35; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.card.cur { border-color: var(--brass-dim); }
.proj { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.proj b { font: 500 16px var(--font-display); display: block; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.sp { justify-content: space-between; }
input.t, textarea.t, select.t { width: 100%; background: #0a0e11; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; min-height: 44px; }
textarea.t { resize: none; line-height: 1.5; overflow: hidden; }
input.dir { font-size: 13px; color: var(--fg-dim); }
.spk { width: 120px; min-height: 36px; font-size: 13px; }
.takes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.take { display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; min-height: 44px; cursor: pointer; font: 500 13px var(--font-mono); }
.take.play { border-color: var(--brass); }
.take.appr { border-color: var(--ok); }
.take .st { color: var(--brass); } .take .ok { color: var(--ok); }
.job { font: 400 12px var(--font-mono); color: var(--brass); padding: 7px 0 0; }
.job.err { color: var(--hot); }
.player { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(19,26,30,.97); border-top: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-left)) calc(10px + var(--safe-b)); z-index: 5; backdrop-filter: blur(8px); }
.player .in { max-width: 760px; margin: 0 auto; display: grid; gap: 8px; }
canvas.wave { width: 100%; height: 56px; display: block; background: #0a0e11; border-radius: 4px; touch-action: none; cursor: pointer; }
.pl-top { display: flex; align-items: center; gap: 10px; }
.pl-top .nm { flex: 1; min-width: 0; font: 500 13px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brass); color: #1a1205; font-size: 18px; cursor: pointer; }
#sheet { position: fixed; inset: 0; background: rgba(5,8,10,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
#sheet[hidden] { display: none; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 12px 12px 0 0; width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 18px 16px calc(18px + var(--safe-b)); display: grid; gap: 12px; }
.sheet h2 { font: 700 18px var(--font-display); margin: 0; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; font: 400 12px var(--font-mono); color: var(--fg-dim); }
.kv b { color: var(--fg); font-weight: 400; overflow-wrap: anywhere; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + var(--safe-b)); background: var(--panel-2); border: 1px solid var(--brass-dim); border-radius: 6px; padding: 9px 14px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
#toast.on { opacity: 1; }
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; display: grid; gap: 12px; }
.login h1 { font: 700 28px var(--font-display); margin: 0; }
.built { text-align: center; color: var(--fg-dim); font-size: 12px; margin: 26px 0 0; }
@media (prefers-reduced-motion: reduce) { .dot.starting { animation: none; } }
