:root {
  --bg: #0A0D13; --bg-2: #0D1119; --panel: #111621; --panel-2: #161C29; --panel-3: #1B2231;
  --line: #1F2735; --line-2: #2A3344;
  --text: #ECE9E2; --text-2: #A5ACBA; --text-3: #6A7284;
  --yellow: #F5C400; --yellow-2: #FFD84A; --on-yellow: #171300;
  --red: #FF5A6B; --green: #3DD68C; --blue: #74A9FF; --violet: #B895FF; --orange: #FF9F43;
  --radius: 14px; --radius-sm: 9px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg);
  background-image: radial-gradient(1200px 500px at 70% -200px, rgba(245,196,0,.05), transparent 60%);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--yellow); }
h1, h2, h3 { margin: 0; }
.title { font: italic 400 44px/1.05 var(--serif); letter-spacing: -.01em; }
.title small { font: italic 400 22px var(--serif); color: var(--text-3); margin-left: 10px; }
.caps { font: 700 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); margin-top: 8px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 14px 24px;
  background: rgba(10,13,19,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 14px rgba(245,196,0,.5); }
.logo b { color: var(--yellow); font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
.logo span { color: var(--text-3); font-size: 14px; margin-left: 8px; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 18px; border-radius: 99px; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a[aria-current="page"] { background: var(--yellow); color: var(--on-yellow); }
.nav a.off { opacity: .35; pointer-events: none; }

.page { padding: 0 24px 64px; max-width: 1640px; margin: 0 auto; }
.pagehead { display: flex; align-items: flex-end; gap: 16px; padding: 34px 0 22px; flex-wrap: wrap; }
.pagehead .grow { flex: 1; min-width: 260px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel-2);
  border-radius: var(--radius-sm); padding: 9px 16px; cursor: pointer; font-weight: 650; white-space: nowrap; color: var(--text); text-decoration: none; }
.btn:hover { border-color: #3A4458; background: var(--panel-3); }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.btn.yellow:hover { background: var(--yellow-2); border-color: var(--yellow-2); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.danger:hover { color: var(--red); border-color: rgba(255,90,107,.4); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.off { opacity: .7; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }

/* stats band */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: linear-gradient(var(--bg-2), transparent); margin: 0 -24px; padding: 22px 24px; }
.stat .n { font: 700 32px/1 var(--mono); letter-spacing: -.02em; }
.stat .l { font: 700 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 10px; }
.stat .s { color: var(--text-2); font-size: 13px; margin-top: 8px; }
.stat.yellow .n { color: var(--yellow); } .stat.red .n { color: var(--red); }

/* filters */
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 26px; }
.input, select.input, textarea.input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); min-width: 0; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,196,0,.14); }
select.input { appearance: none; padding-right: 34px; cursor: pointer; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.search { flex: 1 1 280px; padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236A7284' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px 50%; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); font-weight: 600; }
.check input { accent-color: var(--yellow); width: 16px; height: 16px; margin: 0; }

/* project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 22px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; color: var(--text); }
.pcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pcard:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.pcard .ph { display: flex; gap: 12px; padding: 18px 20px 14px; align-items: flex-start; }
.pcard h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.pcard .date { color: var(--text-3); font-size: 13.5px; margin-top: 4px; }
.pcard .badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; }
.pill.blue { color: var(--blue); border-color: rgba(116,169,255,.28); background: rgba(116,169,255,.08); }
.pill.violet { color: var(--violet); border-color: rgba(184,149,255,.28); background: rgba(184,149,255,.08); }
.thumb { position: relative; height: 240px; overflow: hidden; background: #06080C; }
.thumb .blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) brightness(.35) saturate(1.2); }
.thumb img { position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: 9 / 16; transform: translateX(-50%); object-fit: cover; box-shadow: 0 0 40px rgba(0,0,0,.6); }
.thumb .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.thumb .tl, .thumb .tr { position: absolute; bottom: 12px; font: 700 11.5px/1 var(--mono); letter-spacing: .1em; padding: 6px 9px; border-radius: 7px; background: rgba(10,13,19,.78); backdrop-filter: blur(4px); }
.thumb .tl { left: 12px; } .thumb .tr { right: 12px; }
.pcard .pf { display: flex; align-items: center; gap: 12px; padding: 14px 20px 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.status { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.st-ready { color: var(--green); border-color: rgba(61,214,140,.35); background: rgba(61,214,140,.1); }
.st-stale, .st-failed { color: var(--red); border-color: rgba(255,90,107,.35); background: rgba(255,90,107,.1); }
.st-processing, .st-queued { color: var(--yellow); border-color: rgba(245,196,0,.35); background: rgba(245,196,0,.1); }
.st-changes { color: var(--orange); border-color: rgba(255,159,67,.35); background: rgba(255,159,67,.1); }
.st-review, .st-subtitled { color: var(--blue); border-color: rgba(116,169,255,.3); background: rgba(116,169,255,.08); }
.st-approved { color: var(--violet); border-color: rgba(184,149,255,.35); background: rgba(184,149,255,.1); }
.st-draft, .st-empty { color: var(--text-2); border-color: var(--line-2); background: var(--panel-2); }
.dotline::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 1px; }
.dotline.idle::before { background: var(--text-3); }
.none { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 56px 20px; text-align: center; color: var(--text-2); }
.none .title { font-size: 34px; color: var(--text); margin-bottom: 8px; }

/* panels (studio, brand, activity) */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel > header .caps { color: var(--yellow); }
.panel > header .aside { margin-left: auto; color: var(--text-3); font-size: 13px; }
.panel.locked { opacity: .5; }
.panel.locked > header .caps { color: var(--text-3); }
.panel .body { padding: 18px 22px; display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
label.field { display: grid; gap: 7px; font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
label.field .input { font: 14px/1.4 Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none; }
.err { background: rgba(255,90,107,.1); color: #FFB3BB; border: 1px solid rgba(255,90,107,.35); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.studio .col { display: grid; gap: 20px; min-width: 0; }
.side { position: sticky; top: 86px; display: grid; gap: 14px; }
.shead { display: flex; align-items: center; gap: 12px; padding: 30px 0 22px; flex-wrap: wrap; }
.shead .name { flex: 1 1 320px; font: italic 400 40px/1.1 var(--serif); background: none; border: 1px solid transparent; border-radius: 10px; padding: 2px 10px; margin-left: -10px; color: var(--text); min-width: 0; }
.shead .name:hover, .shead .name:focus { border-color: var(--line-2); background: var(--panel); outline: none; }
.shead .brandin { width: 160px; }
.shead .conceptin { width: 120px; font-family: var(--mono); }
.deliver .body { gap: 12px; }
.vpick select { width: 100%; font: 700 14px/1.2 var(--mono); letter-spacing: .06em; padding: 12px 38px 12px 14px; border-color: var(--yellow); color: var(--yellow); }
.tag { font: 700 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; background: var(--yellow); color: var(--on-yellow); margin-right: 8px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.notes li.done { opacity: .5; } .notes li.done .ntext { text-decoration: line-through; }
.notes input { accent-color: var(--yellow); width: 16px; height: 16px; margin: 2px 0 0; }
.notes .ntext { white-space: pre-wrap; word-break: break-word; }
.notes .nmeta { font: 11.5px var(--mono); color: var(--text-3); margin-top: 4px; }
.names { list-style: none; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); font: 12px/1.7 var(--mono); color: var(--text-2); word-break: break-word; }
.names li.f { padding-left: 14px; }
.gbox { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); padding: 14px; display: grid; gap: 12px; }
#g-state.ok { color: var(--green); }
.dvbrand { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; }
.dvbrand .state { grid-column: 2 / 4; font-size: 12.5px; margin-top: -4px; }
.dvbrand .state.ok { color: var(--green); } .dvbrand .state.bad { color: var(--red); }

.drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 22px; text-align: center; color: var(--text-2); cursor: pointer; background: var(--bg-2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--yellow); background: rgba(245,196,0,.04); }
.drop strong { color: var(--text); display: block; margin-bottom: 3px; }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--yellow); width: 0; transition: width .2s; }

.clips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clip { display: grid; grid-template-columns: 18px 20px 38px 1fr auto auto; gap: 12px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.clip.off { opacity: .45; }
.clip.dragging { opacity: .3; }
.clip.target { box-shadow: 0 -2px 0 var(--yellow); }
.clip .grip { cursor: grab; color: var(--text-3); user-select: none; text-align: center; }
.clip input { accent-color: var(--yellow); width: 16px; height: 16px; margin: 0; }
.clip img, .clip .noimg { width: 38px; height: 67px; object-fit: cover; border-radius: 5px; background: var(--panel-3); display: grid; place-items: center; color: var(--yellow); font-size: 16px; }
.clip .cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.clip .cdur { font: 12.5px var(--mono); color: var(--text-3); }

textarea.input { width: 100%; min-height: 240px; resize: vertical; line-height: 1.7; font-size: 14px; }
.subs { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.subs li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.subs li:last-child { border-bottom: 0; }
.subs li:hover { background: var(--panel-2); }
.subs li.now { background: rgba(245,196,0,.08); box-shadow: inset 3px 0 0 var(--yellow); }
.subs time { font: 12.5px var(--mono); color: var(--text-3); padding-top: 2px; }
.subs time:hover { color: var(--yellow); }
.subs .ctext { border-radius: 6px; padding: 1px 6px; margin: -1px -6px; cursor: text; }
.subs .ctext:hover { background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.subs .ctext.editing { background: var(--bg); box-shadow: inset 0 0 0 1px var(--yellow); outline: none; }
.subs .ctext.saving { opacity: .5; }

.range { display: grid; grid-template-columns: 1fr 72px; gap: 12px; align-items: center; }
.range input { accent-color: var(--yellow); width: 100%; }
.range output { font: 700 14px var(--mono); color: var(--yellow); text-align: right; }

.player { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 9 / 16; width: 100%; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; display: block; }
.player .ph { color: var(--text-3); display: grid; place-items: center; height: 100%; text-align: center; padding: 24px; }
.seg { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 99px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px; border-radius: 99px; cursor: pointer; font-weight: 650; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.log { background: #06080C; color: #B9C0CC; font: 11.5px/1.55 var(--mono); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; height: 200px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log .e { color: var(--red); } .log .ok { color: var(--green); } .log .c { color: var(--text-3); }

/* tables (activity, brand) */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 14px 22px; border-bottom: 1px solid var(--line); }
table.t td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { font-family: var(--mono); color: var(--text-2); white-space: nowrap; }
table.t a { color: var(--text); text-decoration: none; font-weight: 650; }
table.t a:hover { color: var(--yellow); }
.kv { display: grid; grid-template-columns: 200px 1fr; }
.kv > div { padding: 13px 22px; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { font: 700 11px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-2); vertical-align: -2px; margin-right: 8px; }
.twocol { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.preview9 { aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; position: relative; border: 1px solid var(--line); background: linear-gradient(160deg, #3B4A63, #1B2231 60%, #0E121A); }
.preview9 .cap { position: absolute; left: 10%; right: 10%; text-align: center; font: 800 17px/1.25 Montserrat, sans-serif; color: #fff;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000, 0 2px 3px rgba(0,0,0,.6); }
.fix { display: grid; grid-template-columns: 1fr 24px 1fr 34px; gap: 10px; align-items: center; }
.fix .arrow { color: var(--text-3); text-align: center; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0; width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(4,6,10,.7); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 16px; padding: 24px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: grid; gap: 18px; }

@media (max-width: 1180px) { .studio, .twocol { grid-template-columns: 1fr; } .side { position: static; } .player, .preview9 { max-width: 360px; margin: 0 auto; width: 100%; } }
@media (max-width: 760px) {
  .top { padding: 12px 16px; gap: 10px; flex-wrap: wrap; } .logo span:not(.dot) { display: none; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; } .nav a { padding: 7px 14px; font-size: 14px; }
  .page { padding: 0 16px 48px; } .stats { grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 0 -16px; padding: 18px 16px; }
  .title { font-size: 36px; } .shead .name { font-size: 30px; }
  .cards { grid-template-columns: 1fr; } .clip { grid-template-columns: 18px 20px 32px 1fr auto; } .clip .cdur { display: none; }
  .kv { grid-template-columns: 1fr; } .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; }
  table.t th, table.t td { padding: 12px 14px; } .hide-sm { display: none; }
}
