/* trimcop: a bodycam system (dark UI, HUD over the footage), a paper ticket
   for the verdict, and a cartoon diver cop for the attitude. */
:root {
  --deep: #090c11;
  --surface: #121923;
  --pane: rgba(255, 255, 255, .04);
  --pane-2: rgba(255, 255, 255, .08);
  --edge: rgba(255, 255, 255, .10);
  --edge-2: rgba(255, 255, 255, .22);
  --ink: #eef2f6;
  --mute: #9aa6b2;
  --dim: #66717d;
  --level: #3fd69b;
  --rise: #ffa857;
  --sink: #6cb6ff;
  --hip: #ffd23f;
  --knee: #c7a6f7;
  --alert: #ff4d5e;
  --cop-red: #ff3b4e;
  --cop-blue: #2f7bff;
  --tape: #ffd23f;
  --paper: #f7f1e3;
  --paper-2: #efe6d0;
  --paper-ink: #1e1b16;
  --paper-mute: #6f6656;
  --paper-edge: #d6cab0;
  --sans: "Barlow", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Barlow", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display: "Bungee", "Barlow Condensed", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --hand: "Permanent Marker", "Barlow", cursive;
  --r-pane: 14px;
  --r-ctl: 8px;
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--deep);
  background-image:
    radial-gradient(700px 320px at 8% -10%, rgba(255, 59, 78, .16), transparent 65%),
    radial-gradient(700px 320px at 92% -10%, rgba(47, 123, 255, .20), transparent 65%),
    linear-gradient(180deg, var(--surface) 0, #0d1219 30%, var(--deep) 100%);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button {
  background: var(--pane-2); border: 1px solid var(--edge); border-radius: var(--r-ctl);
  padding: 7px 16px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
button:hover { border-color: var(--edge-2); background: rgba(255, 255, 255, .12); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary {
  background: var(--tape); border: 2px solid #111; color: #111; font-weight: 700;
  padding: 10px 18px; width: 100%; font-size: 16px; box-shadow: 3px 3px 0 #111; letter-spacing: .02em;
}
button.primary:hover { background: #ffdd66; border-color: #111; }
button.primary:active:not(:disabled) { box-shadow: 1px 1px 0 #111; transform: translate(2px, 2px); }
button.quiet { background: none; border-color: transparent; color: var(--mute); padding: 4px 10px; }
button.quiet:hover { color: var(--ink); background: var(--pane); }
button.danger:hover { color: var(--alert); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--sink); outline-offset: 2px; }
a { color: var(--sink); text-underline-offset: 3px; }
.num { font-family: var(--cond); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
[hidden] { display: none !important; }

/* ---------- frame ---------- */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; background: rgba(9, 12, 17, .6); backdrop-filter: blur(10px);
}
.tape {
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 14px, #111 14px 28px);
  border-top: 1px solid #111; border-bottom: 1px solid #111;
}
.mark { width: 34px; height: 34px; flex: none; transform: rotate(-8deg); }
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand h1 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; letter-spacing: .02em; color: var(--tape); text-shadow: 2px 2px 0 #000; line-height: 1; }
.brand .tag { color: var(--mute); font-size: 14px; white-space: nowrap; }
.top .icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; color: var(--mute); flex: none; }
.top .icon svg { width: 18px; height: 18px; }
.top .icon:hover { color: var(--ink); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top .new { padding: 7px 16px; font-weight: 600; }
.top .toggle { padding: 6px 14px; color: var(--mute); }
.top .toggle[aria-pressed=true] { color: var(--ink); border-color: var(--sink); background: rgba(108, 182, 255, .12); }
body.rail-off .app { grid-template-columns: minmax(0, 1fr); }
body.rail-off aside { display: none; }
.lang { margin-left: auto; display: inline-flex; border: 1px solid var(--edge); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--mute); }
.lang button[aria-pressed=true] { background: var(--pane-2); color: var(--ink); }

.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 70px); }
aside { border-right: 1px solid var(--edge); padding: 22px 20px 28px; display: flex; flex-direction: column; gap: 22px; }
main { padding: 28px 32px 56px; min-width: 0; }

