/* Mirage Visual — graphite + evidence-marker amber */
:root {
  --bg: #f2f1ed;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #efede7;
  --line: #e2dfd6;
  --line-strong: #cfcbc0;
  --text: #191814;
  --muted: #646056;
  --faint: #9a958a;
  --accent: #f5b301;
  --accent-ink: #1b1600;
  --accent-soft: rgba(245, 179, 1, 0.14);
  --accent-line: rgba(196, 140, 0, 0.55);
  --ink: #191814;
  --ink-text: #fbfaf7;
  --good: #15803d;
  --good-soft: rgba(21, 128, 61, 0.1);
  --mid: #a16207;
  --mid-soft: rgba(202, 138, 4, 0.13);
  --low: #78716c;
  --low-soft: rgba(120, 113, 108, 0.12);
  --danger: #c2410c;
  --stage: #e7e5de;
  --shadow: 0 1px 2px rgba(25, 24, 20, 0.05), 0 8px 24px -12px rgba(25, 24, 20, 0.12);
  --radius: 14px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0c;
    --surface: #161613;
    --surface-2: #1c1c19;
    --surface-3: #23231f;
    --line: #2a2a25;
    --line-strong: #3a3a33;
    --text: #edece6;
    --muted: #a19e93;
    --faint: #6f6c63;
    --accent: #fbbf24;
    --accent-ink: #1b1600;
    --accent-soft: rgba(251, 191, 36, 0.12);
    --accent-line: rgba(251, 191, 36, 0.5);
    --ink: #edece6;
    --ink-text: #121210;
    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, 0.12);
    --mid: #fbbf24;
    --mid-soft: rgba(251, 191, 36, 0.12);
    --low: #a8a29e;
    --low-soft: rgba(168, 162, 158, 0.12);
    --danger: #fb923c;
    --stage: #090908;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0c; --surface: #161613; --surface-2: #1c1c19; --surface-3: #23231f; --line: #2a2a25;
  --line-strong: #3a3a33; --text: #edece6; --muted: #a19e93; --faint: #6f6c63; --accent: #fbbf24;
  --accent-ink: #1b1600; --accent-soft: rgba(251, 191, 36, 0.12); --accent-line: rgba(251, 191, 36, 0.5);
  --ink: #edece6; --ink-text: #121210; --good: #4ade80; --good-soft: rgba(74, 222, 128, 0.12);
  --mid: #fbbf24; --mid-soft: rgba(251, 191, 36, 0.12); --low: #a8a29e; --low-soft: rgba(168, 162, 158, 0.12);
  --danger: #fb923c; --stage: #090908; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; max-width: 1480px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand .brand-cut { fill: var(--bg); }
.brand strong { display: block; font-size: 16px; letter-spacing: -0.015em; }
.brand small { display: block; color: var(--muted); font-size: 12.5px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  white-space: nowrap; max-width: 52vw; overflow: hidden; text-overflow: ellipsis;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status[data-state="loading"] .dot { background: var(--accent); animation: pulse 1.1s infinite; }
.status[data-state="ready"] .dot { background: var(--good); }
.status[data-state="error"] .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.25; } }
.gh {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
}
.gh:hover { color: var(--text); border-color: var(--line-strong); }
.gh svg { width: 18px; height: 18px; }

