:root {
  --paper: #f7f5f0;
  --ink: #1d2433;
  --muted: #5d6474;
  --line: #ddd8cc;
  --accent: #1f4d3d;
  --accent-ink: #ffffff;
  --error: #9b2c1f;
  --card: #ffffff;
  --sel: #2b6cb0;
  --r: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 12px; }
h2 { font-size: 26px; margin: 48px 0 12px; }
h3 { font-size: 19px; margin: 28px 0 6px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1040px; margin: 0 auto; padding: 16px 24px; }
.logo { display: inline-flex; align-items: center; gap: 4px; font: 700 20px Charter, "Bitstream Charter", Georgia, serif; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 12px 4px; }
.sample .link { padding: 10px 0; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1040px; margin: 0 auto; padding: 24px 24px 64px; }
.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.prose { max-width: 680px; }
.prose li { margin: 6px 0; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer div { max-width: 1040px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer a { color: var(--muted); }

.btn { font: inherit; font-size: 15px; padding: 8px 16px; min-height: 40px; border-radius: var(--r); border: 1px solid #8f949e; background: var(--card); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 12px 24px; font-size: 17px; }
.btn.primary:hover { background: #173b2f; }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.big { padding: 16px 32px; font-size: 19px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.has-doc main > h1, .has-doc main > .lead, .has-doc main > .prose { display: none; }
.btn.icon { padding: 8px 12px; min-width: 40px; }
a.btn { display: inline-block; text-decoration: none; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sel); outline-offset: 2px; }

/* the tool */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; padding: 32px; background: var(--card); border: 2px dashed #8f949e; border-radius: 10px; cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop .up { color: var(--accent); }
.drop .hint { color: var(--muted); font-size: 15px; }
.drop:focus-within { outline: 3px solid var(--sel); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; margin: 14px 0 0; color: var(--ink); font-size: 15px; }
.checks li { display: flex; align-items: center; gap: 6px; }
.checks li:not(:first-child)::before { content: "✓"; color: var(--accent); font-weight: 700; }
.sample { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.status { margin: 20px 0; font-size: 17px; }
.status:empty { display: none; }
.status.error { color: var(--error); font-weight: 600; background: #fbeae7; border: 1px solid var(--error); padding: 12px 16px; border-radius: var(--r); }
#tool { min-height: 300px; }
.updated { color: var(--muted); font-size: 14px; margin-top: 40px; }
.warn { background: #fbf3dc; border: 1px solid #ecdcae; padding: 12px 16px; border-radius: var(--r); font-size: 15px; max-width: 680px; }
.note { background: #fbf3dc; border: 1px solid #ecdcae; padding: 12px 16px; border-radius: var(--r); font-size: 15px; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar .name { font-weight: 600; margin-right: auto; overflow-wrap: anywhere; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 28px 0; }
.sheet { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 20px rgba(0,0,0,.06); background: #fff; }
.after { text-align: center; color: var(--muted); }

.tpl-title { font-size: 20px; margin: 40px 0 16px; }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); }
.tpl:hover { border-color: var(--accent); }
.tpl .thumb { display: block; overflow: hidden; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.tpl { justify-content: flex-end; min-height: 250px; }

/* a page from a .pub file: everything in points, positioned like Publisher */
.page { position: relative; overflow: hidden; background: #fff; color: #000; font: 10pt/1.17 Arial, sans-serif; text-align: left; }
.page .item { position: absolute; transform-origin: center; }
.page .shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.page .text { display: flex; flex-direction: column; }
.page .text[data-valign="middle"] { justify-content: center; }
.page .text[data-valign="bottom"] { justify-content: flex-end; }
.page .flow { max-height: 100%; outline: none; }
/* substitute fonts can run wider than the originals: let a lone box spill rather than cut words off; linked boxes must clip so text flows on */
.page .text[data-chain] { overflow: hidden; }
.page .text[data-chain] .flow { overflow: hidden; }
.page p { margin: 0; white-space: pre-wrap; overflow-wrap: break-word; }
.page .pic img { display: block; width: 100%; height: 100%; object-fit: fill; }
.page .pic.broken, .page .pic.empty { background: repeating-linear-gradient(45deg, #eee 0 8px, #f6f6f6 8px 16px); }
.page .pic.empty img, .page .pic.broken img { display: none; }
.page table { border-collapse: collapse; table-layout: fixed; width: 100%; }
.page td { padding: 2pt 4pt; }

/* editing */
.editing .page .item { cursor: default; }
.editing .page .pic { cursor: move; }
.editing .page .pic.selected { touch-action: none; }
.editing .page .pic.empty { cursor: pointer; }
.editing .page .pic.empty::after { content: "Click to add a picture"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 600 14pt system-ui, sans-serif; color: #666; }
.editing .page .text:hover, .editing .page .pic:hover { outline: 1px dashed rgba(43,108,176,.6); }
.page .item.selected { outline: 2px solid var(--sel) !important; }
.handle { position: absolute; width: calc(28px / var(--z, 1)); height: calc(28px / var(--z, 1)); background: var(--sel); border: 2px solid #fff; border-radius: 50%; z-index: 2; touch-action: none; }
.handle.move { left: calc(-14px / var(--z, 1)); top: calc(-14px / var(--z, 1)); cursor: move; }
.handle.size { right: calc(-14px / var(--z, 1)); bottom: calc(-14px / var(--z, 1)); cursor: nwse-resize; }

.export-stage { position: fixed; left: -100000px; top: 0; }

.faq dt { font-weight: 600; margin-top: 20px; }
.faq dd { margin: 4px 0 0; color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; max-width: 680px; }
.steps li { counter-increment: s; padding-left: 40px; position: relative; margin: 12px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.pro { margin-left: 4px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 12px 16px; }
  .top nav { gap: 12px; font-size: 14px; }
  main { padding: 16px 16px 48px; }
  /* one row on a phone: the buttons scroll sideways instead of taking a quarter of the screen */
  .bar .name { flex-basis: 100%; }
  .bar .btn { flex: 1; }
  .editing .bar .btn { flex: none; }
  .page-bar { font-size: 13px; }
  .top nav a { white-space: nowrap; }
  h1 { font-size: 28px; }
  .lead { font-size: 17px; margin-bottom: 20px; }
}
@media print {
  body > *:not(main), .bar, .after, .note, .pick, h1, .lead, .prose, .warn, .status, .page-bar, .add-page { display: none !important; }
  @page { margin: 0; }
  .sheet { box-shadow: none; zoom: 1 !important; break-after: page; }
  .pages { padding: 0; gap: 0; }
}
.compare { border-collapse: collapse; width: 100%; max-width: 680px; font-size: 16px; }
.compare th, .compare td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.compare th { font-family: Georgia, serif; }
.edit-tools .btn:disabled { opacity: .4; cursor: default; }
.edit-tools .btn.icon { display: inline-flex; align-items: center; justify-content: center; }

.edit-tools [hidden] { display: none !important; }
.edit-tools select, .edit-tools input[type=number] { font: inherit; font-size: 15px; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); }
.edit-tools .size, .edit-tools .rotate { width: 64px; }
.swatch, .rot { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.swatch input[type=color] { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.btn.small { font-size: 14px; padding: 4px 12px; }
.resume { margin: 16px 0 0; }

/* one strip above each page */
.pages { align-items: safe center; overflow-x: auto; }
.page-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; max-width: 820px; margin-bottom: -16px; font-size: 14px; color: var(--muted); }
.page-no { font-weight: 600; color: var(--ink); margin-right: auto; }

/* shapes, groups, crop */
.editing .page > svg.shape > :not(defs) { pointer-events: visiblePainted; cursor: pointer; }
.page > svg.shape.selected > :not(defs) { filter: drop-shadow(0 0 1.5px var(--sel)) drop-shadow(0 0 1.5px var(--sel)); }
.page .shp svg { display: block; }
.page .pic[data-crop] { overflow: hidden; }
.page .pic[data-crop] img { position: absolute; max-width: none; }
.page .pic[data-cropping].selected { overflow: visible; outline: 2px dashed #b45309 !important; }
.page .pic[data-cropping] img { opacity: .6; }
.page ul, .page ol { margin: 0; padding-left: 1.4em; }
.editing .bar .name { flex-basis: 100%; }
.editing .bar .get-pdf { margin-left: auto; }

/* more editor tools */
.edit-tools .pos { display: inline-flex; gap: 4px; }
.edit-tools .pos label { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); }
.edit-tools .pos input { width: 62px; }
.pages.guides .page::after { content: ""; position: absolute; inset: 36pt; border: 1px dashed rgba(43,108,176,.55); pointer-events: none; z-index: 3; }
.page .item[data-locked].selected { outline-style: dotted !important; }
dialog.ask { max-width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; background: var(--card); color: var(--ink); }
dialog.ask::backdrop { background: rgba(0,0,0,.35); }
dialog.ask h2 { margin: 0 0 12px; font-size: 20px; }
dialog.ask label { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 15px; }
dialog.ask input:not([type=color]):not([type=checkbox]), dialog.ask select { font: inherit; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); }
dialog.ask input[type=file] { height: auto; padding: 6px 0; border: 0; }
.ask-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ask-list { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.ask-list .link { text-align: left; }
.ask-list .hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
@media print { .pages.guides .page::after { display: none; } }
.edit-tools select { max-width: 132px; }
/* text boxes: drag the box to move it; once selected, click in the words to type (drag its edge or the round handle to move) */
.editing .page .text:not(.selected), .editing .page .table:not(.selected), .editing .page .text.selected, .editing .page .shp { cursor: move; }
.editing .page .text.selected .flow, .editing .page .table.selected td { cursor: text; }

/* editor: an Office-style ribbon. Title row (quick access, name, Download PDF), tabs, one panel of labelled groups; grey desk; status bar */
.edit-tools [hidden] { display: none !important; }
.editing .edit-tools { display: contents; }
.has-doc main { max-width: 1440px; padding-top: 0; }
.tabs, .panels { min-width: 0; }
.has-doc main > .warn { display: none; }
.editing .bar { gap: 4px 12px; padding: 8px 0 0; border-bottom: 0; }
.editing .bar .name { order: 1; flex: 1 1 auto; font-size: 15px; text-align: center; }
.editing .bar .get-pdf { order: 2; padding: 8px 18px; font-size: 15px; }
.qa { order: 0; display: flex; gap: 2px; }
.qa .btn.icon, .rg .btn.icon { min-height: 32px; min-width: 32px; padding: 4px 6px; border-color: transparent; background: none; }
.qa .btn.icon:hover:not(:disabled), .rg .btn:hover:not(:disabled) { background: #eef1ee; border-color: var(--line); }
.tabs { order: 3; flex-basis: 100%; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { font: inherit; font-size: 14px; padding: 8px 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-format { color: #a14c12; }
.tab-format[aria-selected="true"] { color: #a14c12; border-bottom-color: #a14c12; }
.panels { order: 4; flex-basis: 100%; background: var(--card); border-bottom: 1px solid var(--line); }
.panel { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: thin; padding: 6px 4px 2px; }
.rg { display: flex; flex-direction: column; flex: none; min-width: 0; margin: 0; padding: 0 10px; border: 0; border-right: 1px solid var(--line); }
.rg:last-child { border-right: 0; }
.rg:disabled { opacity: .45; }
.rg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 68px; }
.rg-row { display: flex; align-items: center; gap: 3px; }
.rg-label { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; white-space: nowrap; }
.rg .btn { font-size: 13px; min-height: 30px; padding: 3px 9px; border-radius: 4px; border-color: transparent; background: none; white-space: nowrap; flex: none; }
.rg .btn[aria-pressed="true"] { background: #dfe9e3; border-color: #b7cdbf; }
.rg .btn.big { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-height: 64px; padding: 6px 10px; }
.rg .btn.big svg { width: 24px; height: 24px; }
.rg .btn.icon { display: inline-flex; align-items: center; justify-content: center; }
.rg .btn:disabled, .qa .btn:disabled { opacity: .4; cursor: default; }
.rg select, .rg input[type=number] { font: inherit; font-size: 13px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); max-width: 150px; }
.rg .font { width: 150px; }
.rg .size, .rg .rotate { width: 56px; }
.rg .swatch { gap: 2px; font-size: 13px; color: var(--ink); }
.rg .swatch input[type=color] { width: 24px; height: 24px; border-radius: 4px; }
.sw-a { font-weight: 700; }
.sw-h { font-weight: 700; background: #fff59d; padding: 0 2px; }
.rg .pos { display: inline-flex; gap: 4px; }
.rg .pos label { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.rg .pos input { width: 58px; }
.editing .pages { background: #e4e1da; margin: 0 -24px; padding: 32px 24px 64px; }
.has-doc { padding-bottom: 30px; }
.statusbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 20px; height: 30px; padding: 0 16px; background: #ece9e2; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.statusbar .zoom { margin-left: auto; font: inherit; font-size: 13px; height: 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
@media (max-width: 640px) {
  .editing .pages { margin: 0 -16px; padding: 16px; }
  .editing .bar .name { display: none; }
  .qa { margin-right: auto; }
  .top { flex-wrap: wrap; row-gap: 0; }
  .statusbar .sb-size, .statusbar .sb-kept { display: none; }
}
@media print { .statusbar { display: none !important; } .editing .pages { background: none; margin: 0; padding: 0; } .has-doc { padding: 0; } }

/* editor polish: one title row (logo, quick access, name, Download PDF) instead of the site header; quiet state layers */
:root { --desk: #e3e0d8; --chrome: #f7f5f0; --state: color-mix(in srgb, var(--accent) 9%, transparent); --state-press: color-mix(in srgb, var(--accent) 16%, transparent); }
.has-doc:has(.editing) .top { display: none; }
.has-doc:has(.editing) main { max-width: none; padding: 0 16px; }
.has-doc .top { max-width: 1440px; } /* viewer: header lines up with the wider page area */
.editing .pages { margin: 0 -16px; background: var(--desk); }
.editing .bar { background: var(--chrome); padding-top: 6px; }
.app-logo { display: inline-flex; align-items: center; padding: 4px 8px 4px 0; margin-right: 4px; border-right: 1px solid var(--line); }
.qa { align-items: center; }
.panel { padding: 6px 0 2px; scrollbar-width: none; }
.panel::-webkit-scrollbar { display: none; }
.rg { padding: 0 12px; }
.rg:disabled { opacity: 1; }
.rg:disabled .rg-body { opacity: .5; }
.rg .btn, .qa .btn.icon, .tab, .editing .page-bar .btn { transition: background-color .12s ease-out; }
.qa .btn.icon:hover:not(:disabled), .rg .btn:hover:not(:disabled), .tab:hover, .editing .page-bar .btn:hover { background: var(--state); border-color: transparent; }
.rg .btn:active:not(:disabled), .qa .btn.icon:active:not(:disabled), .editing .page-bar .btn:active { background: var(--state-press); }
.tab { border-radius: 6px 6px 0 0; }
.rg input[type=color], .editing .page-bar input[type=color] { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); cursor: pointer; }
.rg input[type=color]::-webkit-color-swatch-wrapper, .editing .page-bar input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.rg input[type=color]::-webkit-color-swatch, .editing .page-bar input[type=color]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.rg input[type=color]::-moz-color-swatch { border: 0; border-radius: 2px; }
.rg select, .rg input[type=number] { background-color: var(--card); color: var(--ink); }
.rg select:hover, .rg input[type=number]:hover { border-color: #b9b4a8; }
/* the strip above each page: quiet text buttons, not a row of big boxes */
.editing .page-bar { max-width: none; justify-content: center; gap: 2px; margin-bottom: -20px; }
.editing .page-bar .page-no { margin-right: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.editing .page-bar .btn { min-height: 30px; padding: 3px 10px; font-size: 13px; border-color: transparent; background: none; color: var(--muted); }
.editing .page-bar .btn:hover { color: var(--ink); }
.editing .page-bar label { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-size: 13px; }
.editing .after { padding: 0 0 24px; background: var(--desk); margin: 0 -16px; }
@media (prefers-reduced-motion: reduce) { .rg .btn, .qa .btn.icon, .tab, .editing .page-bar .btn { transition: none; } }
@media (max-width: 640px) { .app-logo { display: none; } }

/* handles: a small visible dot inside a 28px hit area */
.handle { background: none; border: 0; }
.handle::after { content: ""; position: absolute; inset: calc(8px / var(--z, 1)); border-radius: 50%; background: var(--card); border: calc(2px / var(--z, 1)) solid var(--sel); box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* home page: tool on the left, a fanned stack of real pages on the right; then proof, what it does, privacy, templates, steps, questions */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 48px; align-items: center; padding: 24px 0 40px; }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px; background: #fbf3dc; border: 1px solid #ecdcae; font-size: 14px; color: #6b5414; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); letter-spacing: -.02em; line-height: 1.05; text-wrap: balance; }
.hero .lead { text-wrap: pretty; }
.hero-art { position: relative; height: 440px; }
.stack { position: absolute; inset: 0; }
.paper { position: absolute; display: block; overflow: hidden; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(29,36,51,.06), 0 2px 4px rgba(29,36,51,.06), 0 18px 40px -12px rgba(29,36,51,.28); pointer-events: none; }
.stack .paper:nth-child(1) { left: 6%; top: 28px; transform: rotate(-7deg); }
.stack .paper:nth-child(2) { left: 30%; top: 0; transform: rotate(5deg); }
.stack .paper:nth-child(3) { left: 16%; top: 54px; transform: rotate(-1.5deg); }
.tag { position: absolute; left: 10%; bottom: 0; padding: 6px 12px; border-radius: 6px; background: var(--ink); color: #fff; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; transform: rotate(-2deg); }
.versions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; list-style: none; margin: 8px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.versions li:not(:last-child)::after { content: "·"; margin: 0 12px; color: #b9b4a8; }
.landing section { margin-top: 72px; }
.landing h2 { margin: 0 0 20px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.01em; text-wrap: balance; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--card); border-radius: 10px; box-shadow: 0 0 0 1px rgba(29,36,51,.07), 0 1px 2px rgba(29,36,51,.05); color: var(--ink); text-decoration: none; transition: box-shadow .15s ease-out, transform .15s ease-out; }
.card:hover { box-shadow: 0 0 0 1px rgba(31,77,61,.35), 0 8px 24px -8px rgba(29,36,51,.18); transform: translateY(-2px); }
.card svg { color: var(--accent); }
.card h3 { margin: 4px 0 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.private { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px 40px; border-radius: 12px; background: var(--accent); color: #fff; }
.private h2 { color: #fff; margin-bottom: 8px; }
.private p { margin: 0; color: #d7e5dd; max-width: 620px; }
.private .big-no { font: 700 clamp(36px, 5vw, 56px)/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.03em; letter-spacing: -.02em; color: #fff; margin: 0; white-space: nowrap; }
.tpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tpl-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; min-height: 290px; padding: 16px; background: var(--card); border-radius: 10px; box-shadow: 0 0 0 1px rgba(29,36,51,.07); color: var(--ink); text-decoration: none; font-weight: 600; transition: box-shadow .15s ease-out; }
.tpl-card:hover { box-shadow: 0 0 0 2px var(--accent); }
.tpl-card .paper { position: relative; margin: auto 0; }
.faq-section details { border-bottom: 1px solid var(--line); padding: 4px 0; max-width: 760px; }
.faq-section summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style-position: inside; }
.faq-section summary:hover { color: var(--accent); }
.faq-section details p { margin: 0 0 16px; color: var(--ink); }
.has-doc .hero { display: block; padding: 0; }
.has-doc .hero-art, .has-doc .landing, .has-doc .hero .eyebrow, .has-doc .hero h1, .has-doc .hero .lead { display: none; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { display: none; }
  .cards { grid-template-columns: 1fr; }
  .private { grid-template-columns: 1fr; gap: 12px; padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) { .card, .tpl-card { transition: none; } .card:hover { transform: none; } }
.rg .larger small, .rg .smaller small { font-size: 7px; margin-left: 1px; }
.rg .smaller { font-size: 11px; }
.rg sub, .rg sup { font-size: 9px; line-height: 0; }
.rg sub { vertical-align: -3px; }
.rg sup { vertical-align: 5px; }
@media (max-width: 640px) {
  /* the ribbon scrolls sideways on a phone: fade its right edge so it's clear there is more */
  .panel { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .editing .page-bar { gap: 0; }
  .editing .page-bar .btn { padding: 3px 7px; }
}

/* editor start page */
.kept { margin: -16px 0 24px; font-size: 15px; color: var(--muted); }
.has-doc main > .kept { display: none; }
.tpls { gap: 16px; }
.tpl { border: 0; border-radius: 10px; box-shadow: 0 0 0 1px rgba(29,36,51,.07); padding: 16px; gap: 12px; font-weight: 600; transition: box-shadow .15s ease-out; }
.tpl:hover { box-shadow: 0 0 0 2px var(--accent); }
.tpl .thumb { margin: auto 0; border-radius: 2px; box-shadow: 0 0 0 1px rgba(29,36,51,.06), 0 6px 16px -6px rgba(29,36,51,.25); }
@media (prefers-reduced-motion: reduce) { .tpl { transition: none; } }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 16px; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #b9b4a8; }
.crumbs a { color: var(--muted); }
.has-doc .crumbs { display: none; }

/* right-click menu */
.ctx { position: fixed; z-index: 50; min-width: 230px; max-height: calc(100vh - 8px); overflow-y: auto; padding: 4px; background: var(--card); border-radius: 8px; box-shadow: 0 0 0 1px rgba(29,36,51,.1), 0 4px 8px rgba(29,36,51,.08), 0 16px 32px -8px rgba(29,36,51,.22); font-size: 14px; overscroll-behavior: contain; animation: ctx-in .12s cubic-bezier(.23,1,.32,1); transform-origin: top left; }
@keyframes ctx-in { from { opacity: 0; transform: scale(.97); } }
.ctx-item { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 5px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: var(--state); outline: none; }
.ctx-item:focus-visible { box-shadow: inset 0 0 0 2px var(--sel); }
.ctx-item:disabled { color: #a3a6ad; cursor: default; }
.ctx-item kbd { font: 12px system-ui, sans-serif; color: var(--muted); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }
@media (prefers-reduced-motion: reduce) { .ctx { animation: none; } }
@media print { .ctx { display: none; } }
