:root {
  /* Palette taken from the logo: deep navy -> royal blue -> cyan */
  --navy: #03154f; --royal: #0a4a9a; --cyan: #00c6f2; --accent: #19c0f0;
  --grad: linear-gradient(135deg, #062a7a 0%, #0063b0 55%, #00b9ec 100%);
  --bg: #040a19; --panel: #0a1430; --panel2: #10204a; --line: #1e3364; --text: #eaf3ff; --muted: #8fa6cc;
  --field: #060f26; --btn: #142a5a; --head: #061233; --stagebg: #02060f;
  --green: #4fcf8a; --yellow: #e4c84a; --red: #f06a6a; --blue: #5ab8ff;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif; --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
.hide { display: none !important; }
.muted { color: var(--muted); font-size: .88em; }
.grow { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .45rem 0; }
.pad { padding: 0 .8rem; }
.f { background: var(--field); border: 1px solid var(--line); border-radius: .4rem; padding: .45rem .6rem; width: 100%; }
.row .f { width: auto; }
textarea.f { min-height: 4.5rem; resize: vertical; } textarea.tall { min-height: 9rem; }
label { display: block; margin: .7rem 0 .25rem; color: var(--muted); font-size: .9rem; }
label.tg { display: flex; gap: .5rem; align-items: center; color: var(--text); }
.btn { padding: .45rem .9rem; border-radius: .4rem; border: 1px solid var(--line); background: var(--btn); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--muted); } .btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--grad); background-origin: border-box; color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 2px 10px rgba(0, 150, 230, .25); }
.btn.primary:hover { filter: brightness(1.12); border-color: transparent; }
.btn.danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn.ghost { background: transparent; color: var(--text); }
.btn.file { margin: 0; color: var(--text); }
.brand { font-weight: 700; letter-spacing: .16em; white-space: nowrap; display: inline-flex; align-items: center; gap: .55rem; } .brand span { color: var(--accent); } .brand img { width: 1.9rem; height: 1.9rem; } .brand.big { font-size: 1.4rem; } .brand.big img { width: 2.6rem; height: 2.6rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; margin: .8rem 0; }
.seg button { border: 0; background: transparent; padding: .4rem 1rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; }
.err { color: var(--red); min-height: 1.4rem; margin-top: .5rem; }
.auth { display: flex; align-items: center; justify-content: center; height: 100%; }
.auth { background: radial-gradient(ellipse at 70% 80%, rgba(0, 185, 236, .18), transparent 60%), radial-gradient(ellipse at 20% 10%, rgba(10, 60, 160, .35), transparent 55%), var(--bg); }
.authbox { width: min(26rem, 92vw); display: flex; flex-direction: column; gap: .6rem; background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; padding: 1.6rem; }
header { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--head); flex-wrap: wrap; }
.meter { font: .85rem var(--mono); color: var(--muted); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.meter b { color: var(--text); } .meter .bar { width: 9rem; height: .45rem; background: var(--panel2); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; }
.meter .bar i { display: block; height: 100%; background: var(--grad); }
.badge { font: 600 .75rem var(--mono); padding: .15rem .55rem; border-radius: 99px; border: 1px solid var(--accent); color: var(--accent); text-transform: uppercase; }
.app { display: flex; flex-direction: column; height: 100vh; }
.plans { padding: 2rem; overflow: auto; } .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.card .price { font-size: 2rem; font-weight: 700; } .card ul { margin: .3rem 0 .8rem 1.1rem; padding: 0; color: var(--muted); }
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 17rem minmax(0, 1fr) 27rem; }
.side { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; }
.sec { padding: .9rem .8rem .3rem; font: 600 .75rem var(--mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.item { padding: .5rem .8rem; cursor: pointer; border-left: 3px solid transparent; display: flex; gap: .5rem; align-items: center; }
.item:hover { background: var(--panel2); } .item.cur { background: var(--panel2); border-left-color: var(--accent); }
.item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { font: 700 .66rem var(--mono); width: 1.3rem; height: 1.3rem; border-radius: .25rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--muted); }
.chip.ok { background: var(--green); border-color: var(--green); color: #04121f; } .chip.rv { border-color: var(--accent); color: var(--accent); } .chip.tmp { background: var(--yellow); color: #111; } .chip.no { border-color: var(--red); color: var(--red); }
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--stagebg); }
.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 1rem; }
.stage img, .stage video { max-width: 100%; max-height: 100%; object-fit: contain; background: #000; }
.stage canvas { position: absolute; cursor: crosshair; }
.stage .empty { color: var(--muted); }
.cap { position: absolute; left: 1rem; bottom: .6rem; font: .8rem var(--mono); background: rgba(0, 0, 0, .7); padding: .15rem .5rem; border-radius: .3rem; }
.strip { display: flex; gap: .5rem; padding: .5rem 1rem; border-top: 1px solid var(--line); background: var(--panel); overflow-x: auto; min-height: 4.4rem; }
.strip img, .strip video { height: 3.3rem; border: 2px solid transparent; border-radius: .25rem; cursor: pointer; opacity: .8; }
.strip .on { border-color: var(--accent); opacity: 1; } .strip .ok { box-shadow: 0 0 0 2px var(--green); }
.decide { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--line); background: var(--panel); }
.act { display: flex; gap: .6rem; align-items: center; padding: .5rem .8rem; border-radius: .45rem; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.act b { font: 700 1.2rem var(--mono); } .act.a b { color: var(--green); } .act.t b { color: var(--yellow); } .act.r b { color: var(--red); } .act.s b { color: var(--muted); }
.act:disabled { opacity: .3; cursor: default; }
.note { display: flex; gap: .5rem; padding: 0 1rem .6rem; background: var(--panel); } .note textarea { flex: 1; min-height: 3.5rem; background: var(--field); border: 1px solid var(--line); border-radius: .4rem; padding: .5rem; }
.panel { border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 0 1rem 1.5rem; }
.tabs { display: flex; position: sticky; top: 0; background: var(--panel); margin: 0 -1rem .5rem; border-bottom: 1px solid var(--line); z-index: 2; }
.tabs button { flex: 1; border: 0; background: transparent; padding: .7rem; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; font: 600 .85rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pane { display: none; } .pane.on { display: block; }
.ttl { font-size: 1.15rem; font-weight: 600; margin: .4rem 0; }
.refs { display: grid; gap: .5rem; } .ref { display: grid; grid-template-columns: 6rem 1fr auto; gap: .6rem; align-items: center; }
.ref img { width: 6rem; height: 3.6rem; object-fit: cover; border-radius: .3rem; background: #000; }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0; } .warn { color: var(--yellow); }
.notes { white-space: pre-wrap; font: .8rem var(--mono); color: var(--muted); margin-top: .8rem; max-height: 12rem; overflow: auto; }
.job { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.job .st { font: 600 .75rem var(--mono); text-transform: uppercase; } .st.done { color: var(--green); } .st.failed { color: var(--red); } .st.running, .st.queued { color: var(--blue); } .st.held { color: var(--yellow); }
.qc { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.qcv { font: 700 .8rem var(--mono); padding: .15rem .5rem; border-radius: .3rem; } .qcv.pass { background: var(--green); color: #111; } .qcv.fail { background: var(--red); color: #111; }
.qcf { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin: .4rem 0; } .qcf img { width: 100%; border-radius: .2rem; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem; overflow: auto; z-index: 10; }
.mbox { width: min(46rem, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; padding: 1.2rem 1.4rem; }
.mbox h3 { margin: 1.2rem 0 .4rem; font-size: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } td, th { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.toast { position: fixed; right: 1rem; bottom: 1rem; background: var(--red); color: #fff; padding: .6rem .9rem; border-radius: .45rem; display: none; max-width: 30rem; z-index: 20; }
@media (max-width: 1100px) { .work { grid-template-columns: 1fr; } .stage { min-height: 50vh; } .side, .panel { border: 0; } }

header { box-shadow: inset 0 -2px 0 0 transparent; border-image: var(--grad) 1; border-bottom: 2px solid; }
::selection { background: rgba(0, 198, 242, .35); }

/* storyboard */
.stage.board { display: block; overflow: auto; padding: 1rem 1.2rem 2rem; }
.btool { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; position: sticky; top: -1rem; z-index: 2; background: var(--stagebg); padding: .6rem 0 .8rem; margin-top: -.6rem; border-bottom: 1px solid var(--line); }
.bgroup { margin: 1.2rem 0 .4rem; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.bgroup b { font: 700 .8rem var(--mono); color: var(--accent); } .bgroup span { font: 600 .9rem var(--mono); letter-spacing: .04em; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .8rem; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.bcard:hover { border-color: var(--accent); } .bcard.cur { box-shadow: 0 0 0 2px var(--accent); }
.bthumb { aspect-ratio: 16 / 9; background: #020611; display: flex; align-items: center; justify-content: center; color: var(--muted); font: .78rem var(--mono); text-align: center; padding: .5rem; }
.bthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bmeta { padding: .5rem .6rem .6rem; display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; }
.bmeta .t { font-weight: 600; } .bmeta .row { margin: 0; gap: .3rem; } .bmeta .need { color: var(--yellow); font-size: .78rem; }
.script { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: .4rem; padding: .55rem .7rem; margin: .4rem 0 .2rem; font-size: .86rem; }
.script b { font: 600 .8rem var(--mono); color: var(--accent); }
.shead { padding: .55rem .8rem .2rem; font: 600 .7rem var(--mono); color: var(--accent); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-sc { max-height: 14rem; overflow: auto; border: 1px solid var(--line); border-radius: .4rem; margin: .5rem 0; font: .82rem var(--mono); }
.imp-sc div { padding: .25rem .6rem; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; } .imp-sc div:last-child { border-bottom: 0; } .imp-sc .muted { margin-left: auto; }
