:root {
  color-scheme: dark;
  --bg: #121117;
  --rail: #17161e;
  --panel: #1c1b24;
  --panel-alt: #23222d;
  --line: #302e3b;
  --ink: #f5f3fb;
  --muted: #aaa5bb;
  --soft: #cbb9ff;
  --accent: #bc9dff;
  --mint: #93e9bb;
  --danger: #ffc3cb;
  --radius: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 95px; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--soft); text-decoration: none; }
a:hover { color: #eee6ff; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4.8vw, 3.25rem); letter-spacing: -.055em; line-height: 1.05; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; overflow-wrap: anywhere; }
p { line-height: 1.57; }
small, .small { font-size: .81rem; }
.muted { color: var(--muted); }
button, input, textarea, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; cursor: pointer; min-height: 44px; padding: .63rem .98rem; border: 1px solid transparent; border-radius: 10px; font-weight: 680; font-size: .9rem; white-space: normal; text-align: center; }
button:hover, .button:hover { filter: brightness(1.12); }
.primary { background: var(--accent); color: #201334 !important; }
.secondary { background: var(--panel-alt); color: var(--ink); border-color: var(--line); }
.plain { background: transparent; color: var(--muted); padding-left: .5rem; padding-right: .5rem; }
:focus-visible { outline: 2px solid #dfcfff; outline-offset: 3px; }
.skip { position: fixed; z-index: 10; padding: 12px; top: -100px; background: var(--panel); }
.skip:focus { top: 10px; }
.rail { position: fixed; z-index: 3; top: 0; bottom: 0; left: 0; width: 226px; background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 25px 15px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.rail .brand { padding-left: 8px; }
.brand-mark { display: grid; place-items: center; background: var(--accent); color: #281d3c; font-size: 14px; width: 35px; height: 35px; border-radius: 11px; }
.brand-name { font-size: .92rem; font-weight: 770; letter-spacing: .02em; }
.brand-name strong { color: var(--accent); }
nav { display: grid; gap: 5px; margin-top: 40px; }
nav a { min-height: 45px; padding: 10px 11px; display: flex; align-items: center; gap: 10px; color: var(--muted); border: 1px solid transparent; border-radius: 10px; font-size: .88rem; font-weight: 625; }
nav a:hover, nav a[aria-current] { color: #e9ddff; background: #292238; border-color: #3d3154; }
.account { margin-top: auto; }
.account button { width: 100%; }
.body { margin-left: 226px; }
.masthead { min-height: 67px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(18px,4vw,54px); font-size: .86rem; color: var(--muted); }
.live-mark { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.live-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px #93e9bb87; }
.mobile-brand, .mobile-logout { display: none; }
main { max-width: 1440px; margin-inline: auto; padding: clamp(18px,4vw,49px); }
.surface { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 233px; padding: clamp(24px,5vw,46px); border: 1px solid #463461; border-radius: 22px; background: radial-gradient(ellipse at 91% 92%,#402d61,transparent 62%), linear-gradient(115deg,#241d34,#2c2142 60%,#221b35); }
.hero > div:first-child { position: relative; z-index: 1; }
.kicker { margin-bottom: 10px; color: var(--soft); font-size: .7rem; letter-spacing: .15em; font-weight: 760; }
.hero p:not(.kicker) { color: #c7bed9; margin: 12px 0 22px; max-width: 47ch; }
.hero-graphic { display: flex; align-items: center; position: relative; gap: 9px; padding: 14px 10px 14px 23px; }
.hero-graphic i { height: 85px; width: 5px; background: linear-gradient(#c5a8ff55,#c5a8ffab,#c5a8ff55); border-radius: 4px; }
.hero-graphic i:nth-of-type(2n) { height: 45px; }
.hero-graphic i:nth-of-type(3n) { height: 115px; }
.hero-graphic i:nth-of-type(5n) { height: 27px; }
.hero-play { display: grid; place-items: center; width: 93px; height: 93px; flex: none; border-radius: 27px; background: #bc9dff14; color: #d8c5fc; border: 1px solid #c5a4ff63; font-size: 36px; box-shadow: 0 0 50px #bc9dff28; transform: rotate(-9deg); margin-right: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 16px 0 22px; }
.metric { color: var(--ink); display: flex; align-items: flex-start; flex-direction: column; padding: clamp(12px,2.3vw,20px); gap: 9px; }
.metric:hover { border-color: #685089; }
.metric-icon { display: grid; place-items: center; height: 35px; width: 35px; border-radius: 9px; background: #332847; color: #d4baff; }
.tone-clock { background: #3e3027; color: #ffd099; }
.tone-film { background: #253d35; color: #a2ebc9; }
.tone-play { background: #382a3e; color: #f8baf5; }
.metric-value { font-size: clamp(1.5rem, 3.5vw, 2.3rem); line-height: 1.1; font-weight: 760; letter-spacing: -.05em; }
.metric-name { color: var(--muted); font-size: .84rem; }
.icon { display: inline-grid; width: 22px; height: 22px; place-items: center; flex: 0 0 22px; font-size: 18px; font-weight: 600; line-height: 1; }
.icon-grid::before { content: "⊞"; }
.icon-radar::before { content: "◎"; }
.icon-film::before { content: "▤"; }
.icon-check::before { content: "✓"; }
.icon-users::before { content: "♙"; }
.icon-play::before { content: "▷"; }
.icon-settings::before { content: "⚙"; }
.icon-clock::before { content: "◷"; }
.overview-grid, .clip-grid { display: grid; gap: 16px; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); align-items: start; }
.clip-grid { grid-template-columns: minmax(240px,.9fr) minmax(0,1.22fr); }
.section { padding: clamp(15px,2.4vw,25px); margin-bottom: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.section-title > a { font-size: .85rem; text-align: right; }
.neutral-count { color: var(--muted); background: var(--panel-alt); border-radius: 9px; padding: 4px 9px; white-space: nowrap; font-size: .78rem; }
.job-list, .timeline, .radar-list, .watch-list { list-style: none; margin: 0; padding: 0; }
.job-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; color: var(--ink); min-height: 64px; }
.job-list li + li, .timeline li + li, .radar-list li + li, .watch-list li + li { border-top: 1px solid var(--line); }
.file-tile, .avatar { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; background: #302447; color: var(--accent); border: 1px solid #443260; border-radius: 10px; }
.file-tile { font-size: .83rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; }
.job-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.job-text strong { overflow-wrap: anywhere; }
.job-text small, .watch-person small { color: var(--muted); }
.chevron { color: var(--muted); }
.chip { display: inline-flex; align-items: center; text-align: center; align-self: center; padding: 5px 8px; border: 1px solid #413b53; border-radius: 8px; font-size: .73rem; font-weight: 680; background: #282434; color: #d4c6ec; line-height: 1.25; }
.state-review, .state-processing, .state-uploading { color: #ffda9e; background: #372e23; border-color: #665137; }
.state-approved, .state-uploaded, .state-scheduled { color: #a8ebca; background: #233d32; border-color: #385d4c; }
.state-failed, .state-rejected, .state-upload_failed, .state-upload_uncertain, .state-revoked { color: var(--danger); background: #40282f; border-color: #633a45; }
.empty { display: grid; place-items: center; min-height: 127px; gap: 9px; align-content: center; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 13px; }
.empty-inline { color: var(--muted); padding: 10px 0 4px; }
.event { display: grid; gap: 4px; padding: 10px 0; }
.event div { display: flex; gap: 6px 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.event strong { color: #d3bae9; font-size: .74rem; letter-spacing: .035em; }
.event-error strong { color: var(--danger); }
.event-warning strong { color: #ffd3a1; }
.event time { color: var(--muted); font-size: .72rem; }
.event > a, .event > span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.event > a:hover { color: var(--ink); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-heading p, .back { color: var(--muted); }
.page-heading p { margin-top: 10px; }
.back { display: inline-block; margin-bottom: 15px; }
.flush { margin: 0; }
.fields { display: grid; gap: 15px; margin-top: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: .87rem; font-weight: 600; }
label small { color: var(--muted); font-weight: 450; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border-radius: 9px; color: var(--ink); background: #15141d; border: 1px solid #403c50; padding: 8px 10px; font-size: 1rem; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #9993ae; opacity: 1; }
input[type=checkbox] { width: 19px; min-height: auto; height: 19px; accent-color: var(--accent); margin: 0; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.upload-box { padding: 16px; border: 1px dashed #675181; background: #281f35; border-radius: 12px; gap: 10px; }
.upload-box input { padding: 5px; }
input::file-selector-button { background: var(--panel-alt); border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 7px; margin-right: 8px; }
.details-box { border: 1px solid var(--line); padding: 11px 12px; border-radius: 10px; margin-top: 4px; }
summary { cursor: pointer; font-size: .89rem; color: var(--soft); padding: 4px 0; }
.flash { padding: 12px; background: #202e2a; color: #b3efce; border: 1px solid #405e50; border-radius: 10px; margin-bottom: 14px; overflow-wrap: anywhere; }
.flash.danger { background: #3d262f; color: var(--danger); border-color: #704150; }
.provider-row, .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.actions { margin: 12px 0 0; }
.radar-item, .watch-list li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; align-items: center; }
.score { padding: 8px; border-radius: 11px; align-self: flex-start; background: #302547; min-width: 60px; display: grid; text-align: center; }
.score strong { font-size: 1.45rem; color: #e5d7ff; }
.score small { color: var(--muted); }
.radar-details { flex: 1; min-width: 0; }
.radar-details h3 { margin: 5px 0 7px; }
.radar-details details { margin-top: 7px; }
.radar-actions, .watch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-person, .watch-actions form { display: flex; align-items: center; gap: 8px; }
.watch-person > div { display: grid; gap: 3px; }
.watch-list li { flex-wrap: wrap; }
.production-options { flex-basis: 100%; }
.watch-actions input { width: 85px; }
.properties { margin: 10px 0; display: grid; gap: 9px; }
.properties div { display: grid; grid-template-columns: minmax(85px, .7fr) minmax(0,1.3fr); gap: 8px; font-size: .85rem; }
.properties dt { color: var(--muted); }
.properties dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.code-line { display: block; margin-top: 10px; color: var(--soft); overflow-wrap: anywhere; }
.preview-panel video { display: block; width: min(100%, 330px); aspect-ratio: 9/16; margin: 0 auto; background: #0a090e; border-radius: 14px; }
.video-empty { min-height: 280px; background: #15141c; border-radius: 14px; padding: 16px; text-align: center; display: grid; place-items: center; align-content: center; gap: 14px; }
.video-empty p { color: var(--muted); }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.warning-list { margin: 12px 0; padding-left: 22px; color: #ffda9e; font-size: .9rem; }
.cues { padding: 0; list-style: none; }
.cues li { display: flex; gap: 10px; font-size: .85rem; padding: 5px 0; }
.cues time { white-space: nowrap; color: var(--muted); }
.login-page { min-height: 100svh; display: grid; place-items: center; background: radial-gradient(ellipse at 55% 43%,#38284b, var(--bg) 72%); }
.login-shell { width: min(100%, 490px); }
.login-panel { padding: clamp(22px,6vw,35px); box-shadow: 0 24px 90px #07050b66; }
.login-panel h1 { margin-top: 27px; font-size: clamp(1.9rem,5vw,2.55rem); }
.login-panel p { margin: 10px 0 19px; }
.login-panel button { width: 100%; }
@media (max-width: 980px) {
  .rail { width: 190px; padding-inline: 10px; }
  .body { margin-left: 190px; }
  .overview-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-graphic { transform: scale(.80); transform-origin: right center; padding-left: 0; }
}
@media (max-width: 720px) {
  .body { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .rail { inset: auto 0 0; width: auto; padding: 0 0 env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand, .account, .live-mark, .mast-label { display: none; }
  .mobile-brand, .mobile-logout { display: inline-flex; }
  .rail nav { display: flex; gap: 3px; justify-content: center; margin: 0; min-height: 60px; padding: 3px; }
  nav a { flex: 1 1 0; min-width: 0; min-height: 53px; padding: 2px; gap: 3px; justify-content: center; flex-direction: column; font-size: .61rem; text-align: center; overflow-wrap: anywhere; }
  nav a span:not(.icon) { line-height: 1.1; }
  .masthead { min-height: 59px; }
  .hero-graphic { position: absolute; right: -18px; top: 10px; opacity: .32; transform: scale(.68); }
  .hero h1 { max-width: 18ch; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .clip-grid { grid-template-columns: 1fr; gap: 0; }
  .radar-item, .watch-list li { flex-wrap: wrap; }
  .radar-actions, .watch-actions { width: 100%; }
}
@media (max-width: 410px) {
  .page-heading { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .job-row { gap: 6px; }
  .job-row .file-tile { width: 31px; height: 35px; }
  .job-row .chevron { display: none; }
}
