/* Op-Ed Insight — calm paper and ink. System fonts only. */
:root {
  --bg: #f8f4ec; --surface: #fffdf8; --surface-2: #f1ebdf; --line: #e3dac8; --line-2: #d4c8b0;
  --text: #22283a; --muted: #5c6274; --faint: #8a8f9c;
  --ink: #1f2d4a; --accent: #2d4f86; --accent-2: #a4552b; --accent-soft: #e6ecf6;
  --logo-bg: #1f2d4a; --logo-fg: #f3ead8; --ink-drop: #d9824a;
  --feather-a: #f3ead8; --feather-b: #e4d3b4; --shaft: #1f2d4a; --nib: #1f2d4a;
  --shadow: 0 1px 2px rgba(40, 32, 18, .06), 0 6px 24px rgba(40, 32, 18, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* highlight colours: Okabe–Ito palette (colour-blind safe), each with its own line style */
  --hl-passive: #0072b2; --hl-adverb: #2f8fcf; --hl-hedge: #b5508a; --hl-cliche: #d55e00;
  --hl-nominal: #009e73; --hl-repeat: #6b6b6b; --hl-simpler: #009e73;
  --hl-long1: rgba(240, 228, 66, .30); --hl-long2: rgba(230, 159, 0, .26);
  --tint-passive: rgba(0, 114, 178, .10); --tint-repeat: rgba(110, 110, 110, .16); --tint-simpler: rgba(0, 158, 115, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151d; --surface: #191e29; --surface-2: #202634; --line: #2a3141; --line-2: #39425a;
    --text: #e8e3d7; --muted: #a7acb9; --faint: #7b8191;
    --ink: #cfd9ec; --accent: #93b4ea; --accent-2: #e5a273; --accent-soft: #233150;
    --logo-bg: #e8dcc2; --logo-fg: #1b2233; --ink-drop: #e5a273;
    --feather-a: #efe4cf; --feather-b: #c9b48e; --shaft: #8da2c8; --nib: #cfd9ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --hl-passive: #56a8e6; --hl-adverb: #7cc4f0; --hl-hedge: #e08fc0; --hl-cliche: #ff8a3d;
    --hl-nominal: #34c99a; --hl-repeat: #a0a0a0; --hl-simpler: #34c99a;
    --hl-long1: rgba(240, 228, 66, .14); --hl-long2: rgba(230, 159, 0, .20);
    --tint-passive: rgba(86, 168, 230, .14); --tint-repeat: rgba(180, 180, 180, .14); --tint-simpler: rgba(52, 201, 154, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151d; --surface: #191e29; --surface-2: #202634; --line: #2a3141; --line-2: #39425a;
  --text: #e8e3d7; --muted: #a7acb9; --faint: #7b8191;
  --ink: #cfd9ec; --accent: #93b4ea; --accent-2: #e5a273; --accent-soft: #233150;
  --logo-bg: #e8dcc2; --logo-fg: #1b2233; --ink-drop: #e5a273;
  --feather-a: #efe4cf; --feather-b: #c9b48e; --shaft: #8da2c8; --nib: #cfd9ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --hl-passive: #56a8e6; --hl-adverb: #7cc4f0; --hl-hedge: #e08fc0; --hl-cliche: #ff8a3d;
  --hl-nominal: #34c99a; --hl-repeat: #a0a0a0; --hl-simpler: #34c99a;
  --hl-long1: rgba(240, 228, 66, .14); --hl-long2: rgba(230, 159, 0, .20);
  --tint-passive: rgba(86, 168, 230, .14); --tint-repeat: rgba(180, 180, 180, .14); --tint-simpler: rgba(52, 201, 154, .14);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--sans); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.5em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5em 1em; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.js-only { display: none; }
html.js .js-only { display: revert; }
html.js .no-js { display: none; }

/* header */
.top { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.bar { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.32rem; font-weight: 600; white-space: nowrap; }
.brand .logo { width: 32px; height: 32px; flex: none; }
.brand i { font-weight: 500; color: var(--accent-2); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--text); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: .96rem; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .nav-editor { background: var(--ink); color: var(--bg); font-weight: 600; }
.nav .nav-editor:hover { background: var(--accent); color: var(--bg); }
.theme-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 38px; height: 36px; cursor: pointer; display: inline-grid; place-items: center; }
.theme-btn:hover { color: var(--text); border-color: var(--line-2); }
.theme-btn svg { width: 18px; height: 18px; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 .94rem/1 var(--sans); padding: 10px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-sm { padding: 7px 10px; font-size: .86rem; border-radius: 8px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
input[type="text"], input[type="number"], select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; max-width: 100%; }
select { padding-right: 28px; }
label { font-size: .92rem; }

/* hero */
.hero { padding: 48px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); margin-top: 0; }
.hero h1 em { color: var(--accent-2); font-style: italic; font-weight: 500; }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 36em; }
.hero-art { width: 100%; height: auto; max-height: 330px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.promise { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: .92rem; margin-top: 16px; }
.promise svg { width: 18px; height: 18px; color: var(--accent); }

/* quick demo */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; margin: 18px 0 8px; }
.demo-grid { display: grid; grid-template-columns: 1fr 260px; gap: 22px; }
.demo-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font: 600 1.45rem/1.15 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); }