/* ---------- Layout ---------- */
.app {
  flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 24px 20px;
  display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 420px; align-items: start;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side > .card:not(.settings) { padding: 16px; }
.eyebrow {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
}
h3 { margin: 0; }

/* ---------- Stage ---------- */
.stage { position: sticky; top: 16px; display: flex; flex-direction: column; overflow: hidden; }
.stage-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.layers { display: flex; gap: 6px; flex-wrap: wrap; }
.layers label { cursor: pointer; }
.layers input { position: absolute; opacity: 0; pointer-events: none; }
.layers span {
  display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 999px; color: var(--faint);
  border: 1px solid var(--line); background: var(--surface-2); user-select: none;
}
.layers input:checked + span { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.layers input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

.canvas-wrap {
  position: relative; height: min(66vh, 720px); min-height: 360px; background: var(--stage); overflow: hidden;
  background-image:
    linear-gradient(45deg, rgba(127,127,127,.06) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.06) 75%),
    linear-gradient(45deg, rgba(127,127,127,.06) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.06) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
canvas { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; display: block; }
.empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center;
  gap: 6px; padding: 24px; background: var(--stage);
}
.empty-mark { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 6px; }
.empty-mark svg { width: 34px; height: 34px; }
.empty-title { margin: 0; font-size: 17px; font-weight: 600; }
.empty-sub { margin: 0 0 10px; color: var(--muted); max-width: 320px; }
.busy {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 8, 0.28);
}
.busy span {
  background: rgba(14, 14, 12, 0.82); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  display: inline-flex; gap: 8px; align-items: center;
}
.busy span::before { content: ""; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fbbf24; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan {
  position: absolute; left: 0; right: 0; height: 2px; top: 0; background: #fbbf24;
  box-shadow: 0 0 22px 5px rgba(251, 191, 36, .45); animation: scan 1.8s ease-in-out infinite;
}
@keyframes scan { 0% { top: 0 } 50% { top: calc(100% - 2px) } 100% { top: 0 } }
.dropping {
  position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); font-weight: 600; color: var(--text); pointer-events: none;
}