/* ---------- mascot ---------- */
.cop { display: block; width: 100%; height: auto; overflow: visible; }
.cop .cop-shadow { fill: rgba(0, 0, 0, .35); }
.cop .bub { fill: none; stroke: var(--sink); stroke-width: 1.5; opacity: .8; }
.cop .suit { fill: #1b2533; stroke: #000; stroke-width: 2.5; }
.cop .suit-line { stroke: var(--tape); stroke-width: 3; }
.cop .badge-dot { fill: var(--tape); stroke: #000; stroke-width: 2; }
.cop .skin { fill: #ffd9b0; stroke: #000; stroke-width: 2.5; }
.cop .cap { fill: #1a3a8a; stroke: #000; stroke-width: 2.5; }
.cop .visor { fill: #0d1b40; stroke: #000; stroke-width: 2.5; }
.cop .cap-star { fill: var(--tape); stroke: #000; stroke-width: 1.2; }
.cop .strap { stroke: #222; stroke-width: 5; stroke-linecap: round; }
.cop .mask { fill: rgba(108, 182, 255, .55); stroke: #000; stroke-width: 3; }
.cop .lens-glare { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; opacity: .85; }
.cop .eyes-ok { fill: #000; }
.cop .eyes-stern, .cop .brows-stern { stroke: #000; stroke-width: 3; stroke-linecap: round; fill: none; }
.cop .mouth-ok, .cop .mouth-stern, .cop .mouth-busy { fill: none; stroke: #000; stroke-width: 3; stroke-linecap: round; }
.cop .lanyard { fill: none; stroke: var(--cop-red); stroke-width: 2; }
.cop .whistle { fill: #c9ced6; stroke: #000; stroke-width: 2; }
.cop .eyes-stern, .cop .brows-stern, .cop .mouth-stern, .cop .mouth-busy { display: none; }
[data-mood=stern] .cop .eyes-ok, [data-mood=stern] .cop .mouth-ok { display: none; }
[data-mood=stern] .cop .eyes-stern, [data-mood=stern] .cop .brows-stern, [data-mood=stern] .cop .mouth-stern { display: inline; }
[data-mood=busy] .cop .mouth-ok { display: none; }
[data-mood=busy] .cop .mouth-busy { display: inline; }
.cop .bub { animation: rise 3.2s ease-in infinite; transform-box: fill-box; }
.cop .b2 { animation-delay: .9s; }
.cop .b3 { animation-delay: 1.8s; }
@keyframes rise { 0% { transform: translateY(14px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-18px); opacity: 0; } }

/* ---------- compose (new report form) ---------- */
.compose {
  background: var(--pane); border: 1px solid var(--edge); border-radius: var(--r-pane);
  padding: 0 20px 22px; overflow: hidden;
}
.form-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 0 -20px 18px; padding: 10px 20px; background: rgba(47, 123, 255, .12);
  border-bottom: 1px solid var(--edge); font-weight: 600; font-size: 14px; letter-spacing: .04em;
}
.form-head .mono { color: var(--mute); font-size: 12px; font-weight: 400; }
.drop {
  border: 2px dashed var(--edge-2); border-radius: 10px; padding: 22px 16px;
  text-align: center; color: var(--mute); transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--tape); background: rgba(255, 210, 63, .08); color: var(--ink); }
.drop .big-hint { font-size: 15px; color: var(--ink); margin: 0 0 10px; }
.drop .types { font-size: 12px; color: var(--dim); margin: 10px 0 0; }
.staged {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 2px 12px; align-items: center;
  border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; background: rgba(0, 0, 0, .3);
}
.staged.over { border-color: var(--tape); }
.staged svg { width: 38px; height: 38px; grid-row: span 2; }
.staged .fname { font-weight: 500; overflow-wrap: anywhere; }
.staged .fmeta { grid-column: 2; color: var(--mute); font-size: 13px; }
.staged button { grid-column: 3; grid-row: span 2; }
.field { display: block; font-size: 13px; color: var(--mute); margin-top: 14px; }
.field.inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field input {
  background: rgba(0, 0, 0, .4); border: 1px solid var(--edge); border-radius: var(--r-ctl);
  padding: 8px 10px; color: var(--ink); width: 100%; margin-top: 4px; font-size: 15px;
}
.field.inline input { width: 74px; margin: 0; padding: 4px 8px; text-align: center; }
.field input:focus { border-color: var(--edge-2); }
.hint { color: var(--dim); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.hint a { color: var(--mute); }
.go { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.go button.primary { width: auto; min-width: 180px; }
.go .why, .why { color: var(--mute); font-size: 13px; }
.bar { height: 6px; background: rgba(0, 0, 0, .5); border-radius: 3px; margin-top: 14px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--tape) 0 8px, #111 8px 16px); transition: width .1s linear; }
.warn { color: var(--rise); font-size: 13px; margin: 0; line-height: 1.5; }
.warn.err { color: var(--alert); overflow-wrap: anywhere; }
.warn.gap { margin-top: 12px; }

/* ---------- history (case files) ---------- */
.history h2 { font-size: 12px; font-weight: 600; color: var(--mute); margin: 0 0 8px; letter-spacing: .1em; text-transform: uppercase; }
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li + li { margin-top: 2px; }
.jobs button {
  display: grid; grid-template-columns: 10px 1fr; gap: 1px 10px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; border-radius: var(--r-ctl); padding: 8px 10px 8px 12px;
  position: relative;
}
.jobs button:hover { background: var(--pane); }
.jobs button[aria-current=true] { background: var(--pane-2); }
.jobs button[aria-current=true]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--tape); }
.jobs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.jobs .dot.level { background: var(--level); }
.jobs .dot.head_up { background: var(--rise); }
.jobs .dot.head_down { background: var(--sink); }
.jobs .dot.busy { background: var(--cop-blue); animation: siren-dot 1s infinite; }
.jobs .dot.error { background: var(--alert); }
.jobs .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.jobs .meta { grid-column: 2; color: var(--mute); font-size: 12px; }
.jobs .none { color: var(--dim); font-size: 13px; padding: 4px 0; }
.open { margin-top: 18px; }
.open label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 6px; }
.open .row { display: flex; gap: 6px; }
.open input {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, .4); border: 1px solid var(--edge);
  border-radius: var(--r-ctl); padding: 6px 10px; color: var(--ink); font-size: 13px;
}
.open input:focus { border-color: var(--edge-2); }
.open .warn { margin-top: 8px; }
.keep { color: var(--dim); font-size: 12px; line-height: 1.5; margin: auto 0 0; }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes siren-dot { 0%, 49% { background: var(--cop-blue); } 50%, 100% { background: var(--cop-red); } }

/* ---------- hero ---------- */
.hero { max-width: 1120px; margin-top: 1vh; }
.hero-top { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; align-items: center; }
.hero-cop { width: 150px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cop-red); margin: 0 0 8px; }
.kicker::before { content: "● "; animation: pulse 1.2s infinite; }
.hero h2 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.18; font-weight: 700; margin: 0 0 10px; letter-spacing: -.01em; text-wrap: balance; max-width: 26em; }
.hero-copy > p:last-child { color: var(--mute); font-size: 16px; max-width: 40em; margin: 0; }
.steps { list-style: none; margin: 28px 0 26px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps li {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  background: var(--pane); border: 1px solid var(--edge); border-radius: var(--r-pane); font-size: 14px;
}
.steps b { font-size: 20px; color: var(--tape); font-weight: 700; }
.hero .cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 380px); gap: 36px; align-items: start; }
.hero .demo ul { margin: 18px 0 0; padding: 0; list-style: none; }
.hero .demo li { padding: 9px 0 9px 18px; border-top: 1px solid var(--edge); color: var(--mute); font-size: 14px; position: relative; }
.hero .demo li::before { content: ""; position: absolute; left: 0; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--tape); }
.hero .demo li:last-child { border-bottom: 1px solid var(--edge); }
.hero .demo { position: relative; }
.hero .demo .cap { text-align: center; color: var(--dim); font-size: 12px; margin-top: 8px; }
body.dragging .compose .drop, body.dragging .staged { border-color: var(--tape); }

/* ---------- instrument ---------- */
.inst {
  background: var(--pane); border: 1px solid var(--edge); border-radius: var(--r-pane);
  padding: 18px 18px 16px;
}
.inst .read { display: flex; align-items: baseline; gap: 12px; }
.inst .big { font-size: 60px; line-height: 1; font-weight: 600; letter-spacing: -.01em; }
.inst .state { font-size: 15px; color: var(--mute); }
.inst .state.level { color: var(--level); }
.inst .state.head_up { color: var(--rise); }
.inst .state.head_down { color: var(--sink); }
.inst svg { display: block; width: 100%; height: auto; margin: 8px auto 4px; max-width: 300px; }
.inst dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 8px 0 0; font-size: 14px; }
.inst dt { color: var(--mute); }
.inst dd { margin: 0; text-align: right; font-size: 19px; line-height: 1.3; }

/* ---------- result head ---------- */
.head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.head .case {
  font-size: 12px; font-weight: 700; color: #111; background: var(--tape);
  padding: 3px 9px; border-radius: 4px; border: 1.5px solid #111; white-space: nowrap;
}
.head h2 { font-size: 20px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.head .grow { flex: 1; }
.head label { color: var(--mute); font-size: 14px; }
.head select { background: rgba(0, 0, 0, .4); border: 1px solid var(--edge); border-radius: var(--r-ctl); padding: 5px 10px; margin-left: 6px; }

/* ---------- bodycam ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 20px; align-items: start; }
.cam { position: relative; border-radius: var(--r-pane); overflow: hidden; background: #000; border: 1px solid var(--edge); }
.stage video, .stage img { width: 100%; max-height: 64vh; background: #000; display: block; object-fit: contain; }
.hud { position: absolute; inset: 0; pointer-events: none; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.hud-rec { position: absolute; top: 14px; left: 18px; display: flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .1em; }
.hud-rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--cop-red); box-shadow: 0 0 8px var(--cop-red); animation: pulse 1.1s infinite; }
.hud-unit { position: absolute; top: 34px; left: 18px; opacity: .75; font-size: 11px; }
.hud-time { position: absolute; top: 14px; right: 18px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.corner { position: absolute; width: 22px; height: 22px; border-color: rgba(255, 255, 255, .7); border-style: solid; border-width: 0; }
.corner.tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }
.cam:has(video) .corner.bl, .cam:has(video) .corner.br { bottom: 52px; }

/* ---------- the ticket ---------- */
.ticket { margin-top: 28px; max-width: 920px; }
.tk-paper {
  position: relative; background: var(--paper); color: var(--paper-ink);
  border-radius: 6px; padding: 0 26px 22px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .3);
  background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px);
  background-size: 6px 6px;
}
/* perforated top edge */
.tk-paper::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background: radial-gradient(circle at 6px 0, var(--deep) 4px, transparent 4.5px) 0 0 / 12px 8px repeat-x;
}
.tk-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin: 0 -26px 16px; padding: 22px 26px 12px; border-bottom: 3px double var(--paper-ink);
}
.tk-brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tk-logo { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--cop-blue); text-shadow: 2px 2px 0 var(--paper-ink); }
.tk-title { font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.tk-no { font-size: 13px; color: var(--paper-mute); }
.tk-no b { color: var(--cop-red); font-size: 16px; }
.tk-fields { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr; gap: 4px 12px; margin: 0 0 6px; font-size: 13px; align-items: baseline; }
.tk-fields dt { color: var(--paper-mute); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.tk-fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; border-bottom: 1px dotted var(--paper-edge); }
.tk-sec { border-top: 1px dashed var(--paper-edge); padding-top: 12px; margin-top: 12px; }
.tk-sec h5 { margin: 0 0 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-mute); }
.ticket h4 { margin: 2px 0 6px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.ticket[data-cause="good_trim"] h4 { color: #13834f; }
.ticket p { margin: 0 0 8px; line-height: 1.6; }
.ticket .coach-fix { counter-reset: order; }
.ticket .coach-fix span { display: block; position: relative; padding-left: 28px; }
.ticket .coach-fix span + span { margin-top: 8px; }
.ticket .coach-fix span::before {
  counter-increment: order; content: counter(order); position: absolute; left: 0; top: 2px;
  width: 19px; height: 19px; border-radius: 50%; background: var(--paper-ink); color: var(--paper);
  font: 700 11px/19px var(--mono); text-align: center;
}
.ticket .card { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; margin: 0; font-size: 14px; }
.ticket .card dt { color: var(--paper-mute); padding: 5px 0; border-top: 1px solid var(--paper-edge); }
.ticket .card dt:first-of-type, .ticket .card dt:first-of-type + dd { border-top: 0; }
.ticket .card dd { margin: 0; padding: 5px 0 5px 22px; border-top: 1px solid var(--paper-edge); position: relative; font-weight: 600; }
.ticket .card dd::before {
  position: absolute; left: 0; top: 7px; width: 15px; height: 15px; border-radius: 3px;
  font: 700 11px/15px var(--mono); text-align: center; color: #fff;
}
.ticket .card dd.lv0::before { content: "✓"; background: #13834f; }
.ticket .card dd.lv1::before { content: "!"; background: #d99a00; }
.ticket .card dd.lv2::before { content: "✕"; background: var(--cop-red); }
.ticket .coach-root { color: var(--paper-mute); font-size: 13px; margin: 8px 0 0; }
.tk-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; gap: 18px; align-items: end; margin-top: 16px; border-top: 1px dashed var(--paper-edge); padding-top: 12px; }
.tk-sign { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; }
.tk-sign .sig { font-family: var(--hand); font-size: 32px; line-height: 1; color: var(--cop-blue); grid-row: span 3; transform: rotate(-6deg); padding: 0 6px; }
.tk-officer { font-size: 12px; color: var(--paper-mute); }
.ticket .conf { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; max-width: 220px; border: 1px solid var(--paper-edge); }
.ticket .conf i { display: block; height: 100%; background: var(--cop-blue); transition: width .4s; }
.ticket .coach-conf { color: var(--paper-mute); font-size: 12px; margin: 2px 0 0; }
.barcode { display: flex; align-items: stretch; height: 34px; gap: 2px; }
.barcode i { display: block; background: var(--paper-ink); }
.tk-cop { width: 72px; }
.ticket .tk-alt { color: var(--paper-mute); font-size: 12px; margin: 10px 0 0; line-height: 1.5; }
.stamp {
  position: absolute; top: 150px; right: 34px; transform: rotate(-12deg);
  font-family: var(--display); font-size: 26px; line-height: 1.05; text-align: center;
  padding: 8px 14px; border: 4px solid currentColor; border-radius: 10px;
  color: var(--cop-red); opacity: .82; mix-blend-mode: multiply; pointer-events: none;
  box-shadow: inset 0 0 0 2px currentColor;
}
.stamp small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; }
.stamp.ok { color: #13834f; }
.tk-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.tk-actions .primary { width: auto; }

/* ---------- evidence ---------- */
.sec-title { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--edge); }
.sec-kicker { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px; }
.chart { margin-top: 18px; }
.chart .row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chart .row b { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.chart .row b i { width: 10px; height: 3px; border-radius: 2px; background: currentColor; }
.chart .row span { color: var(--mute); font-size: 13px; }
.chart .row .live { margin-left: auto; font-size: 24px; color: var(--ink); }
.chart canvas { display: block; width: 100%; height: 132px; cursor: crosshair; touch-action: none; }

.report { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; }
.report h3 { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 0 0 16px; letter-spacing: -.01em; text-wrap: balance; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--pane-2); gap: 2px; }
.split i { display: block; height: 100%; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--mute); margin: 10px 0 20px; }
.legend b { color: var(--ink); font-weight: 500; font-size: 18px; margin-left: 2px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.notes { margin: 0; padding: 0; list-style: none; }
.notes li { margin: 0; padding: 10px 0 10px 18px; border-top: 1px solid var(--edge); position: relative; }
.notes li::before { content: ""; position: absolute; left: 0; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--rise); }
.notes li.ok::before { background: var(--level); }
.fine { color: var(--dim); font-size: 13px; margin-top: 16px; line-height: 1.5; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; margin: 0; align-self: start; }
.stats dt { color: var(--mute); padding: 9px 0; border-top: 1px solid var(--edge); }
.stats dd { margin: 0; text-align: right; font-size: 20px; padding: 7px 0; border-top: 1px solid var(--edge); }

details { margin-top: 36px; border-top: 1px solid var(--edge); padding-top: 14px; }
summary { cursor: pointer; color: var(--mute); list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); transform: rotate(-45deg); transition: transform .15s; }
details[open] summary::before { transform: rotate(45deg); }
summary:hover { color: var(--ink); }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 22px; margin: 16px 0; }
.params label { display: grid; gap: 4px; font-size: 13px; color: var(--mute); }
.params input { background: rgba(0, 0, 0, .4); border: 1px solid var(--edge); border-radius: var(--r-ctl); padding: 7px 10px; color: var(--ink); width: 100%; }

