:root {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --ink: #1b1d1f;
  --muted: #5d636a;
  --line: #dedad0;
  --accent: #0f6b62;
  --accent-ink: #ffffff;
  --warn: #a15c07;
  --bad: #b42318;
  --zone-a: #2f7d32;
  --zone-b: #6a8f1f;
  --zone-c: #c27c0e;
  --zone-d: #b42318;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --fast: 120ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
h3 { font-size: 14px; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { width: 38px; height: 38px; border-radius: 9px; background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 7px), var(--ink); }
.tagline { margin: 2px 0 0; color: var(--muted); }
.chips { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.25fr); gap: 18px; padding: 20px 28px; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.drop:hover, .drop:focus-within, .drop.over { border-color: var(--accent); background: #f0f7f6; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop strong { display: block; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 13px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, button { font: inherit; }
input, select { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--ink); }
button { border: 0; border-radius: 7px; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease); }
button:hover { opacity: .92; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.warn { background: var(--bad); }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.samples { display: grid; gap: 8px; }
.sample { text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 9px 11px; }
.sample b { display: block; font-size: 14px; }
.sample span { font-size: 12.5px; color: var(--muted); }
.sample:hover { border-color: var(--accent); }
.clips { padding-left: 18px; margin: 4px 0 12px; font-size: 13px; }
.status { border-radius: var(--radius); padding: 14px; margin-bottom: 14px; border: 1px solid var(--line); background: #faf9f6; }
.status.busy { border-color: var(--accent); }
.status.ask { border-color: var(--warn); background: #fff8ec; }
.status.done { border-color: var(--zone-a); background: #f2f8f1; }
.status.error { border-color: var(--bad); background: #fdf1f0; }
.status h3 { margin: 0 0 6px; font-size: 15px; }
.status .reason { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.status form, .status .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 620px; overflow: auto; }
.timeline li { border-left: 3px solid var(--line); padding: 6px 10px; background: #fcfbf8; border-radius: 0 7px 7px 0; font-size: 13px; animation: fadein 240ms var(--ease) both; }
.timeline li.decision { border-left-color: var(--accent); }
.timeline li.decision.Recapture, .timeline li.decision.AskHuman { border-left-color: var(--warn); }
.timeline li.human { border-left-color: #6b4fbb; }
.timeline li.capture { border-left-color: var(--ink); }
.timeline .what { font-weight: 600; }
.timeline .why { color: var(--muted); }
.timeline details { margin-top: 4px; }
.timeline summary { cursor: pointer; color: var(--muted); }
.timeline pre { font: 11.5px/1.4 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; max-height: 180px; overflow: auto; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.headline { font-size: 18px; margin: 0 0 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font: 600 20px/1.2 var(--mono); }
.zones { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); height: 28px; margin: 6px 0 28px; }
.zones .za { border-radius: 6px 0 0 6px; } .zones .zd { border-radius: 0 6px 6px 0; }
.zones div { display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.zones .za { background: var(--zone-a); } .zones .zb { background: var(--zone-b); } .zones .zc { background: var(--zone-c); } .zones .zd { background: var(--zone-d); }
.zones .pin { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); border-radius: 2px; }
.zones .pinlabel { position: absolute; top: 30px; transform: translateX(-50%); font: 12px var(--mono); white-space: nowrap; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.fig { border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-width: 0; }
.fig h4 { margin: 0 0 8px; font-size: 13px; }
.fig img, .fig canvas { width: 100%; height: auto; display: block; border-radius: 4px; background: #111; }
.fig canvas.chart { background: #fff; }
.fig .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.caveats { font-size: 13px; color: var(--muted); padding-left: 18px; }
.ticket { border: 1px solid var(--bad); border-radius: 8px; padding: 12px; margin: 12px 0; background: #fff6f5; }
.ticket h4 { margin: 0 0 6px; }
.foot { max-width: 1400px; margin: 0 auto; padding: 4px 28px 30px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 14px; }
  .top { padding: 16px; }
  .settings { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