.strip { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); overflow-x: auto; }
.upload {
  flex: none; width: 64px; height: 64px; border-radius: 10px; border: 1.5px dashed var(--line-strong); cursor: pointer;
  display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px;
}
.upload:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.upload svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.samples { display: flex; gap: 8px; }
.samples button {
  flex: none; width: 64px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-2); outline-offset: 1px;
}
.samples button.active { border-color: var(--accent); }
.samples img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Tasks ---------- */
.task-group + .task-group { margin-top: 14px; }
.task-group h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; margin-bottom: 8px;
}
.tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task {
  display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; align-items: center; text-align: left;
  padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.task:hover { border-color: var(--line-strong); }
.task .ic {
  grid-row: span 2; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.task .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.task small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.task[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.task[aria-pressed="true"] .ic { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 14px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.results-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.results-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.results-sub:empty { display: none; }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; flex: none; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.view { display: flex; flex-direction: column; gap: 18px; }
.placeholder { color: var(--faint); margin: 0; }
.section-title {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
}
.section-title .count { font-family: var(--mono); color: var(--faint); font-weight: 500; letter-spacing: 0; }

/* Answer cards */
.answer {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2);
}
.answer .q { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.answer .a { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-transform: capitalize; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.answer .a.none { color: var(--muted); font-size: 18px; }
.answer .note { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.checklist li { border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist details > summary {
  list-style: none; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
}
.checklist details > summary::-webkit-details-marker { display: none; }
.checklist details > summary:hover { background: var(--surface-2); }
.checklist .fname { color: var(--muted); font-size: 13px; }
.checklist .fval { font-weight: 600; text-align: right; text-transform: capitalize; }
.checklist .fval.none { color: var(--faint); font-weight: 500; }
.checklist .fval .lean-tag { font-weight: 500; color: var(--muted); }
.checklist .probs { padding: 2px 12px 12px; display: grid; gap: 5px; }

.badge {
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap; font-family: var(--sans);
}
.badge.high { color: var(--good); background: var(--good-soft); }
.badge.mid { color: var(--mid); background: var(--mid-soft); }
.badge.low { color: var(--low); background: var(--low-soft); }
.badge.fail { color: var(--danger); background: rgba(194, 65, 12, 0.12); }
.checklist.std details > summary { grid-template-columns: 1fr auto; gap: 2px 10px; }
.checklist.std .sname { font-weight: 600; font-size: 13px; }
.checklist.std .sdetail { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.rule { font-size: 12.5px; color: var(--muted); }
.rule .src { display: inline-block; margin-left: 6px; font-size: 10.5px; font-family: var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }

.prob { display: grid; grid-template-columns: 92px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; }
.prob span:first-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prob .track { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.prob .track i { display: block; height: 100%; background: var(--line-strong); border-radius: 3px; }
.prob.top .track i { background: var(--accent); }
.prob .pct { font-family: var(--mono); text-align: right; color: var(--muted); font-size: 11.5px; }

.notice {
  margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; color: var(--text);
  background: var(--mid-soft); border: 1px solid var(--accent-line); display: flex; gap: 10px;
}
.notice::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; }

/* Describe output */
.kv { display: flex; flex-wrap: wrap; gap: 6px; }
.kv span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; }
.kv b { color: var(--muted); font-weight: 500; margin-right: 5px; }
.list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.obj {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 4px 10px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
}
.obj:hover, .obj.hot { background: var(--surface-2); border-color: var(--line); }
.obj .sw { width: 10px; height: 10px; border-radius: 3px; }
.obj .name { font-weight: 600; text-transform: capitalize; }
.obj .attrs { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.obj .attrs span { font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.score { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ocr {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 9px; background: var(--surface-2); border-left: 3px solid #ffcd00;
}
.ocr q { font-family: var(--mono); font-size: 13px; quotes: none; word-break: break-word; }
.ocr.plate { background: var(--accent-soft); border-left-color: var(--accent); }
.ocr.plate q { font-size: 16px; font-weight: 600; letter-spacing: 0.06em; }
.ocr .tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mid); margin-right: 8px; }
.rel { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; }
.rel .pred { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.tagc { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-transform: capitalize; }
.tagc i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.reason { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.raw { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-word; }

/* Custom builder */
.custom { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.custom-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.custom-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.custom-head select { width: auto; flex: none; font-size: 12px; padding: 5px 8px; }
#fields { display: grid; gap: 8px; }
.form-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: var(--surface-2); }
.form-field .top-row { display: grid; grid-template-columns: 1fr 100px 30px; gap: 6px; }
.form-field .range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.custom-actions { display: flex; gap: 8px; }
.json-edit summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.json-edit textarea { margin-top: 8px; }

/* Controls */
select, input[type="text"], input[type="number"], textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; color: var(--text);
}
textarea { font-family: var(--mono); font-size: 12px; resize: vertical; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 14px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent; font-size: 13.5px;
}
.btn.primary { background: var(--ink); color: var(--ink-text); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 500; }
.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.run { width: 100%; padding: 12px; }
.run kbd { font-family: var(--mono); font-size: 11px; opacity: 0.55; }
.run:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

/* Settings */
.settings summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary span { font-weight: 600; font-size: 13px; }
.settings summary span::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--faint); transition: transform .15s; }
.settings[open] summary span::before { transform: rotate(90deg); }
.settings summary small { color: var(--faint); font-size: 12px; }
.settings-body { padding: 0 16px 16px; display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
  cursor: pointer; font-size: 12px; color: var(--muted);
}
.chip[aria-pressed="true"] { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.slider output { font-family: var(--mono); color: var(--text); }
.slider input { grid-column: 1 / -1; accent-color: var(--accent); width: 100%; margin: 0; }
.slider-ends { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.check input { accent-color: var(--accent); }
.hint { margin: 0; font-size: 12px; color: var(--faint); }

.json-bar { display: flex; flex-direction: column; gap: 8px; }
.json-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.json-size { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.json-opts { display: flex; gap: 6px 16px; flex-wrap: wrap; }
pre#json {
  margin: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  max-height: 60vh; overflow: auto;
}

/* Footer & toast */
.foot {
  max-width: 1480px; width: 100%; margin: 0 auto; padding: 8px 24px 24px; display: flex; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap; color: var(--faint); font-size: 12px;
}
.foot a { color: var(--muted); }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--ink-text);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 10; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr) 360px; }
  .tasks { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .top-right { width: 100%; justify-content: space-between; }
  .status { max-width: calc(100vw - 90px); }
  .app { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .stage { position: static; }
  .canvas-wrap { height: 56vh; min-height: 280px; }
  .tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { padding: 8px 16px 20px; }
}
@media (max-width: 420px) {
  .tasks { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
