:root { --ink:#1d2327; --muted:#5b6670; --line:#d6dadd; --bg:#f6f5f1; --card:#fff; --accent:#0f5f57; --s2:#0f766e; --ls:#b45309; --lf:#c0392b; --l12:#7c3aed; }
* { box-sizing:border-box; }
body { margin:0; font:16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); }
.bar { display:flex; gap:12px; align-items:center; padding:10px 16px; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:2; }
.progress { color:var(--muted); font-size:14px; margin-left:auto; }
main { max-width:1200px; margin:0 auto; padding:16px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:20px; max-width:760px; margin:0 auto; }
h1 { font-size:24px; margin:0 0 12px; } h2 { font-size:18px; margin:20px 0 6px; }
button { font:inherit; padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--ink); cursor:pointer; min-height:40px; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); padding:10px 18px; }
button:disabled { opacity:.45; cursor:default; }
.code { font-weight:600; }
.hint { color:var(--muted); font-size:14px; margin:6px 0; }
#screen-label { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; }
#screen-label[hidden] { display:none; }
.toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:8px; }
.stage { font-weight:600; margin-right:auto; }
.chips { display:grid; grid-template-columns:repeat(6, minmax(0,1fr)); gap:8px; }
.chips.full { grid-template-columns:repeat(7, minmax(0,1fr)); }
.chip { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:4px; font-size:12px; line-height:1.3; }
.chip canvas { width:100%; height:auto; image-rendering:pixelated; display:block; cursor:zoom-in; }
.chip.post { border-color:var(--lf); }
.chip.missing canvas { background:repeating-linear-gradient(45deg,#eee 0 6px,#f8f8f8 6px 12px); aspect-ratio:1; }
.plots svg { width:100%; height:auto; display:block; background:var(--card); border:1px solid var(--line); border-radius:6px; margin-top:8px; }
.plot-bg { fill:#fbfbfa; } .grid { stroke:#e3e5e6; stroke-width:1; } .tick { font-size:10px; fill:var(--muted); } .ptitle { font-size:11px; fill:var(--ink); }
.marker { stroke-width:1.5; stroke-dasharray:4 3; } .marker.lf { stroke:var(--lf); } .marker.l12 { stroke:var(--l12); } .clip { stroke-width:1; }
.legend i { display:inline-block; vertical-align:middle; margin:0 4px 0 10px; }
.legend i:first-child { margin-left:0; }
.dot { width:8px; height:8px; border-radius:50%; } .dot.s2 { background:var(--s2); }
.sq { width:8px; height:8px; border:1.5px solid var(--ls); } .ln { width:16px; border-top:2px dashed; } .ln.lf { border-color:var(--lf); } .ln.l12 { border-color:var(--l12); }
.form { position:sticky; top:64px; align-self:start; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px; }
.labels { display:grid; gap:6px; margin-bottom:10px; }
.labels button { text-align:left; display:grid; grid-template-columns:28px 1fr; gap:6px; align-items:start; }
.labels button b { font-size:18px; } .labels button small { display:block; color:var(--muted); font-size:13px; }
.labels button[aria-checked="true"] { border-color:var(--accent); box-shadow:inset 0 0 0 2px var(--accent); background:#eef6f4; }
#save { width:100%; }
.feedback { margin-top:10px; padding:10px; border-radius:6px; background:#f3f1ea; }
.feedback.right { background:#e8f3ec; } .feedback.wrong { background:#f8ebe7; }
dialog { border:1px solid var(--line); border-radius:8px; padding:12px; max-width:min(680px, 96vw); }
dialog canvas { width:100%; height:auto; image-rendering:pixelated; }
.dlg-head, .dlg-nav { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
#guide-copy, #guide { font-size:15px; } #guide-copy img, #guide img { max-width:100%; }
@media (max-width: 820px) {
  main { padding:12px; }
  #screen-label { grid-template-columns:1fr; }
  .chips, .chips.full { grid-template-columns:repeat(3, minmax(0,1fr)); }
  .form { position:static; }
  .card { padding:16px; }
}
