/* ONDE VoiceTrack: the dark theme of the playout (docs/UI.md). */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Medium.ttf"); font-weight: 500; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Bold.ttf"); font-weight: 700; }

:root {
  --app: #0B0E13; --bar: #0F1319; --panel: #131820; --border: #232B36; --control: #1A2029; --hover: #232B36;
  --text: #E6EAF0; --text2: #9AA4B2; --disabled: #5C6672; --selection: #1F3550;
  --accent: #FF6B3D; --music: #4EA8FF; --jingle: #F5C542; --voice: #3DDC97; --ad: #A07CFF; --top: #3F7CFF;
  --warning: #F5B84B; --danger: #F25F5C;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--app); color: var(--text); font: 15px "Space Grotesk", "Segoe UI", sans-serif; display: flex; flex-direction: column; }
button, select { font: inherit; color: var(--text); background: var(--control); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; }
button { cursor: pointer; }
button:hover:not(:disabled), select:hover:not(:disabled) { background: var(--hover); }
button:disabled, select:disabled { color: var(--disabled); cursor: default; }
button.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.accent:disabled { background: var(--control); border-color: var(--border); color: var(--disabled); }
[hidden] { display: none !important; }

/* Top bar: the animator, the day, the hours */
.bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 9px 20px; background: var(--bar); border-bottom: 1px solid var(--border); }
.brand { font-size: 22px; font-weight: 700; color: var(--accent); }
.brand span { color: var(--text2); font-weight: 400; margin-left: 6px; }
.field { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.hours { display: flex; gap: 6px; flex-wrap: wrap; }
.hours button.current { background: var(--selection); border-color: var(--music); }
.hours small { color: var(--voice); margin-left: 4px; }
.status { margin-left: auto; color: var(--text2); }
.status.error { color: var(--danger); }

main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(600px, 48%); gap: 14px; padding: 12px 20px; min-height: 0; }

