/* Design tokens, base styles and components of the web app and the share page.
   Palette: pine ink on a cool green-grey paper; the amber "waypoint" is the one accent that carries the idea of the product
   (a guide is a trail of steps). Light and dark are both defined; <html data-theme="light|dark"> forces one, otherwise the system decides.
   The legal pages (legal/legal.css) read the same custom properties. No inline styles anywhere: the CSP forbids them. */
:root {
  --bg: #eff2ee;
  --surface: #fbfcfa;
  --surface-2: #e4e9e3;
  --border: #c9d2c9;
  --text: #17211c;
  --muted: #4f5c54;
  --accent: #17604e;
  --accent-strong: #104a3b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(23, 96, 78, 0.11);
  --waypoint: #c98a2b;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #7a4f00;
  --warn-soft: #fff1cc;
  --ok: #1b6b45;
  --ok-soft: #ddf0e5;
  --focus: #0b5fd1;
  --shadow: 0 1px 2px rgba(23, 33, 28, 0.06), 0 6px 20px rgba(23, 33, 28, 0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512;
    --surface: #161d19;
    --surface-2: #1f2824;
    --border: #2d3a34;
    --text: #e6ede8;
    --muted: #9eaba3;
    --accent: #6fd3b5;
    --accent-strong: #94e4cb;
    --accent-ink: #06201a;
    --accent-soft: rgba(111, 211, 181, 0.14);
    --waypoint: #e3a64a;
    --danger: #ff8a80;
    --danger-soft: #3a1b18;
    --warn: #f2c35b;
    --warn-soft: #3a2e10;
    --ok: #7fd9a5;
    --ok-soft: #16301f;
    --focus: #7db4ff;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1512;
  --surface: #161d19;
  --surface-2: #1f2824;
  --border: #2d3a34;
  --text: #e6ede8;
  --muted: #9eaba3;
  --accent: #6fd3b5;
  --accent-strong: #94e4cb;
  --accent-ink: #06201a;
  --accent-soft: rgba(111, 211, 181, 0.14);
  --waypoint: #e3a64a;
  --danger: #ff8a80;
  --danger-soft: #3a1b18;
  --warn: #f2c35b;
  --warn-soft: #3a2e10;
  --ok: #7fd9a5;
  --ok-soft: #16301f;
  --focus: #7db4ff;
  --shadow: none;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -56px; background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; border-radius: 8px; z-index: 200; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.nowrap { white-space: nowrap; }

/* ---------- shell ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 8px 0 56px; }
.boot, .noscript { color: var(--muted); padding: 40px 0; }
.noscript-reader { padding: 16px 0; }
.noscript-note { color: var(--muted); margin: 0 0 12px; }
.noscript-frame { display: block; width: 100%; height: 80vh; min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }

.topbar { display: flex; align-items: center; gap: 8px 16px; padding: 14px 0 10px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .m1 { fill: var(--accent); }
.brand-mark .m2 { fill: var(--accent); opacity: 0.55; }
.brand-mark .m3 { fill: var(--accent); opacity: 0.28; }
.brand-mark .m4 { fill: var(--waypoint); }
.topnav { display: flex; gap: 2px; order: 3; width: 100%; margin: 0 -8px; }
@media (min-width: 760px) { .topnav { order: 0; width: auto; margin: 0 0 0 8px; } }
.topnav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="page"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -3px 0 var(--waypoint); border-radius: 0; }
.topbar .spacer { flex: 1; }
.who { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; max-width: 200px; white-space: nowrap; display: none; }
@media (min-width: 900px) { .who { display: block; } }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.footer { border-top: 1px solid var(--border); padding: 18px 0 28px; color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--muted); }

/* ---------- buttons and fields ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 0.93rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 40px; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
:root[data-theme="dark"] .btn.danger.solid { color: #1b0603; }
.btn.small { padding: 4px 10px; min-height: 34px; font-size: 0.85rem; }
.btn.icon { padding: 0; width: 40px; min-width: 40px; }
.btn.icon.small { width: 34px; min-width: 34px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn svg, .icon-svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .label { font-weight: 600; font-size: 0.92rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--muted);
  background: var(--surface); min-height: 42px; display: block;
}
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.92rem; margin-bottom: 14px; }
.form-error:empty { display: none; }

/* ---------- containers ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.panel-title { font-size: 0.95rem; margin-bottom: 10px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 24px 0 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }

.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); border: 1px solid var(--waypoint); margin: 12px 0 0; }
.banner strong { font-weight: 700; }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); }
.banner.err { background: var(--danger-soft); border-color: var(--danger); }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 0.92rem; }
.notice.warn { background: var(--warn-soft); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.published { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill.published::before { background: var(--ok); }
.pill.draft::before { background: var(--waypoint); }

progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.high::-webkit-progress-value { background: var(--waypoint); }
progress.high::-moz-progress-bar { background: var(--waypoint); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 24px 0; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; border-radius: var(--radius-sm); height: 56px; margin-bottom: 8px; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 300; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); }
.toast.bad { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .toast.bad { color: #1b0603; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
dialog.wide { width: min(1000px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 14, 12, 0.55); }
.dlg { padding: 22px; display: grid; gap: 14px; }
.dlg h2 { font-size: 1.2rem; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- auth screens ---------- */
.auth { max-width: 440px; margin: 40px 0 0; }
.auth-wrap { display: block; }
.auth-aside { display: none; }
@media (min-width: 900px) {
  .auth { margin: 72px 0 0; }
  .auth-wrap { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 420px); gap: 96px; justify-content: center; }
  .auth-aside { display: block; margin-top: 84px; }
  .auth-aside h2 { font-size: 1rem; margin-bottom: 18px; color: var(--muted); font-weight: 600; }
}
.auth h1 { margin-bottom: 6px; }
.auth .lead { color: var(--muted); margin-bottom: 22px; }
.auth .alt { margin-top: 18px; color: var(--muted); font-size: 0.92rem; display: flex; gap: 6px 16px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.usage { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .usage { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; } }
.meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; margin-bottom: 6px; }
.meter-label span:first-child { font-weight: 600; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 12px; align-items: flex-end; }
.toolbar .field { margin: 0; flex: 1 1 220px; }
.toolbar .field.narrow { flex: 0 1 170px; }
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.guide-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: center; }
.guide-row .gtitle { font-weight: 650; font-size: 1.02rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.guide-row .gtitle:hover { text-decoration: underline; }
.guide-row .gmeta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.86rem; }
@media (min-width: 820px) {
  .guide-row { grid-template-columns: minmax(0, 1fr) 100px 92px 140px 80px; gap: 12px; padding: 14px 8px; }
  .guide-row .gmeta { display: contents; }
  .guide-row .gmeta > * { white-space: nowrap; }
  .guide-head { display: grid; grid-template-columns: minmax(0, 1fr) 100px 92px 140px 80px; gap: 12px; padding: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
  .guide-head span:last-child { text-align: right; }
}
.guide-head { display: none; }
@media (min-width: 820px) { .guide-head { display: grid; } }
.empty { border: 1px dashed var(--muted); border-radius: var(--radius); padding: 28px; margin-top: 8px; display: grid; gap: 16px; max-width: 720px; }
.empty ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.empty-title { font-size: 1.25rem; }

/* ---------- editor ---------- */
.editor { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 1000px) { .editor { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; } .editor-side { position: sticky; top: 16px; } }
.editor-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 8px; }
.editor-top .back { color: var(--muted); text-decoration: none; font-size: 0.92rem; display: inline-flex; gap: 4px; align-items: center; }
.save-state { color: var(--muted); font-size: 0.85rem; min-width: 8ch; }
.save-state.bad { color: var(--danger); font-weight: 600; }
.title-input { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; border-color: transparent; background: transparent; padding-left: 8px; margin-left: -9px; min-height: 48px; }
.title-input:hover { border-color: var(--border); }
.editor-main .field { margin-bottom: 10px; }

.steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: stepno; }
.step { position: relative; padding-left: 52px; padding-bottom: 14px; }
.step::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: -2px; width: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.node { position: absolute; left: 0; top: 4px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--waypoint); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; z-index: 1; }
.step.tip .node { border-style: dashed; }
.step.dragging { opacity: 0.45; }
.step.drop-before > .step-card, .step.drop-after > .step-card { outline: 3px dashed var(--accent); outline-offset: 2px; }
.step.drop-before > .step-card { box-shadow: 0 -8px 0 -2px var(--accent); }
.step.drop-after > .step-card { box-shadow: 0 8px 0 -2px var(--accent); }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.step-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step-bar .spacer { flex: 1; }
.step-bar select.input { width: auto; min-height: 34px; padding: 3px 8px; font-size: 0.88rem; }
.grip { cursor: grab; touch-action: none; user-select: none; }
.step-fig { margin: 0; position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); line-height: 0; }
.step-fig img, .view-fig img { width: 100%; height: auto; display: block; }
.step-img-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.no-image { color: var(--muted); font-size: 0.88rem; }
.add-step { margin-top: 6px; padding-left: 52px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.side-card { padding: 16px; }
.side-card + .side-card { margin-top: 14px; }
.side-card h2 { font-size: 0.98rem; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.88rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 6px; align-items: stretch; }
.copy-row .input { font-family: var(--mono); font-size: 0.82rem; min-width: 0; }
.stack { display: grid; gap: 10px; }
.suggest-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.suggest-list li { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; display: grid; gap: 6px; font-size: 0.9rem; }
.danger-zone { border-color: var(--danger); }
details > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; min-height: 32px; display: flex; align-items: center; }