/* cards */
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }   /* short last row centred (PARK-56) */
.grid > * { min-width: 0; }
.grid-3 > * { flex: 0 1 calc((100% - 2 * 16px) / 3); }
.grid-2 > * { flex: 0 1 calc((100% - 16px) / 2); }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h3 { margin: .2em 0 .25em; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.card .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card .ico svg { width: 22px; height: 22px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font: 600 .74rem/1.45 var(--sans); color: var(--accent-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: .3em; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 34px 0; margin: 44px 0; }
.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.band-grid h3 { margin-top: 0; }

/* breadcrumbs, article */
.crumbs { font-size: .86rem; color: var(--muted); margin: 22px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; color: var(--faint); }
.article { max-width: 720px; }
.article-wrap { display: grid; grid-template-columns: minmax(0, 720px) 1fr; gap: 48px; }
.standfirst { font-size: 1.2rem; color: var(--muted); font-family: var(--serif); line-height: 1.5; }
.meta { font-size: .86rem; color: var(--faint); margin-bottom: 1.6em; }
.prose { font-family: var(--serif); font-size: 1.12rem; line-height: 1.72; }
.prose h2, .prose h3 { font-family: var(--serif); }
.prose li { margin-bottom: .35em; }
.prose table { font-family: var(--sans); }
.bq { margin: 1.2em 0; padding: 14px 18px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); }
.bq p { margin: 0 0 .4em; }
.bq-before { border-left-color: var(--hl-cliche); }
.bq-after { border-left-color: var(--hl-nominal); }
.bq-tip { border-left-color: var(--accent); }
.bq-watch-out { border-left-color: var(--accent-2); }
.bq strong { font-family: var(--sans); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: .3em; }
.ba-meta { display: block; font: .78rem/1.4 var(--sans); color: var(--faint); margin-top: 4px; }
blockquote { margin: 1.2em 0; padding: 0 0 0 16px; border-left: 3px solid var(--line-2); color: var(--muted); }
.aside { position: sticky; top: 84px; align-self: start; font-size: .92rem; }
.aside h2 { font-size: 1rem; margin: 0 0 .6em; font-family: var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.aside ul { list-style: none; padding: 0; margin: 0 0 24px; }
.aside li { margin: 0 0 8px; }
.related { margin-top: 3em; }

/* tables */
.tablewrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tbl { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; }
.tbl .ok { color: var(--hl-nominal); font-weight: 600; }
.tbl .bad { color: var(--hl-cliche); font-weight: 600; }
.caption { font-size: .84rem; color: var(--muted); margin-top: -.6em; }

/* lists pages */
.lex-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.lex-filter input { flex: 1 1 240px; }
.lex-grid { columns: 2; column-gap: 28px; }
.lex-item { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); }
.lex-item b { font-family: var(--serif); font-weight: 600; }
.lex-item .arrow { color: var(--faint); margin: 0 6px; }
.lex-item small { display: block; color: var(--muted); }
.tag { display: inline-block; font: 600 .7rem/1 var(--sans); text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); vertical-align: 2px; margin-left: 4px; }