/* The playlist, as the playout shows it */
.playlist { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; }
.playlist-head, .row { display: grid; grid-template-columns: 92px 44px 1fr 110px 64px 56px 52px; align-items: center; gap: 10px; }
.playlist-head { padding: 10px 16px; color: var(--text2); font-size: 12px; border-bottom: 1px solid var(--border); }
.rows { overflow-y: auto; padding: 6px 8px; }
.row { padding: 6px 8px; border-radius: 6px; min-height: 52px; }
.row + .row { margin-top: 2px; }
.time { font-family: var(--mono); font-size: 14px; }
.cover { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--control); }
.what b { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.what span { color: var(--text2); font-size: 13px; }
.type { justify-self: start; font-size: 12px; padding: 2px 10px; border-radius: 10px; background: var(--control); }
.type::before { content: "●"; margin-right: 6px; }
.type.music::before { color: var(--music); } .type.jingle::before { color: var(--jingle); } .type.ad::before { color: var(--ad); }
.type.top::before { color: var(--text); } .type.voicetrack::before { color: var(--voice); }
.dur, .intro, .year { font-family: var(--mono); font-size: 14px; }
.intro { color: var(--voice); }
.year { color: var(--text2); }
.row.jingle { min-height: 34px; background: #2a2716; }
.row.ad { min-height: 34px; background: #221d33; }
.row.top { min-height: 34px; background: #16203a; }
.row.voicetrack { border: 1px dashed var(--border); }
.row.voicetrack .what b { color: var(--voice); }
.row.mine { border: 1px solid var(--voice); cursor: pointer; }
.row.mine:hover { background: #12241d; }
.row.chosen { background: #12241d; box-shadow: inset 4px 0 0 var(--voice); }
.badge { font-size: 12px; color: var(--warning); }
.badge.done { color: var(--voice); }
.empty { color: var(--text2); padding: 24px; }

/* ================================================================ the work panel (right) */
.studio { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; overflow-y: auto; }
.studio-inner { display: flex; flex-direction: column; gap: 10px; }
.hint { color: var(--text2); font-size: 12px; margin: 6px 0 0; }

/* The intervention and the countdown */
.studio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.studio-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.mix { color: var(--text2); margin: 4px 0 0; font-size: 14px; }
.countdown { display: flex; flex-direction: column; align-items: flex-end; min-width: 150px; min-height: 44px; }
.countdown span { color: var(--text2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.countdown b { font-family: var(--mono); font-size: 28px; line-height: 1.1; color: var(--voice); }
.countdown b.next { color: var(--music); }

/* The timeline */
.timeline-box { background: var(--app); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 6px; }
.timeline { display: block; width: 100%; height: 190px; touch-action: none; }
.volume { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; margin-top: 4px; }
.volume-icon { color: var(--music); font-size: 15px; }
.volume input { flex: 1; max-width: 260px; accent-color: var(--music); }

/* The two steps */
.block { position: relative; background: linear-gradient(180deg, #161c25, #131820); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px 12px; transition: border-color .2s, box-shadow .2s; }
.block h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--control); border: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.block.active { border-color: rgba(61, 220, 151, .55); box-shadow: 0 0 0 3px rgba(61, 220, 151, .08); }
.block.active .step { background: var(--voice); color: #0B0E13; border-color: var(--voice); }
.block.locked h3 { color: var(--text2); }
.locked-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.locked-note p { margin: 0; color: var(--text2); font-size: 14px; flex: 1; min-width: 220px; }

/* Normal or over a bed: a segmented control */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--app); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 12px; border-radius: 7px; font-weight: 500; text-align: center; transition: background .15s; }
.segmented small { display: block; font-size: 12px; font-weight: 400; color: var(--text2); }
.segmented input:checked + span { background: var(--selection); box-shadow: inset 0 0 0 1px var(--music); }
.segmented input:focus-visible + span { outline: 2px solid var(--music); }
.bed-choice { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--text2); font-size: 13px; }
.bed-choice select { flex: 1; }
.bed-choice:has(select:disabled) { opacity: .45; }

/* The transport: round buttons, their name under them */
.transport { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.round { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--text); font-size: 12px; }
.round i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--control); border: 1px solid var(--border); font-style: normal; font-size: 18px; transition: transform .1s, background .15s, border-color .15s; }
.round:hover:not(:disabled) i { background: var(--hover); border-color: #3a4656; transform: translateY(-1px); }
.round:active:not(:disabled) i { transform: scale(.96); }
.round:disabled { color: var(--disabled); background: none; }
.round:disabled i { opacity: .45; }
.round.rec i { width: 56px; height: 56px; font-size: 22px; color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 6px 18px rgba(242, 95, 92, .3); }
.round.rec:hover:not(:disabled) i { background: #ff7471; }
.round.rec:disabled i { background: var(--control); border-color: var(--border); box-shadow: none; color: var(--disabled); }
.recording .round.rec i { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(242, 95, 92, 0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 95, 92, .45); } }
.transport-clock { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.transport-clock b { font-family: var(--mono); font-size: 26px; font-weight: 400; }
.meter { width: 160px; height: 8px; background: var(--control); border-radius: 4px; }

/* Step 2: information as chips, then the actions, then the big button */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--control); border: 1px solid var(--border); font-size: 13px; color: var(--text2); margin: 0; }
.chip b { color: var(--text); font-family: var(--mono); font-weight: 400; }
.accent-chip { color: var(--voice); border-color: rgba(61, 220, 151, .4); background: rgba(61, 220, 151, .08); }
.accent-chip:empty { display: none; }
.warning-chip { color: var(--warning); border-color: rgba(245, 184, 75, .5); background: rgba(245, 184, 75, .1); margin-top: 8px; border-radius: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill { border-radius: 999px; padding: 8px 16px; font-weight: 500; }
.pill i { font-style: normal; margin-right: 4px; }
.pill.icon { padding: 8px 13px; }
.pill.ghost, .ghost { background: transparent; }
.primary-outline { border-color: var(--music); color: var(--music); }
.primary-outline:hover:not(:disabled) { background: rgba(78, 168, 255, .12); }
.cta { width: 100%; margin-top: 10px; padding: 10px; border-radius: 10px; font-size: 16px; font-weight: 700; color: #0B0E13; background: var(--voice); border-color: var(--voice); }
.cta:hover:not(:disabled) { background: #5ae8ab; }
.cta:disabled { background: var(--control); border-color: var(--border); color: var(--disabled); }

@media (max-width: 1300px) { main { grid-template-columns: 1fr; } }

/* The code screen, over everything */
.pin-screen { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--app); }
.pin-card { display: flex; flex-direction: column; gap: 12px; width: min(340px, calc(100vw - 32px)); padding: 28px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.pin-card .brand { margin-bottom: 8px; }
.pin-card label { color: var(--text2); font-size: 14px; }
.pin-card input { font: 28px var(--mono); letter-spacing: .3em; text-align: center; color: var(--text); background: var(--app); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.pin-card input:focus { outline: 2px solid var(--voice); border-color: var(--voice); }
.pin-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
.mic-choice { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--text2); font-size: 13px; }
.mic-choice select { flex: 1; }
.login-step { display: flex; flex-direction: column; gap: 12px; }
.pin-card input.login-email { font: 18px "Space Grotesk", sans-serif; letter-spacing: normal; text-align: left; }
.who { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 14px; }
.who span { color: var(--text); font-weight: 500; }