/* blur dialog */
.blur-stage { position: relative; line-height: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: auto; max-height: 46vh; background: var(--surface-2); touch-action: none; }
.blur-stage canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.blur-layer { position: absolute; pointer-events: none; }
.blur-box { position: absolute; box-sizing: border-box; pointer-events: auto; cursor: pointer; border: 2px dashed var(--waypoint); background: rgba(201, 138, 43, 0.12); }
.blur-box.selected { cursor: move; border-style: solid; outline: 3px solid var(--focus, #1d4ed8); outline-offset: 1px; touch-action: none; }
.blur-box:focus-visible { outline: 3px solid var(--focus, #1d4ed8); outline-offset: 2px; }
.blur-tag { position: absolute; left: -2px; top: -20px; line-height: 16px; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--waypoint); color: #fff; white-space: nowrap; pointer-events: none; }
.blur-handle { position: absolute; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; background: var(--surface); border: 2px solid var(--waypoint); touch-action: none; }
.bh-n { left: 50%; top: -8px; margin-left: -7px; cursor: ns-resize; } .bh-s { left: 50%; bottom: -8px; margin-left: -7px; cursor: ns-resize; }
.bh-e { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; } .bh-w { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.bh-ne { right: -8px; top: -8px; cursor: nesw-resize; } .bh-nw { left: -8px; top: -8px; cursor: nwse-resize; }
.bh-se { right: -8px; bottom: -8px; cursor: nwse-resize; } .bh-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
@media (pointer: coarse) {
  .blur-handle { width: 28px; height: 28px; }
  .bh-n { top: -15px; margin-left: -14px; } .bh-s { bottom: -15px; margin-left: -14px; } .bh-e { right: -15px; margin-top: -14px; } .bh-w { left: -15px; margin-top: -14px; }
  .bh-ne { right: -15px; top: -15px; } .bh-nw { left: -15px; top: -15px; } .bh-se { right: -15px; bottom: -15px; } .bh-sw { left: -15px; bottom: -15px; }
}
.blur-sel { position: absolute; border: 2px dashed var(--waypoint); background: rgba(201, 138, 43, 0.18); pointer-events: none; }
.rect-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rect-form .field { margin: 0; }
.rect-form .input { padding: 6px 8px; min-height: 36px; }

/* tokens */
.token-once { border: 2px solid var(--waypoint); border-radius: var(--radius); padding: 16px; background: var(--warn-soft); display: grid; gap: 10px; }
.token-once code { font-family: var(--mono); overflow-wrap: anywhere; font-size: 0.92rem; }
.table-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.table-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); align-items: center; }
.table-list .sub { color: var(--muted); font-size: 0.85rem; grid-column: 1; }
.table-list .btn { grid-column: 2; grid-row: 1 / span 2; }
.steps-help { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.cols { display: grid; gap: 24px; }
@media (min-width: 900px) { .cols.two { grid-template-columns: 1.1fr 1fr; align-items: start; } }

/* plans */
.plans { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; align-content: start; }
.plan.current { border: 2px solid var(--accent); }
.plan h3 { font-size: 1rem; }
.plan .price { font-size: 1.3rem; font-weight: 700; }

/* ---------- guide view (share page, print view) ---------- */
.view { max-width: 760px; margin: 0 auto; }
.view-head { margin: 28px 0 24px; }
.view-head h1 { font-size: 2rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.view-head .desc { margin-top: 10px; color: var(--muted); font-size: 1.05rem; overflow-wrap: anywhere; }
.view-head .meta { margin-top: 10px; color: var(--muted); font-size: 0.85rem; }
.view-summary { margin: 28px 0 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.view-summary h2 { font-size: 1.1rem; margin: 0 0 8px; }
.view-intro { margin-bottom: 24px; padding: 14px 16px; border-left: 4px solid var(--waypoint); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.trail { list-style: none; margin: 0; padding: 0; }
.trail > li { position: relative; padding-left: 52px; padding-bottom: 32px; }
.trail > li::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--border); }
.trail > li:last-child::before { display: none; }
.trail .node { top: 0; }
.trail h2 { font-size: 1.2rem; padding-top: 4px; overflow-wrap: anywhere; }
.trail .sdesc { margin-top: 6px; overflow-wrap: anywhere; }
.trail .sdesc p + p { margin-top: 8px; }
.trail .where { margin-top: 4px; font-size: 0.82rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.view-fig { margin: 12px 0 0; position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); line-height: 0; }
.tip-box { margin-top: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--border); }
.tip-box .tip-label { font-weight: 700; font-size: 0.85rem; display: block; margin-bottom: 2px; }
.view-foot { border-top: 1px solid var(--border); padding: 18px 0 32px; color: var(--muted); font-size: 0.9rem; display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: space-between; }
.view-foot a, .view-foot .btn { color: var(--muted); }
.view-bar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #333; --border: #999; --accent: #000; --accent-strong: #000; --waypoint: #444; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .footer, .no-print, .toasts, .skip-link, .view-bar { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .view { max-width: none; }
  .trail > li { break-inside: avoid; padding-bottom: 18px; }
  .view-fig { border: 1px solid #999; }
  .view-foot { border-top: 1px solid #999; }
  a { color: #000; }
}

/* second pass after looking at the screenshots */
.cols > .card { margin-top: 0; }
.cols { gap: 16px; }
h3.panel-title { margin-top: 18px; }
.suggest-list li .btn { justify-self: start; }
.side-card .btn-row { margin: 8px 0; }
.step-bar { flex-wrap: nowrap; gap: 2px; }
.step-bar select.input { min-width: 0; flex: 0 1 9rem; }
@media (max-width: 520px) {
  .step { padding-left: 42px; }
  .node { width: 30px; height: 30px; font-size: 0.82rem; }
  .step::before { left: 14px; top: 32px; }
  .trail > li { padding-left: 42px; }
  .trail > li::before { left: 14px; top: 36px; }
  .step-card { padding: 10px; }
  .add-step { padding-left: 42px; }
}
.steps-help + p { margin-top: 12px; }
.plan-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 2px; }
.table-list li > span { min-width: 0; overflow-wrap: anywhere; }
.workspace-switch { width: 14rem; max-width: 100%; min-height: 36px; padding: 4px 8px; font-size: 0.88rem; }
.topbar .btn { white-space: nowrap; }
.workspace-switch { width: 12rem; }
.auth .btn-row { margin-top: 14px; }
