:root {
  color-scheme: dark;
  --panel:var(--ui-surface-1); --raised:var(--ui-surface-2); --line:var(--ui-border);
  --muted:var(--ui-text-muted); --bright:#a6b2ff; --green:var(--ui-success);
  font-family:Inter,"Segoe UI",system-ui,sans-serif;
}
* { box-sizing:border-box }
body { margin:0; font-family:inherit; min-width:280px; background:var(--bg); color:var(--text); line-height:1.45 }
[v-cloak], [hidden] { display:none }
h1,h2,p,dl,dd { margin:0 }
h1 { font-size:clamp(1.5rem,3vw,2rem); line-height:1.2; letter-spacing:-.035em }
h2 { font-size:clamp(1.05rem,2vw,1.18rem); line-height:1.2; letter-spacing:-.025em }
small,.muted,dt { color:var(--muted) }
button,input,select,textarea { font:inherit; color:inherit }
button { min-height:42px; border:1px solid var(--line); border-radius:var(--ui-radius-sm); padding:8px 15px; background:var(--raised); font-weight:600; cursor:pointer; line-height:1.25 }
button:hover:not(:disabled) { border-color:#626f92; background:var(--ui-surface-3) }
button:disabled { cursor:default; opacity:.63 }
button.primary { color:#fff; background:#485ed1; border-color:var(--accent) }
button.primary:hover:not(:disabled) { background:#5065d9; border-color:var(--bright) }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline:3px solid var(--bright); outline-offset:3px }
button[aria-pressed=true] { border-color:var(--accent); color:var(--bright); background:#242e52 }
button.square { width:42px; padding:6px; font-size:19px }
button.text-button, button.back { padding:5px 0; min-height:36px; color:var(--bright); background:none; border:0; width:fit-content }
button.text-button:hover, button.back:hover { text-decoration:underline; background:none }
button.remove { color:#ffacb5 }
label, .bare legend { display:grid; gap:7px; font-size:.9rem; font-weight:600; min-width:0 }
input,select,textarea { width:100%; min-width:0; border:1px solid #46506c; background:var(--bg); border-radius:8px; padding:11px 12px; line-height:1.4; font-size:1rem; font-weight:400 }
textarea { resize:vertical; min-height:60px }
input[type=date] { display:block; min-height:44px }
fieldset { min-width:0; margin:0 }
fieldset:disabled, :disabled input, :disabled select, :disabled textarea { opacity:1 }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
.mast { border-bottom:1px solid var(--line); background:var(--panel) }
.mast-inner,.workspace { width:min(1120px,calc(100% - 48px)); margin:auto }
.mast-inner { min-height:66px; display:flex; justify-content:space-between; align-items:center; gap:16px }
.brand,.account,.controls,.week-toolbar,.page-title,.schedule-title,.cue-head,.rundown-heading,.filterbar { display:flex; align-items:center; gap:10px }
.brand { gap:12px; line-height:1.18 }
.brand strong { display:block; font-size:1.04rem; letter-spacing:-.02em }
.brand small { display:block; font-size:.73rem; margin-bottom:3px; color:var(--muted) }
.radio-mark { display:flex; align-items:center; justify-content:center; gap:3px; width:38px; height:38px; border:1px solid #414e83; border-radius:9px; background:#252d4c }
.radio-mark i { width:3px; background:var(--bright); border-radius:4px; height:11px }
.radio-mark i:nth-child(2) { height:19px }
.radio-mark i:nth-child(3) { height:25px }
.radio-mark i:nth-child(4) { height:15px }
.account span { color:var(--muted); max-width:22ch; white-space:nowrap; text-overflow:ellipsis; overflow:hidden }
.account button,.controls button { font-size:.89rem }
.workspace { padding-bottom:72px }
.nav { display:flex; gap:8px; border-bottom:1px solid var(--line) }
.nav button { background:none; color:var(--muted); border:none; border-bottom:2px solid transparent; border-radius:0; min-height:47px; padding:9px 12px; font-weight:650 }
.nav button:hover:not(:disabled) { background:none; color:var(--text) }
.nav button[aria-current=page] { color:var(--bright); border-color:var(--accent); background:#171d30 }
.page-title,.week-toolbar,.schedule-title,.rundown-heading,.cue-head { justify-content:space-between }
.page-title { margin:24px 0 16px; gap:18px }
.section-label { color:var(--muted); text-transform:uppercase; font-weight:700; font-size:.7rem; letter-spacing:.14em; margin-bottom:8px }
.panel,dialog,.gate-box { background:var(--panel); border:1px solid var(--line); border-radius:var(--ui-radius-md) }
.panel { overflow-wrap:anywhere }
.controls,.choices,.filterbar { flex-wrap:wrap }
.week-panel { padding:15px 18px }
.week-toolbar { margin-bottom:12px }
.rundown-heading strong::first-letter { text-transform:uppercase }
.week-toolbar .controls { gap:5px }
.date-jump input { width:148px; padding:7px; min-height:42px; font-size:.92rem }
.week-strip { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px }
.week-strip button { display:grid; gap:4px; justify-items:start; position:relative; padding:6px 12px; background:var(--raised); border-color:transparent }
.week-strip button span { font-size:.75rem; color:var(--muted) }
.week-strip button strong { font-size:1.15rem; font-variant-numeric:tabular-nums }
.week-strip button[aria-pressed=true] { background:#232e54; border-color:var(--accent) }
.week-strip button[aria-pressed=true] span { color:var(--bright) }
.week-strip i { position:absolute; width:5px; height:5px; border-radius:50%; background:var(--accent); right:9px; top:11px }
.schedule-title { margin:20px 0 10px }
.plan-help { color:var(--muted); font-size:.87rem; margin:-5px 0 14px }
.choices { display:flex; flex-wrap:wrap; gap:6px }
.choices button { padding:8px 13px; font-size:.9rem; min-width:42px }
.show-choices { margin-bottom:14px }
.rundown { overflow:hidden }
.rundown-heading { padding:10px 16px; background:var(--raised); border-bottom:1px solid var(--line); flex-wrap:wrap }
.rundown-heading span,.duration { font-size:.81rem; font-variant-numeric:tabular-nums; color:var(--muted) }
.hour-line { display:grid; grid-template-columns:76px minmax(0,1fr); align-items:stretch; border-bottom:1px solid var(--line) }
.hour-line:last-child,.collection .entry:last-child { border-bottom:0 }
.clock { color:var(--muted); font-size:.92rem; font-variant-numeric:tabular-nums; font-weight:650; padding:12px 10px; text-align:center }
.hour-content { min-width:0; display:grid; gap:8px; align-content:center; border-left:1px solid var(--ui-border-soft); padding:8px 14px }
.hour-content > .muted { font-size:.85rem }
.onair-card { border-left:3px solid var(--accent); border-radius:3px; padding:6px 12px; background:#1b2131; overflow-wrap:anywhere }
.cue-head { align-items:baseline }
.cue-head h3 { margin:0; font-size:1.08rem; line-height:1.3 }
.duration { white-space:nowrap }
.client-line { font-size:.88rem; color:var(--muted); margin-top:4px }
.placement-copy dt { margin-top:8px; font-weight:600; font-size:.8rem }
.placement-copy dd { white-space:pre-wrap }
.edit-placement { margin-top:10px; font-size:.87rem }
.empty { padding:26px; color:var(--muted) }
.filterbar { margin-bottom:16px }
.filterbar .search { width:min(100%,355px) }
.campaign-month-nav { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:5px; width:min(100%,295px) }
.campaign-month-input { min-height:42px; padding:8px }
.campaign-month-field { position:relative }
.campaign-month-caption { position:absolute; inset:2px 2rem 2px 2px; padding-left:7px; display:flex; align-items:center; border-radius:6px; background:var(--bg); font-size:1rem; font-weight:400; pointer-events:none }
.campaign-month-field:focus-within .campaign-month-caption { display:none }
.collection + .ended-campaigns { margin-top:14px }
.ended-campaigns > summary { padding:12px 18px }
.ended-campaigns[open] > summary { border-bottom:1px solid var(--line) }
.ended-campaigns > summary:focus-visible { outline-offset:-3px }
.collection { overflow:hidden }
.entry { display:flex; gap:16px; align-items:center; justify-content:space-between; min-width:0; width:100%; padding:14px 18px; background:none; border:0; border-radius:0; border-bottom:1px solid var(--line); text-align:left }
.entry-main { display:grid; min-width:0; gap:4px; flex:1; overflow-wrap:anywhere; font-weight:400 }
.entry-main .section-label { margin:0 }
.entry-main strong { font-size:1.1rem }
.chevron { color:var(--muted); font-size:1.4rem }
.pill { display:inline-flex; width:fit-content; font-weight:650; padding:5px 10px; font-size:.8rem; border-radius:20px; background:#2b3440; color:#d0d8e5 }
.st-active { color:var(--green); background:#20382c }
.st-scheduled { color:#b9cdff; background:#2b354a }
.st-paused { color:#f2cc87; background:#392f21 }
.st-ended { color:#c0bec6; background:#2e2e35 }
.editor { display:grid; grid-template-columns:minmax(0,1fr) minmax(245px,.42fr); align-items:start; gap:20px }
.editor-panels,.form-panel,.summary,.creative,.gate-box,dialog form { display:grid; gap:16px }
.form-panel,.summary { padding:20px }
.form-panel h2 { margin-bottom:4px }
.field-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px }
.creative-row { grid-template-columns:2fr 1fr }
.bare { border:0; padding:0 }
.bare legend { margin-bottom:8px; padding:0 }
.creative { border:1px solid var(--line); border-radius:11px; padding:15px; background:#111621 }
.creative > legend { padding:0 6px; color:var(--bright); font-weight:700; font-size:.88rem }
.copy-field { display:grid; gap:5px }
.copy-hint { line-height:1.4 }
.manual-booking { border-top:1px solid var(--line); padding-top:7px }
.summary { position:sticky; top:16px }
.summary dl { display:grid; gap:4px }
.summary dt { font-size:.79rem; margin-top:7px }
.summary dd { font-weight:600; overflow-wrap:anywhere }
.summary .muted { font-size:.87rem }
.summary > button { width:100% }
.notice,.error { border-radius:8px; padding:10px 14px; overflow-wrap:anywhere; font-size:.92rem }
.notice { margin-top:16px; background:#1e3328; color:#b8efcd }
.error { background:#42292d; color:#ffc9c9 }
.workspace > .error { margin-top:16px }
.gate { width:min(100% - 32px,460px); margin:clamp(36px,10vh,100px) auto }
.gate-box { padding:clamp(22px,4vw,36px) }
.gate-box h1 { font-size:1.6rem }
.gate-box .section-label { margin:0; color:var(--bright) }
.gate-box p:not(.error) { color:var(--muted) }
dialog { width:min(440px,calc(100% - 32px)); color:var(--text); padding:25px; box-shadow:0 18px 60px #0008 }
dialog::backdrop { background:rgb(5 7 10/.8) }
dialog .controls { justify-content:flex-end }
@media(max-width:760px) {
  .mast-inner,.workspace { width:calc(100% - 32px) }
  .mast-inner { min-height:66px }
  .nav { gap:17px }
  .nav button { min-height:50px }
  .page-title { margin:25px 0 20px; flex-wrap:wrap }
  .week-toolbar { flex-wrap:wrap }
  .week-panel,.form-panel,.summary { padding:17px }
  .week-strip { gap:4px }
  .week-strip button { padding:8px; min-height:56px }
  .week-strip button strong { font-size:1.2rem }
  .editor { grid-template-columns:1fr; gap:12px }
  .summary { position:static }
  .hour-line { grid-template-columns:62px minmax(0,1fr) }
  .clock { padding:16px 5px }
  .hour-content,.rundown-heading { padding:12px }
  .entry { padding:14px; gap:9px; flex-wrap:wrap }
  .entry .entry-main { flex-basis:45% }
}
@media(max-width:480px) {
  .mast-inner { flex-wrap:wrap; gap:6px; padding-block:7px }
  .account { margin-inline-start:auto; gap:6px }
  .account span { max-width:12ch; font-size:.76rem }
  .week-panel { padding:12px }
  .week-toolbar .controls { width:100%; justify-content:space-between; gap:4px }
  .date-jump { flex:1; max-width:146px }
  .date-jump input { width:100% }
  .week-strip button { padding:6px 3px; justify-items:center }
  .week-strip i { right:3px; top:4px }
  .date-jump input,.controls button { font-size:.81rem }
  .controls button { padding-left:10px; padding-right:10px }
  .form-panel,.summary { padding:15px }
  .field-row { grid-template-columns:minmax(0,1fr) }
  .creative { padding:10px }
  .nav { justify-content:space-between; gap:5px }
  .nav button { font-size:.88rem }
  .entry .chevron { display:none }
  .schedule-title { align-items:baseline; gap:6px }
  .schedule-title small { font-size:.74rem }
}
.grid-tools,.grid-row-head,.grid-meta,.hint-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap }
.grid-tools label { min-width:min(200px,100%) }
.grid-meta { color:var(--muted); font-size:.88rem }
.grid-meta strong,.grid-meta b { color:var(--text) }
details > summary { cursor:pointer; font-weight:650; color:var(--bright); padding:6px 0 }
.importer { border-top:1px solid var(--line); padding-top:10px }
.importer form { display:grid; gap:12px; max-width:620px; margin-top:9px }
.importer form button { justify-self:start }
.grid-row,.grid-notes { padding:14px 18px }
.grid-row { display:grid; gap:6px; border-bottom:1px solid var(--line) }
.grid-row:last-child { border-bottom:0 }
.grid-row-head,.hint-row { justify-content:space-between }
.grid-row h3 { margin:0; font-size:1.15rem }
.slot-label,.provenance { font-size:.82rem; color:var(--muted) }
.grid-row .controls:not(:empty) { margin-top:5px }
.match-matched { background:#20382c; color:var(--green) }
.match-missing_material,.match-needs_review,.match-choose_order { background:#392f21; color:#f2cc87 }
.match-ambiguous,.match-changed { background:#42292d; color:#ffc9c9 }
.grid-diff,.grid-notes { margin-top:14px }
.booking-hint { display:grid; gap:6px; border-left:3px solid #75869b; background:var(--raised); padding:10px 12px; font-size:.86rem }
.booking-hint p,.hint-row small { color:var(--muted) }
.hint-row { padding:4px 0 }
@media(max-width:680px) {
  .nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 8px; padding:5px 0 }
  .nav button { min-height:42px; text-align:left }
  .grid-tools { align-items:stretch; flex-direction:column }
  .grid-tools label { min-width:0 }
  .grid-row,.grid-notes { padding:14px }
}


.access-layout { display:grid; grid-template-columns:minmax(205px,.4fr) minmax(0,1fr); align-items:start; gap:16px }
.access-selector { gap:14px }
.roster-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 10px }
.roster-caption { color:var(--muted); font-size:.79rem }
.roster { display:grid; list-style:none; gap:4px; max-height:56dvh; overflow-y:auto; padding:3px }
.roster button { display:grid; width:100%; padding:7px 10px; text-align:left; background:transparent; border:1px solid transparent }
.roster button[aria-pressed=true] { border-color:var(--accent); background:#232e54 }
.roster button strong,.roster button small { overflow-wrap:anywhere }
.roster button small { font-weight:400 }
.plan-booking { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:8px 12px; border-left:3px solid #dfab69; background:var(--raised); overflow-wrap:anywhere }
.plan-booking > div { flex:1 1 145px; display:grid; min-width:0; gap:3px }
.plan-booking small,.booking-context p { color:var(--muted) }
.access-editor { padding:18px; display:grid; gap:16px; min-width:0 }
.access-heading { display:grid; gap:5px }
.access-heading p,.access-footer p { font-size:.86rem; color:var(--muted) }
.access-group { display:flex; flex-wrap:wrap; gap:2px 16px; padding:6px 12px 8px; border:1px solid var(--line); border-radius:8px }
.access-group legend { padding:0 5px; font-size:.93rem; font-weight:650 }
.access-hint { flex-basis:100%; font-size:.83rem; color:var(--muted) }
.access-check { display:inline-flex; align-items:center; gap:8px; min-height:36px; cursor:pointer; font-weight:400 }
.access-check:has(input:disabled) { color:var(--muted); cursor:default }
.access-check input { width:18px; height:18px; accent-color:var(--accent) }
.access-footer { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; justify-content:space-between }
.access-footer p { flex:1 1 140px }

summary { min-height:36px }
@media(max-width:680px) {
  .access-layout { grid-template-columns:minmax(0,1fr); gap:12px }
  .roster { max-height:25dvh }
  .access-editor { padding:14px }
  .access-check,button,summary,.choices button,.nav button { min-height:44px }
  .nav { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:3px; padding:2px 1px }
  .nav button { flex:none; padding-inline:9px; white-space:nowrap }
}

/* Help remains a keyboard/touch disclosure inside read-only forms. */
.help-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.room-help { display:inline-block; vertical-align:middle; margin:0; max-width:100%; }
.room-help > summary { display:inline-grid; place-items:center; list-style:none; box-sizing:border-box; width:28px; height:28px; padding:0; border:1px solid var(--line); border-radius:50%; color:var(--bright); font-size:14px; font-weight:700; line-height:1; cursor:help; }
.room-help > summary::-webkit-details-marker { display:none; }
.room-help[open] > summary, .room-help > summary:hover { background:var(--raised); }
.room-tip { display:block; box-sizing:border-box; max-width:100%; width:24rem; padding:10px 14px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--text); font-size:14px; line-height:1.5; font-weight:400; text-align:left; overflow-wrap:anywhere; }
.room-help:not([open]) > .room-tip { display:none; }
.room-tip[popover] { --tip-width:min(24rem,calc(100vw - 20px)); position:fixed; inset:auto; width:var(--tip-width); max-height:calc(100dvh - 20px); overflow:auto; margin:0; top:anchor(bottom); left:clamp(10px,anchor(left),calc(100% - var(--tip-width) - 10px)); position-try-fallbacks:flip-block; box-shadow:0 4px 16px #0005; }
@media (pointer:coarse) { .room-help > summary { width:44px; height:44px; } }