/* ---------- status (gathering evidence) ---------- */
.status { margin-top: 8vh; max-width: 40em; }
.status-cop { width: 120px; }
.siren { display: flex; gap: 6px; margin: 14px 0 18px; }
.siren i { width: 54px; height: 10px; border-radius: 5px; animation: siren-a .8s infinite; }
.siren i:last-child { animation-name: siren-b; }
@keyframes siren-a { 0%, 49% { background: var(--cop-red); box-shadow: 0 0 18px var(--cop-red); } 50%, 100% { background: #3a1015; box-shadow: none; } }
@keyframes siren-b { 0%, 49% { background: #0f1f40; box-shadow: none; } 50%, 100% { background: var(--cop-blue); box-shadow: 0 0 18px var(--cop-blue); } }
.status h2 { font-size: 24px; margin: 0 0 8px; overflow-wrap: anywhere; }
.status p { color: var(--mute); margin: 0 0 18px; }
.status .err { color: var(--alert); overflow-wrap: anywhere; }
.status .spin { display: none; }

@media (min-width: 1101px) {
  #result.compact {
    display: grid; grid-template-columns: minmax(0, 1fr) 196px minmax(0, 1fr);
    grid-template-areas: "head head head" "media inst charts" "ticket ticket ticket" "report report report" "params params params";
    gap: 0 16px; align-items: stretch;
  }
  .compact .head { grid-area: head; margin-bottom: 10px; }
  body.compact-on main { padding: 18px 32px 24px; }
  .compact .stage { display: contents; }
  .compact .cam { grid-area: media; align-self: start; }
  .compact .stage video, .compact .stage img { max-height: none; }
  .compact .hud-unit { display: none; }
  .compact .inst { grid-area: inst; padding: 10px 12px 10px; align-self: start; }
  .compact .inst .big { font-size: 34px; }
  .compact .inst .state { font-size: 12px; }
  .compact .inst svg { margin: 0 auto; max-width: 168px; }
  .compact .inst dl { font-size: 12px; gap: 0 8px; margin-top: 2px; }
  .compact .inst dd { font-size: 14px; }
  .compact .sec-title { display: none; }
  .compact #charts { grid-area: charts; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
  .compact .chart { flex: 1; display: flex; flex-direction: column; margin: 0; min-height: 0; }
  .compact .chart .row b { font-size: 14px; }
  .compact .chart .row span:not(.live) { display: none; }
  .compact .chart .row .live { font-size: 18px; }
  .compact .chart canvas { flex: 1 1 0; height: 0; min-height: 72px; }
  .compact .ticket { grid-area: ticket; margin-top: 16px; max-width: none; }
  .compact .tk-paper { padding: 0 20px 14px; }
  .compact .tk-head { margin: 0 -20px 10px; padding: 16px 20px 8px; }
  .compact .tk-logo { font-size: 22px; }
  .compact .ticket h4 { font-size: 17px; }
  .compact .ticket p, .compact .ticket .card { font-size: 13px; line-height: 1.45; }
  .compact .tk-sec { padding-top: 8px; margin-top: 8px; }
  .compact .stamp { font-size: 20px; top: 110px; }
  .compact .report { grid-area: report; margin-top: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
  .compact .report h3 { font-size: 19px; margin-bottom: 8px; }
  .compact .split { height: 8px; }
  .compact .legend { margin: 6px 0 6px; font-size: 12px; gap: 14px; }
  .compact .legend b { font-size: 14px; }
  .compact .notes li { padding: 5px 0 5px 16px; font-size: 13px; line-height: 1.45; }
  .compact .notes li::before { top: 11px; width: 7px; height: 7px; }
  .compact .fine { margin-top: 6px; font-size: 12px; }
  .compact .stats dt { padding: 5px 0; font-size: 13px; }
  .compact .stats dd { padding: 4px 0; font-size: 15px; }
  .compact details { grid-area: params; margin-top: 12px; padding-top: 8px; font-size: 13px; }
}
@media (max-width: 1100px) {
  #compactBtn { display: none; }
  .stage { grid-template-columns: 1fr; }
  .inst { max-width: 420px; }
}
@media (max-width: 900px) {
  .top { padding: 10px 16px; }
  .brand .tag { display: none; }
  .app { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--edge); padding: 18px 16px; }
  main { padding: 20px 16px 48px; }
  .hero { margin-top: 4px; }
  .hero-top { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
  .hero-cop { width: 84px; }
  .steps { grid-template-columns: 1fr; }
  .hero .cols { grid-template-columns: 1fr; gap: 24px; }
  .hero .demo { max-width: 360px; }
  .top .new { padding: 6px 12px; font-size: 14px; }
  .report { grid-template-columns: 1fr; gap: 24px; }
  .jobs { max-height: 32vh; overflow: auto; }
  .keep { margin-top: 0; }
  .tk-paper { padding: 0 16px 18px; }
  .tk-head { margin: 0 -16px 14px; padding: 20px 16px 10px; }
  .tk-fields { grid-template-columns: auto 1fr; }
  .tk-foot { grid-template-columns: minmax(0, 1fr) 60px; }
  .barcode { display: none; }
  .tk-cop { width: 60px; }
  .stamp { top: auto; bottom: 120px; right: 14px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .jobs .dot.busy, .status .spin, .hud-rec i, .kicker::before, .cop .bub, .siren i { animation: none; }
  * { transition: none !important; }
}