/* ===== writing surface with highlight backdrop ===== */
.hl-wrap { position: relative; }
.hl-back, .hl-input { font: 400 1.14rem/1.75 var(--serif); padding: 18px 20px; margin: 0; border: 0; letter-spacing: normal; word-spacing: normal; tab-size: 4;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; width: 100%; }
.hl-back { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; border: 1px solid transparent; }
.hl-input { position: relative; display: block; background: transparent; color: var(--text); resize: none; min-height: 220px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 14px; caret-color: var(--accent-2); }
.hl-wrap { background: var(--surface); border-radius: 14px; }
.hl-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hl-input::placeholder { color: var(--faint); }
mark { color: inherit; background: none; padding: 0; border-radius: 2px; }
.hl-back mark { color: transparent; text-decoration-skip-ink: none; text-underline-offset: .22em; }
mark.long1 { background: var(--hl-long1); }
mark.long2 { background: var(--hl-long2); }
mark.repeat { background-image: linear-gradient(var(--tint-repeat), var(--tint-repeat)); }
mark.simpler { background-image: linear-gradient(var(--tint-simpler), var(--tint-simpler)); }
mark.nominal { text-decoration: underline double var(--hl-nominal) 1.5px; }
mark.adverb { text-decoration: underline dotted var(--hl-adverb) 2.5px; }
mark.hedge { text-decoration: underline dashed var(--hl-hedge) 2px; }
mark.passive { text-decoration: underline solid var(--hl-passive) 2.5px; background-image: linear-gradient(var(--tint-passive), var(--tint-passive)); }
mark.cliche { text-decoration: underline wavy var(--hl-cliche) 1.6px; }
mark.flash { outline: 2px solid var(--accent-2); outline-offset: 1px; }
/* key swatches use the same styles */
.sw { display: inline-block; min-width: 2.2em; text-align: center; font-family: var(--serif); line-height: 1.3; border-radius: 3px; text-underline-offset: .22em; }
.sw.long1 { background: var(--hl-long1); } .sw.long2 { background: var(--hl-long2); }
.sw.passive { text-decoration: underline solid var(--hl-passive) 2.5px; background: var(--tint-passive); }
.sw.adverb { text-decoration: underline dotted var(--hl-adverb) 2.5px; }
.sw.hedge { text-decoration: underline dashed var(--hl-hedge) 2px; }
.sw.cliche { text-decoration: underline wavy var(--hl-cliche) 1.6px; }
.sw.nominal { text-decoration: underline double var(--hl-nominal) 1.5px; }
.sw.repeat { background: var(--tint-repeat); }
.sw.simpler { background: var(--tint-simpler); }
.static-marked { font: 400 1.1rem/1.75 var(--serif); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0; white-space: pre-wrap; }

