/* Screenshot Markup - paper page, dark workbench around the image, one teal-ink primary. */
:root {
  --bg: #f3f2ee; --surface: #ffffff; --ink: #1b1d22; --muted: #596170; --line: #d8dad4; --soft: #ebece7;
  --accent: #0f5c63; --accent-hi: #0b4a50; --accent-ink: #ffffff; --focus: #e8590c;
  --bench: #23272e; --bench-2: #2d323a; --bench-line: #3b414b; --bench-ink: #e6e8eb; --bench-muted: #a9b0bb;
  --bad: #b42318; --good: #1d7a46; --warn-bg: #fff4e5; --warn-line: #f0c27b;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 6px 20px rgba(20, 24, 30, .06);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #121417; --surface: #1a1d22; --ink: #e8e9eb; --muted: #a2a9b4; --line: #2d323a; --soft: #22262c;
  --accent: #56b8be; --accent-hi: #74cbd0; --accent-ink: #06191b; --focus: #ffa94d;
  --bench: #0b0d10; --bench-2: #16191e; --bench-line: #2b3038; --bench-ink: #e6e8eb; --bench-muted: #9aa2ad;
  --bad: #ff8b7b; --good: #6fd39a; --warn-bg: #2a2114; --warn-line: #7a5a26;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bad { color: var(--bad); }
.strong { font-weight: 700; }
kbd { font: 12px ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

/* header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { font-size: 17px; white-space: nowrap; }
.logo { color: var(--ink); flex: none; }
.topactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.backlink { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 4px; }
.backlink:hover { color: var(--ink); }
.credits { font-size: 14px; color: var(--muted); }
.topup { font-size: 14px; }
.sep { color: var(--muted); }

/* buttons */
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.primary:hover:not(:disabled) { background: var(--accent-hi); }
.primary.big { width: 100%; min-height: 50px; }
.ghost { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.ghost:hover:not(:disabled) { border-color: var(--muted); }
.ghost.sq { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.ghost.small { font-size: 14px; }
.ghost.strong { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.quiet { min-height: 40px; padding: 6px 8px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.quiet:hover { color: var(--ink); }
.quiet.small { font-size: 14px; }
.linkbtn { border: 0; background: none; padding: 6px 0; min-height: 40px; color: var(--accent); text-align: left; text-decoration: underline; text-underline-offset: 3px; }

main { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }

/* first screen */
.hero { max-width: 760px; margin: 0 auto; padding: 28px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4.6vw, 38px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.01em; }
.lede { margin: 0 auto 12px; max-width: 620px; color: var(--muted); }
.perks { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0 0 16px; }
.perks li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px 18px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.drop.over { border-color: var(--accent); background: var(--soft); }
.dropicon { color: var(--muted); }
.droptext { margin: 0; font-weight: 600; }
.drop p.small { margin: 2px 0 0; }
.examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.chipbtn { min-height: 40px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
.chipbtn:hover { border-color: var(--accent); }
.chipbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.msg { margin: 10px auto 0; max-width: 640px; font-size: 15px; }
.msg.bad { color: var(--bad); font-weight: 600; }

/* the editor */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; margin-top: 22px; align-items: start; scroll-margin-top: 10px; }
.bench { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto auto; background: var(--bench); color: var(--bench-ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.toolbar { grid-row: 1 / span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 10px 8px; background: var(--bench-2); border-right: 1px solid var(--bench-line); }
.tools { display: flex; flex-direction: column; gap: 6px; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--bench-muted); font-size: 12px; }
.tool:hover:not(:disabled) { color: var(--bench-ink); background: var(--bench-line); }
.tool[aria-pressed="true"] { color: #fff; background: #3d4550; border-color: #5b6573; }
[data-theme="dark"] .tool[aria-pressed="true"] { background: #2a3038; }
.tool:disabled { opacity: .35; }
.stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 280px; padding: 18px; overflow: hidden;
  background-color: #2a2e35; background-image: linear-gradient(45deg, #30353d 25%, transparent 25%), linear-gradient(-45deg, #30353d 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #30353d 75%), linear-gradient(-45deg, transparent 75%, #30353d 75%);
  background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; }
[data-theme="dark"] .stage { background-color: #14171b; background-image: linear-gradient(45deg, #1a1e23 25%, transparent 25%), linear-gradient(-45deg, #1a1e23 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1a1e23 75%), linear-gradient(-45deg, transparent 75%, #1a1e23 75%); }
.canvas { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; border-radius: 4px; box-shadow: 0 2px 16px rgba(0, 0, 0, .45); cursor: crosshair; touch-action: manipulation; }
.canvas.draggable { touch-action: none; }
.stage.tall .canvas { max-height: 80vh; }
.headline { margin: 0; padding: 10px 16px 12px; font-size: 14px; color: var(--bench-ink); border-top: 1px solid var(--bench-line); }

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.exportbox, .opts, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.exp-grid .ghost { font-size: 14px; }
#exportMsg { margin: 8px 0 0; min-height: 1em; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.field select, .field input[type="text"], .field textarea, textarea.note { font: inherit; font-weight: 400; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; }
.field textarea, textarea.note { resize: vertical; line-height: 1.4; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.swatches { display: flex; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch[data-color="red"] { background: #e03131; }
.swatch[data-color="violet"] { background: #7048e8; }
.swatch[data-color="teal"] { background: #0b7285; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.more summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.more[open] { display: flex; flex-direction: column; gap: 10px; }
.h3 { font-size: 17px; margin: 4px 0 0; }

/* the list of marks */
.marks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mark { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; }
.mark.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.markhead { display: flex; align-items: center; gap: 10px; }
.markhead .quiet { margin-left: auto; }
.mbadge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 13px; border: 0; }
.mkind { font-weight: 600; color: var(--ink); text-decoration: none; }
.facts { margin: 2px 0 6px; color: var(--muted); word-break: break-word; }
.facts.bad { color: var(--bad); }
textarea.note { font-size: 14px; }
#newBtn { align-self: flex-start; }

/* AI step */
.ai summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 40px; font-weight: 700; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0; }
.hint.bad { color: var(--bad); }
.warn-soft { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.ai .field { margin-top: 8px; }
.ai-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.progress { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.progresshead { display: flex; justify-content: space-between; align-items: center; }
.steps { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.steps li.on { color: var(--ink); font-weight: 700; }
.steps li.done { color: var(--good); }
.steps li.done::marker { content: "\2713  "; }
.report { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 15px; }
.report h3 { font-size: 17px; margin: 10px 0 4px; }
.report h4 { font-size: 15px; margin: 14px 0 6px; }
.report p { margin: 6px 0; }
.report ul, .report ol { padding-left: 20px; margin: 6px 0; }
.finding { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.finding.sev-critical { border-left-color: #c92a2a; }
.finding.sev-moderate { border-left-color: #e67700; }
.finding.sev-minor { border-left-color: #2b8a3e; }
.fhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.refbtn { min-height: 32px; cursor: pointer; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.chip.critical { color: #c92a2a; }
.chip.moderate { color: #b35c00; }
.chip.minor { color: var(--good); }
[data-theme="dark"] .chip.critical { color: #ff8787; }
[data-theme="dark"] .chip.moderate { color: #ffc078; }
.ftext { font-weight: 600; }
.flags li { color: var(--bad); }

/* history, about, footer */
.history { margin-top: 22px; }
.historylist { list-style: none; padding: 0; margin: 6px 0 0; }
.about { max-width: 780px; margin: 40px auto 0; }
.about h2 { font-size: 22px; margin: 26px 0 8px; }
.howlist { padding-left: 22px; }
.howlist li { margin: 6px 0; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }
.foot { max-width: 1240px; margin: 0 auto; padding: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* docs pages (api.html, tokens.html) */
.doc { max-width: 900px; padding-top: 20px; }
.doc h1 { font-size: 30px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc pre { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 13px; white-space: pre; }
.codegroup { margin: 8px 0 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tab { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.tab.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.statebox { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.tokenrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tokenbox { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); word-break: break-all; width: 100%; }
.mini { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; }

@media (max-width: 960px) {
  .work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  main { padding: 0 16px 32px; }
  .topbar { padding: 8px 16px; }
  .brand strong { font-size: 15px; }
  .hero { padding-top: 18px; }
  .lede { font-size: 15px; }
  .bench { grid-template-columns: minmax(0, 1fr); border-radius: 12px; }
  .toolbar { grid-row: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--bench-line); padding: 6px; gap: 4px; }
  .tools { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .tool { min-width: 48px; min-height: 48px; font-size: 11px; }
  .stage { padding: 8px; min-height: 200px; }
  .canvas { max-height: 64vh; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
