:root {
  /* Design A (D-040): fresh and friendly. Light theme. */
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #14213d;
  --muted: #5b6478;
  --border: #e3e8f2;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #eaf1ff;
  --accent-ink: #ffffff;
  --good: #16a34a;
  --good-bg: #e7f7ee;
  --bad: #c62828;
  --bad-bg: #fdecea;
  --half: #9a6700;
  --half-bg: #fff4d6;
  --violet-soft: #f1eaff; --green-soft: #e7f7ee; --amber: #b45309; --amber-soft: #fff4dc; --pink: #db2777; --pink-soft: #fde7f1; --teal: #0d9488; --teal-soft: #dff6f3;
  --footer: #0f1a33; --footer-ink: #c8d1e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,33,61,.04), 0 8px 24px -18px rgba(20,33,61,.22);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --hindi: "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Gurmukhi", "Noto Sans Gujarati", "Noto Sans Tamil", "Noto Sans Telugu", "Mangal", "Nirmala UI", sans-serif;   /* all Indian scripts (#21) */
}
/* Dark theme: follows the device unless the person picked a theme (data-theme on <html>, set by the header toggle) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1424; --surface: #151d31; --surface-2: #1d2740; --text: #e6ebf5; --muted: #a3adc2; --border: #2a3550;
    --accent: #6ea2ff; --accent-2: #b39dfa; --accent-soft: #1c2a4d; --accent-ink: #0b1220; --good: #5cc97a; --good-bg: #16301f; --bad: #ff7b72; --bad-bg: #3a1a19;
    --half: #e3b341; --half-bg: #3a2e10; --shadow: none;
    --violet-soft: #2a2148; --green-soft: #16301f; --amber: #f1b54a; --amber-soft: #3a2e10; --pink: #f27ab0; --pink-soft: #3d1a2c; --teal: #3cc9b8; --teal-soft: #12302d;
    --footer: #0a0f1d; --footer-ink: #a3adc2;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1424; --surface: #151d31; --surface-2: #1d2740; --text: #e6ebf5; --muted: #a3adc2; --border: #2a3550;
  --accent: #6ea2ff; --accent-2: #b39dfa; --accent-soft: #1c2a4d; --accent-ink: #0b1220; --good: #5cc97a; --good-bg: #16301f; --bad: #ff7b72; --bad-bg: #3a1a19;
  --half: #e3b341; --half-bg: #3a2e10; --shadow: none;
  --violet-soft: #2a2148; --green-soft: #16301f; --amber: #f1b54a; --amber-soft: #3a2e10; --pink: #f27ab0; --pink-soft: #3d1a2c; --teal: #3cc9b8; --teal-soft: #12302d;
  --footer: #0a0f1d; --footer-ink: #a3adc2;
}
/* Font size control: everything is sized in rem, so this scales the whole page */
:root[data-font="large"] { font-size: 112.5%; }
:root[data-font="xl"] { font-size: 125%; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden must win over .toolbar / .field display rules */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--font); }
.prefs { display: flex; gap: 4px; }
.prefs button { font: inherit; font-size: .85rem; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 4px 8px; cursor: pointer; min-height: 32px; }
.prefs button:hover { color: var(--text); border-color: var(--accent); }
.lang-switch { font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); color: var(--accent); border-radius: 6px; padding: 4px 10px; min-height: 32px; display: inline-flex; align-items: center; }
.lang-switch:hover { background: var(--accent); color: var(--accent-ink); }
:root:lang(hi) body { font-family: var(--hindi); }
a { color: var(--accent); }
img { max-width: 100%; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
small, .muted { color: var(--muted); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

main { padding: 20px 0 40px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); max-width: 70ch; margin-top: 0; }

/* Cards / grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
a.card { color: var(--text); text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-right: 4px; }

/* Layout with sidebar ad column — ads never sit inside the tool area */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1000px) { .layout.has-aside { grid-template-columns: minmax(0, 1fr) 300px; } }
.ad-slot { min-height: 250px; border: 1px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.ad-slot.wide { min-height: 100px; margin: 28px 0; }

/* Controls */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.field { max-width: 100%; min-width: 0; }
.field select { max-width: 100%; text-overflow: ellipsis; }
select, input[type="text"], input[type="date"], input[type="number"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; min-height: 38px;
}
.btn { font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; min-height: 38px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.check { display: flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--text); }
.checklist { list-style: none; padding: 0; margin: 8px 0 16px; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.checklist .check { align-items: flex-start; }
.checklist .check input { margin-top: 3px; flex: none; }
.countdown { font-weight: 600; }

/* Typing */
.typing-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stats-bar { display: flex; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.stat b { font-size: 1.35rem; display: block; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat.timer b { color: var(--accent); }
.passage { font-size: 1.12rem; line-height: 1.85; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); max-height: 260px; overflow-y: auto; user-select: none; word-wrap: break-word; }
.passage.hi, textarea.hi { font-family: var(--hindi); font-size: 1.2rem; }
.passage .w { border-radius: 3px; padding: 0 1px; }
.passage .w.cur { background: var(--accent); color: var(--accent-ink); }
.passage .w.ok { color: var(--good); }
.passage .w.err { color: var(--bad); text-decoration: underline; }
.typing-area { width: 100%; min-height: 170px; margin-top: 12px; font: 1.08rem/1.7 var(--font); padding: 12px 14px; border-radius: 8px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }
.typing-area:focus { outline: none; border-color: var(--accent); }
.typing-area:disabled { opacity: .7; }
.typing-app:fullscreen { background: var(--bg); padding: 20px; overflow-y: auto; }
/* Exam-screen view (#13): the plain look of computer-based test screens — header bar,
   timer top right, passage panel above the answer box, no live stats. Not any vendor's design. */
.es-head { display: none; }
.exam-screen .es-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #2b4c7e; color: #fff; padding: 8px 12px; margin: -16px -16px 12px; border-radius: var(--radius) var(--radius) 0 0; font: 600 .95rem Arial, sans-serif; }
.exam-screen .typing-box { background: #eef1f5; border-color: #b8c2cf; }
.exam-screen .stats-bar { justify-content: flex-end; margin-bottom: 6px; }
.exam-screen .stats-bar .stat:not(.timer) { display: none; }
.exam-screen .stat.timer { background: #fff; border: 1px solid #b8c2cf; border-radius: 4px; padding: 4px 10px; }
.exam-screen .stat.timer b { color: #c62828; font-family: Arial, sans-serif; }
.exam-screen .passage { background: #fff; color: #111; border: 1px solid #9aa7b8; border-radius: 0; font-family: Arial, var(--hindi), sans-serif; }
.exam-screen .typing-area { background: #fff; color: #111; border: 1px solid #9aa7b8; border-radius: 0; font-family: Arial, var(--hindi), sans-serif; }
.typing-app:fullscreen .passage { max-height: 38vh; }
.custom-text { margin-bottom: 12px; }
.passage-card { display: flex; flex-direction: column; }
.passage-card .excerpt { color: var(--text); margin: 6px 0 10px; flex: 1; }
.passage-card .excerpt.hi, .passage-card h3.hi { font-family: var(--hindi); }
.custom-text .typing-area { min-height: 110px; margin-top: 0; }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

.result { margin-top: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.result-grid .card { padding: 10px 12px; }
.result-grid b { font-size: 1.3rem; display: block; font-variant-numeric: tabular-nums; }
.result-grid span { font-size: .78rem; color: var(--muted); }
.verdict { padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.verdict.pass { background: var(--good-bg); color: var(--good); }
.verdict.fail { background: var(--bad-bg); color: var(--bad); }
.compare { line-height: 2; padding: 12px; background: var(--surface-2); border-radius: 8px; max-height: 320px; overflow: auto; }
.compare .hi { font-family: var(--hindi); }
.m-ok { color: var(--text); }
.m-full { background: var(--bad-bg); color: var(--bad); border-radius: 3px; padding: 0 3px; }
.m-half { background: var(--half-bg); color: var(--half); border-radius: 3px; padding: 0 3px; }
.m-omit { color: var(--bad); text-decoration: line-through; opacity: .8; }
.m-add { background: var(--bad-bg); color: var(--bad); border-radius: 3px; padding: 0 3px; font-style: italic; }
.legend { font-size: .82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* Tables / specs */
table.spec { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .94rem; }
table.spec.pay-matrix td, table.spec.pay-matrix th { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spec th, .spec td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec th { width: 38%; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.updated { margin: 0 0 14px; font-size: .88rem; }
.updated .badge { display: inline-block; background: var(--good-bg); color: var(--good); border-radius: 99px; padding: 2px 10px; font-weight: 600; }
.updated details { margin-top: 6px; } .updated summary { cursor: pointer; color: var(--muted); }
.updated ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.source-note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 6px 12px; margin: 12px 0; background: var(--surface); }
.report-link { font-size: .85rem; margin: 4px 0 16px; }
.warn-note { font-size: .88rem; border-left: 3px solid var(--half); padding: 8px 12px; margin: 12px 0; background: var(--half-bg); color: var(--text); border-radius: 0 6px 6px 0; }
blockquote.decl-text { margin: 8px 0 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.6; overflow-wrap: anywhere; }
.decl-text { overflow-wrap: anywhere; }

/* Progress charts: one series each, so no legend; the score table below is the table view */
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chart-head h3 { margin: 0; }
.chart-wrap { position: relative; }
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; top: 4px; width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: .82rem; box-shadow: var(--shadow); pointer-events: none; color: var(--text); }

/* On-screen keyboard and heatmap (one hue, light → dark; text stays in text tokens) */
:root { --heat-1: color-mix(in srgb, var(--accent) 10%, var(--surface)); --heat-2: color-mix(in srgb, var(--accent) 28%, var(--surface));
  --heat-3: color-mix(in srgb, var(--accent) 46%, var(--surface)); --heat-4: color-mix(in srgb, var(--accent) 66%, var(--surface)); --heat-5: color-mix(in srgb, var(--accent) 88%, var(--surface)); }
.kb-wrap { margin-top: 12px; overflow-x: auto; }
.kb { display: inline-flex; flex-direction: column; gap: 4px; user-select: none; }
.kb-row { display: flex; gap: 4px; }
.kb-row:nth-child(2) { padding-left: 18px; } .kb-row:nth-child(3) { padding-left: 30px; } .kb-row:nth-child(4) { padding-left: 46px; }
.kb-pad .kb-row { padding-left: 0 !important; }
.kb-pad { margin-left: 16px; vertical-align: top; }
.kb-key { position: relative; width: 38px; height: 40px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: .9rem; color: var(--text); }
.kb-key small { position: absolute; top: 1px; left: 4px; font-size: .62rem; color: var(--muted); }
.kb-key i { position: absolute; bottom: 1px; right: 4px; font-size: .58rem; font-style: normal; color: var(--muted); }
.kb-hi .kb-key b { font-family: var(--hindi); font-weight: 500; }
.kb-space { width: 240px; margin-left: 130px; }
.kb-wide { width: 80px; }
.kb-key.kb-down { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.kb-key.kb-down small, .kb-key.kb-down i { color: var(--accent-ink); }
.kb-key.heat-1, .kb-legend .heat-1 { background: var(--heat-1); } .kb-key.heat-2, .kb-legend .heat-2 { background: var(--heat-2); }
.kb-key.heat-3, .kb-legend .heat-3 { background: var(--heat-3); } .kb-key.heat-4, .kb-legend .heat-4 { background: var(--heat-4); }
.kb-key.heat-5, .kb-legend .heat-5 { background: var(--heat-5); }
.kb-key.heat-4 b, .kb-key.heat-5 b { color: var(--accent-ink); }
.kb-key.heat-none, .kb-legend .heat-none { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 4px, var(--surface-2) 4px, var(--surface-2) 8px); }
.kb-legend { font-size: .8rem; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kb-legend span { display: inline-block; width: 18px; height: 14px; border-radius: 3px; border: 1px solid var(--border); }
.weak-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.weak-list span { border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums; }

/* History */
table.history { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.history th, .history td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }

/* Resizer */
.resizer { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .resizer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.drop { display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--surface); cursor: pointer; }
.drop.over { border-color: var(--accent); }
.crop-stage { position: relative; margin: 0 auto; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0/16px 16px;
  border: 1px solid var(--border); touch-action: none; cursor: grab; max-width: 100%; }
.crop-stage canvas { display: block; width: 100%; height: auto; }
.face-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.face-guide ellipse, .face-guide line { fill: none; stroke: #fff; stroke-width: .8; stroke-dasharray: 2.5 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px rgba(0,0,0,.8)); }
.face-guide ellipse, .face-guide line { stroke-width: 2px; }
.out-preview { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.out-preview img { border: 1px solid var(--border); background: #fff; image-rendering: auto; }
.before-after { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 12px 0; }
.before-after figure { margin: 0; }
.before-after img { max-width: 100%; max-height: 260px; border: 1px solid var(--border); background: #fff; display: block; }
.before-after figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.before-after canvas { max-width: 100%; max-height: 260px; height: auto; border: 1px solid var(--border); background: #fff; display: block; }
.pdf-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.pdf-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; flex-wrap: wrap; }
.pdf-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; background: #fff; }
.pdf-name { flex: 1; min-width: 120px; word-break: break-all; font-size: .92rem; }
.pdf-actions { display: flex; gap: 4px; }
.pdf-actions .btn { padding: 4px 10px; min-height: 34px; }
.guide { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; margin: 20px 0; }
.guide h2 { margin-top: .8em; }
.privacy { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--good); margin: 6px 0 12px; }

footer.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: .88rem; }
footer.site-footer a { color: var(--muted); }

.mask-stage { max-width: 100%; border: 1px solid var(--border); touch-action: none; cursor: crosshair; display: inline-block; }
.mask-stage canvas { display: block; max-width: 100%; height: auto; }

/* Tier 3 batch 1 */
.key-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; font-variant-numeric: tabular-nums; }
.key-grid span { padding: 2px 6px; border-radius: 4px; font-size: .82rem; background: var(--surface-2); }
.key-grid .k-correct { background: var(--good-bg); color: var(--good); }
.key-grid .k-wrong { background: var(--bad-bg); color: var(--bad); }
.omr-grid { columns: 4 170px; column-gap: 18px; margin: 12px 0; }
.omr-row { display: flex; align-items: center; gap: 4px; break-inside: avoid; padding: 2px 0; }
.omr-q { width: 2.4em; text-align: right; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.omr-b { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--text); background: transparent; color: var(--text); font-size: .72rem; padding: 0; cursor: pointer; }
.omr-b[aria-pressed="true"] { background: var(--text); color: var(--bg, #fff); }
.omr-row[data-st="correct"] .omr-q { color: var(--good); font-weight: 700; }
.omr-row[data-st="wrong"] .omr-q { color: var(--bad); font-weight: 700; }
.omr-head { display: flex; flex-wrap: wrap; gap: 24px; margin: 8px 0; }
.print-only { display: none; }
.timer-face { font-size: clamp(3rem, 16vw, 6rem); font-weight: 700; text-align: center; margin: 0; font-variant-numeric: tabular-nums; }
.timer-label { text-align: center; color: var(--muted); margin: 0; }
.timetable td { min-width: 90px; font-size: .85rem; }
.game-area { position: relative; height: 380px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin: 10px 0; }
.game-area .g-word { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 1.05rem; white-space: nowrap; will-change: transform; }
.game-area.hi .g-word, .game-input.hi { font-family: var(--hindi); }
.game-area .g-word.g-hit { background: var(--accent); color: var(--accent-ink); }
.game-input { width: 100%; font-size: 1.15rem; }
.pe-pages { display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-x: auto; max-width: 100%; }
.pe-page { position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.25); max-width: none; }
.pe-page canvas { display: block; }
.pdf-edit.pe-armed .pe-page { cursor: crosshair; outline: 2px dashed var(--accent); }
.pe-item { position: absolute; cursor: move; color: #000; line-height: 1; white-space: nowrap; outline: 1px dashed var(--accent); touch-action: none; }
.pe-item img { display: block; }
.pe-list { padding-left: 1.2em; }
.embed-code { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
body.embed main .wrap { max-width: 980px; }
.embed-credit { text-align: center; font-size: .85rem; margin: 10px 0; }
@media print {
  .site-header, .site-footer, .crumbs, .no-print, .ad-slot, h1, .lead, .guide, aside, .pe-tools { display: none !important; }
  .print-only { display: flex !important; }
  .omr-b { border-color: #000; color: #000; background: #fff !important; }
  .omr-grid { columns: 5 140px; }
  body { background: #fff; }
}
.word-preview { width: 100%; height: 900px; border: 1px solid var(--border); border-radius: var(--radius); background: #e8e8e8; }

/* ================= Design A layer (D-040): header, cards, buttons, home page, footer ================= */
.wrap { max-width: 1140px; padding: 0 20px; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); letter-spacing: -.02em; line-height: 1.18; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; }
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.site-header .wrap { min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0; font-weight: 800; letter-spacing: -.01em; }
.brand .logo { width: 36px; height: 36px; margin-right: 10px; flex: none; }
.site-footer .foot-brand { display: flex; align-items: center; gap: 0; font-weight: 800; font-size: 1.15rem; color: #fff; margin: 0 0 10px; }
.foot-brand .logo { width: 30px; height: 30px; margin-right: 10px; }
.foot-brand span { color: #8fb3ff; }
.nav a { border-radius: 10px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.prefs button, .lang-switch { border-radius: 10px; }
main { padding: 24px 0 48px; }
.card { border-radius: var(--radius); }
a.card { display: flex; flex-direction: column; gap: 8px; padding: 18px; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 14px 30px -18px rgba(20,33,61,.4); }
a.card h3 { margin: 0; }
.ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.ic svg { width: 23px; height: 23px; }
.ic-violet { background: var(--violet-soft); color: var(--accent-2); }
.ic-green { background: var(--green-soft); color: var(--good); }
.ic-amber { background: var(--amber-soft); color: var(--amber); }
.ic-pink { background: var(--pink-soft); color: var(--pink); }
.ic-teal { background: var(--teal-soft); color: var(--teal); }
.btn { border-radius: 12px; }
.btn.primary { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.site-footer { background: var(--footer); color: var(--footer-ink); border-top: none; margin-top: 24px; padding: 30px 0; }
.site-footer a { color: #fff; }
.site-footer p { color: var(--footer-ink); }

/* home page */
.home-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; padding: 18px 0 8px; }
.home-hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.12; letter-spacing: -.025em; margin: 14px 0 12px; }
.home-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero .lead { font-size: 1.12rem; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--good-bg); color: var(--good); font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 99px; }
.pill svg { width: 18px; height: 18px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 18px; }
.cta .btn { padding: 12px 20px; font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.cta .btn svg { width: 18px; height: 18px; }
.trust { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 18px; height: 18px; color: var(--good); }
.hero-art svg { width: 100%; height: auto; display: block; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 0 16px; }
.sec-head h2 { margin: 0; font-size: 1.55rem; }
.sec-head p { margin: 4px 0 0; color: var(--muted); }
.more { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.more svg { width: 18px; height: 18px; }
.home-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.chips a small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.why > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.why svg { width: 30px; height: 30px; color: var(--accent); }
.why h3 { margin: 10px 0 6px; }
.why p { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .site-header { position: static; } .home-hero { grid-template-columns: 1fr; } .why { grid-template-columns: 1fr; } .sec-head { flex-wrap: wrap; } }