/* tool widgets */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin: 18px 0 30px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.tool .hl-wrap { background: var(--bg); }
.tool-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tool-bar .spacer { flex: 1; }
.panel { background: var(--surface-2); border-radius: 14px; padding: 14px; align-self: start; }
.panel h3 { margin: 0 0 8px; font: 600 .78rem/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.panel + .panel { margin-top: 12px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .94rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.noscript { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .15s; }
.meter.over i { background: var(--hl-cliche); }
.meter.warn i { background: #c99400; }
.limit-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.limit-row:last-child { border-bottom: 0; }
.limit-row .lr-top { display: flex; justify-content: space-between; gap: 10px; }
.limit-row .lr-top b { font-variant-numeric: tabular-nums; }
.limit-row small { color: var(--muted); }
.score-list { list-style: none; margin: 0; padding: 0; }
.score-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.score-list li:last-child { border-bottom: 0; }
.score-list b { font: 600 1.15rem/1.2 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.score-list small { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.issue-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.issue-list li { margin: 0; }
.issue-list button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; line-height: 1.4; }
.issue-list button:hover, .issue-list button:focus-visible { background: var(--surface); outline: none; }
.issue-list .it { font-family: var(--serif); }
.issue-list small { display: block; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: .86rem; cursor: pointer; color: var(--text); }
.chip input { margin: 0; accent-color: var(--accent); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.case-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chart-wrap { overflow-x: auto; }
.chart { display: block; min-width: 520px; width: 100%; height: auto; }
.chart text { font: 11px var(--sans); fill: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.form-row > label { display: flex; flex-direction: column; gap: 4px; }
.result-big { font: 600 2.4rem/1.1 var(--serif); color: var(--ink); }
.result-sub { color: var(--muted); }

/* ===== editor page ===== */
.ed-body .foot { display: none; }
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; min-height: calc(100vh - 61px); }
.ed-main { padding: 18px clamp(16px, 4vw, 56px) 80px; }
.ed-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 760px; margin: 0 auto 10px; }
.ed-tools .spacer { flex: 1; }
input.ed-title { font: 600 1.6rem/1.3 var(--serif); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 6px 2px; width: 100%; }
input.ed-title:focus { outline: none; border-bottom-color: var(--line-2); }
.ed-paper { max-width: 760px; margin: 0 auto; }
.ed .hl-wrap { background: transparent; }
.ed .hl-input { border: 0; border-radius: 0; padding: 14px 2px 40vh; min-height: 60vh; font-size: 1.2rem; line-height: 1.8; box-shadow: none; }
.ed .hl-back { border: 0; padding: 14px 2px 40vh; font-size: 1.2rem; line-height: 1.8; }
.ed-side { border-left: 1px solid var(--line); background: var(--surface); padding: 16px 16px 60px; position: sticky; top: 61px; height: calc(100vh - 61px); overflow: auto; }
.ed-side .panel { background: var(--bg); }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 7px 6px; border-radius: 7px; font: 600 .85rem var(--sans); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.status { font-size: .8rem; color: var(--faint); }
.ed.focus-mode { grid-template-columns: 1fr; }
.ed.focus-mode .ed-side { display: none; }
.focus-on .top { display: none; }
.focus-on .ed { min-height: 100vh; }
.mobile-bar { display: none; }
dialog { border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--text); padding: 20px; max-width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 12, 20, .45); }
dialog h2 { margin-top: 0; font-size: 1.3rem; }
.doc-list { list-style: none; padding: 0; margin: 0 0 14px; max-height: 50vh; overflow: auto; }
.doc-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc-list li .dl-open { all: unset; cursor: pointer; flex: 1; min-width: 0; }
.doc-list li .dl-open b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); }
.doc-list li.cur b::after { content: " · open"; color: var(--accent); font: 600 .75rem var(--sans); }
.doc-list small { color: var(--muted); }
kbd { font: 600 .8rem var(--mono); background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .92rem; z-index: 60; box-shadow: var(--shadow); }
.suggest { padding: 10px 0; border-bottom: 1px solid var(--line); }
.suggest .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.suggest b { font-family: var(--serif); }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 36px 0 30px; font-size: .92rem; background: var(--surface); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.foot-grid a:hover { color: var(--accent); }
.foot-h { font-weight: 700; margin: 0 0 6px; color: var(--text); }
.foot-brand { display: flex; align-items: center; gap: 8px; font: 600 1.15rem var(--serif); color: var(--ink); margin: 0 0 8px; }
.foot-brand .logo { width: 26px; height: 26px; }
.tm { color: var(--faint); font-size: .82rem; margin-top: 24px; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-height: 200px; order: -1; }
  .grid-3 > * { flex-basis: calc((100% - 16px) / 2); }
  .grid-3.hold3 > * { flex-basis: calc((100% - 2 * 16px) / 3); }   /* curated sets of 3/9: 3 then 1 */
  .tool-grid, .demo-grid { grid-template-columns: 1fr; }
  .article-wrap { grid-template-columns: 1fr; }
  .aside { position: static; }
  .ed { grid-template-columns: 1fr; }
  .ed-side { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .foot-grid { grid-template-columns: 1fr 1fr; }   /* .band-grid keeps its 3 columns until 640px (PARK-56) */
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .bar { gap: 8px; min-height: 56px; }
  .brand { font-size: 1.15rem; }
  .brand .logo { width: 28px; height: 28px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 7px; font-size: .9rem; }
  .nav .nav-hide-sm { display: none; }
  .band-grid { grid-template-columns: 1fr; }
  .grid-3 > *, .grid-3.hold3 > *, .grid-2 > * { flex-basis: 100%; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .lex-grid { columns: 1; }
  .demo { padding: 14px; }
  .tool { padding: 12px; border-radius: 14px; }
  .hl-back, .hl-input { font-size: 1.05rem; padding: 14px; }
  .ed-main { padding: 10px 16px 30px; }
  .ed .hl-input, .ed .hl-back { padding-bottom: 30vh; font-size: 1.1rem; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 16px; gap: 14px; font-size: .88rem; color: var(--muted); align-items: center; }
  .mobile-bar b { color: var(--text); font-variant-numeric: tabular-nums; }
  .mobile-bar a { margin-left: auto; }
  .ed-body { padding-bottom: 50px; }
  .ed-tools [data-act="keys"] { display: none; }
  .ed-tools .status { display: none; }
  .hero { padding-top: 26px; }
  .hero-art { max-height: 150px; }
  .prose { font-size: 1.06rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .foot, .ed-side, .ed-tools, .mobile-bar, .tool-bar { display: none !important; }
  .hl-back { display: none; }
  body { background: #fff; color: #000; }
}
