/* KA Docs. The release dashboard's colours and type, so the two read as one family. */
:root {
  --bg: #F4F6F8; --surface: #FFFFFF; --ink: #14171C; --muted: #565E6B; --line: #DCE1E8; --line-soft: #EEF1F5;
  --accent: #1F4FD1; --accent-bg: #E8EEFC; --accent-line: #B9C9F3;
  --ok: #17653F; --ok-bg: #E3F4EA; --ok-line: #A7D9BB;
  --wait: #8A4B00; --wait-bg: #FFF1DC; --wait-line: #F3C98B;
  --bad: #A3221A; --bad-bg: #FDE8E6; --bad-line: #EDB3AD;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --pane-height: calc(100vh - 210px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1217; --surface: #171B22; --ink: #E6E9EE; --muted: #A3ABB8; --line: #2A303A; --line-soft: #222832;
    --accent: #8FB0FF; --accent-bg: #1C2742; --accent-line: #34487A;
    --ok: #7FD6A4; --ok-bg: #14301F; --ok-line: #2D5A3F;
    --wait: #F6C477; --wait-bg: #36280F; --wait-line: #6B4F1E;
    --bad: #FF9C93; --bad-bg: #3A1715; --bad-line: #6E2D28;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/22px var(--font); }
a { color: var(--accent); }
h1 { margin: 0; font-size: 26px; line-height: 34px; font-weight: 600; }
h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; line-height: 18px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.good { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--wait); }
.grow { flex: 1 1 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- frame --- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--surface); font-size: 12px; letter-spacing: .5px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.who { white-space: nowrap; }
.main { padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1280px; margin: 0 auto; }
.main.wide { max-width: none; padding: 16px 20px 24px; gap: 12px; }
.main.narrow { max-width: 560px; padding-top: 72px; }
@media (max-width: 700px) { .main { padding: 16px; } .topbar { padding: 0 16px; gap: 10px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.card-warn { background: var(--wait-bg); border-color: var(--wait-line); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.signin { align-items: flex-start; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head p { max-width: 720px; margin-top: 4px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.button:hover:not(:disabled) { border-color: var(--accent-line); background: var(--line-soft); }
.button:disabled { opacity: .5; cursor: default; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.button-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.button-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.link-button { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.link-button.bad { color: var(--bad); }
.link-button:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap;
  background: var(--line-soft); color: var(--muted); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.flash { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.flash-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--wait-bg);
  border: 1px solid var(--wait-line); color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input, .field select, .inline-field select, .search input, .image-filter {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.search input { width: 260px; max-width: 100%; }

/* --- products: a list to find one in, made for a hundred and more --- */
.recent { display: flex; flex-direction: column; gap: 8px; }
.recent-title { font-size: 13px; line-height: 18px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.recent-item { display: flex; flex-direction: column; min-width: 150px; max-width: 280px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); text-decoration: none; }
.recent-item:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.recent-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The bar to find with stands alone, and each product is a pill of its own under it. */
.product-list-card { padding: 0; gap: 8px; background: none; border: 0; border-radius: 0; }
/* Finding, the three lists and the letters stay in sight under the top bar while the list scrolls. */
.list-bar { position: sticky; top: 52px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 12px -8px rgba(0,0,0,.18), 0 -12px 0 var(--bg); }
.list-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.list-search .icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.list-search input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px 8px 34px; }
.list-filters { display: flex; flex-wrap: wrap; gap: 3px; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--line-soft); }
.list-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.list-filters button:hover:not(:disabled) { color: var(--ink); }
.list-filters button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.list-filters button:disabled { opacity: .5; cursor: default; }
.list-filters .icon { width: 14px; height: 14px; vertical-align: 0; }
.filter-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--line); color: var(--muted); font-size: 11px; line-height: 18px; font-weight: 700;
  text-align: center; }
.filter-count:empty { display: none; }
.letters { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 1px; }
.letters a, .letters span { display: inline-grid; place-items: center; min-width: 26px; height: 24px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; }
.letters a { color: var(--accent); }
.letters a:hover { background: var(--accent-bg); }
.letters span { color: var(--line); }
.list-status { padding: 4px 6px 0; }
.product-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.product-letter { padding: 12px 8px 0; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted); letter-spacing: .6px; scroll-margin-top: 170px; }

/* A product: its star, its picture and name with what's known of it, what needs a look, whether anything waits for a
   review, and what's written of it here. The pill holds them together; the columns line up from pill to pill. */
.product-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 118px 104px 110px; align-items: center; gap: 0 10px; padding: 7px 12px 7px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 180px; }
.product-row:hover { border-color: var(--accent-line); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.product-row.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.product-main { min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; border-radius: 10px; }
.product-thumb { flex: none; display: grid; place-items: center; width: 64px; height: 48px; overflow: hidden; border-radius: 8px; background: var(--line-soft);
  color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .6px; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.product-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-main:hover .product-name { color: var(--accent); text-decoration: underline; }
.product-meta { min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-meta .dot { opacity: .55; }
.product-row .button { width: 100%; }
.product-row span.product-do { text-align: center; white-space: nowrap; font-size: 12.5px; }
.product-row .button .icon { width: 15px; height: 15px; }
/* What needs a look, said in a word: changes you haven't sent, a version with no notes. */
.product-flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; }
.flag { padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.flag:hover { text-decoration: underline; }
.flag-unsent { background: var(--accent-bg); color: var(--accent); }
.flag-notes { background: var(--wait-bg); color: var(--wait); }
/* Whether anything of it waits for a review: a green tick where nothing does, a caution sign and how many where something does. */
.waits { justify-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; color: var(--muted); font-size: 13px;
  text-decoration: none; white-space: nowrap; }
.waits:hover { text-decoration: underline; }
.waits .icon { width: 18px; height: 18px; vertical-align: 0; }
.waits-none { color: var(--ok); padding: 3px; }
.waits-none:hover { background: var(--ok-bg); }
.waits-some { background: var(--wait-bg); color: var(--wait); font-weight: 600; box-shadow: inset 0 0 0 1px var(--wait-line); }
.star { color: var(--line); }
.product-row:hover .star, .product-row.active .star, .star:focus-visible { color: var(--muted); }
.star[aria-pressed="true"], .product-row:hover .star[aria-pressed="true"] { color: #D99A00; }
.star[aria-pressed="true"] .icon, .list-filters [data-filter="starred"][aria-pressed="true"] .icon { fill: currentColor; }
.list-filters [data-filter="starred"][aria-pressed="true"] .icon { color: #D99A00; }
/* On a narrow screen a pill is two lines: the product, then what's to do with it. */
@media (max-width: 900px) {
  .product-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px 8px 44px; }
  .product-row .star { position: absolute; left: 8px; top: 18px; }
  .product-main { flex: 1 0 100%; }
  .product-flags { justify-content: flex-start; }
  .product-flags:empty { display: none; }
  .product-row .button { width: auto; }
}
.word-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; }
.word-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.word-list li .small { flex: 1; }

/* --- the tools --- */
.tool-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tool-head h1 { font-size: 22px; line-height: 28px; }
.tool-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--line-soft); }
.tool-tabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tool-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 12px; align-items: stretch; }
.composer { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.workspace.no-preview { grid-template-columns: minmax(0, 1fr); }
.no-preview > .preview-pane { display: none; }
@media (max-width: 1100px) { .composer { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .workspace, .composer { grid-template-columns: minmax(0, 1fr); }
  :root { --pane-height: 70vh; }
}

.editor-pane, .preview-pane, .side-pane, .main-pane { min-width: 0; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.editor-pane, .main-pane { height: var(--pane-height); min-height: 420px; }
.preview-pane { height: var(--pane-height); min-height: 420px; }
.side-pane { height: var(--pane-height); min-height: 420px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tool-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tool-group button { min-height: 30px; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tool-group button:last-child { border-right: 0; }
.tool-group button:hover:not(:disabled) { background: var(--line-soft); }
.tool-group button:disabled { color: var(--muted); opacity: .55; cursor: default; }
.tool-group button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.tool-toggles { margin-left: auto; }
.editor-box { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.editor-box > .cm-editor { height: 100%; }
.fallback { width: 100%; height: 100%; border: 0; padding: 12px; resize: none; background: var(--surface); color: var(--ink); }
.empty-editor { padding: 20px; }
.statusbar { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px; border-top: 1px solid var(--line); color: var(--muted); background: var(--line-soft); }
.statusbar [data-message] { text-align: right; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
.savebar-notice { padding: 4px 10px; border-radius: 8px; color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok-line); }
.savebar-notice.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.shortcuts summary { cursor: pointer; color: var(--muted); }
.shortcuts dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 0; }
.shortcuts dt { font-family: var(--mono); font-size: 12px; } .shortcuts dd { margin: 0; color: var(--muted); }

/* Full screen: the editor and its preview over the whole window */
.workspace.full, .composer.full { position: fixed; inset: 0; z-index: 50; padding: 10px; background: var(--bg); --pane-height: calc(100vh - 20px); }
.composer.full { grid-template-columns: minmax(0, 1fr); }
.composer.full > .side-pane { display: none; }
body.full-open { overflow: hidden; }

/* --- the preview --- */
.preview-pane .tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.preview-checks { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 6px; }
.tab-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.check { padding: 7px 10px 7px 12px; border-radius: 8px; font-size: 13px; line-height: 18px; border-left: 3px solid; }
.check-ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.check-error { background: var(--bad-bg); border-color: var(--bad); }
.check-warn { background: var(--wait-bg); border-color: var(--wait); }
.check-note { background: var(--line-soft); border-color: var(--line); }
.check .link-button { color: var(--ink); }
.check .button { margin-top: 6px; }
.checks-side { padding: 0 12px 12px; }
.checks-side .check { overflow-wrap: anywhere; }
.notes, .notice-notes, .version-notes, .win-text, .mac-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes { padding: 10px 12px; border-radius: 8px; background: var(--line-soft); font-family: var(--mono); font-size: 13px; max-height: 320px; overflow: auto; }

.notice-mock { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; border-radius: 12px; background: #1E2127; color: #E8EAED; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.notice-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.notice-title { font-weight: 600; font-size: 15px; }
.notice-mock .badge { background: #2F3A52; color: #A9C1FF; }
.notice-desc { color: #B7BDC6; font-size: 13px; }
.notice-notes { font: 13px/19px var(--font); color: #E8EAED; }

.win-mock { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid #ADADAD; background: #F0F0F0; color: #000;
  font: 12px/16px "Segoe UI", Tahoma, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.win-title { padding: 6px 10px; background: #FFFFFF; border-bottom: 1px solid #DADADA; }
.win-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; background: #FFFFFF; border-bottom: 1px solid #A0A0A0; }
.win-head span { padding-left: 14px; }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.win-text { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px; background: #FFFFFF; border: 1px solid #828790; font: 12px/16px "Segoe UI", Tahoma, sans-serif; }
.win-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 16px; border-top: 1px solid #DADADA; }
.fake-button { min-width: 72px; padding: 3px 10px; text-align: center; border: 1px solid #ADADAD; background: #E1E1E1; }
.fake-default { border-color: #0078D7; }

.mac-mock { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: #ECECEC; color: #1D1D1F;
  font: 13px/18px -apple-system, "Helvetica Neue", Arial, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.22); border: 1px solid #C8C8C8; }
.mac-title { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #E3E3E3; border-bottom: 1px solid #C8C8C8; font-weight: 600; justify-content: center; position: relative; }
.mac-dots { position: absolute; left: 10px; display: flex; gap: 6px; }
.mac-dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; } .mac-dots i + i { background: #FEBC2E; } .mac-dots i + i + i { background: #28C840; }
.mac-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 150px 1fr; }
.mac-steps { margin: 0; padding: 16px 10px 16px 26px; color: #8A8A8E; font-size: 12px; line-height: 24px; }
.mac-steps .on { color: #1D1D1F; font-weight: 600; }
.mac-pane { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px 0; min-height: 0; }
.mac-text { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; background: #FFFFFF; border: 1px solid #C8C8C8; font: 13px/18px -apple-system, "Helvetica Neue", Arial, sans-serif; }

.versions { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.version-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line-soft); }
.version-row.current { background: var(--accent-bg); border-radius: 8px; }
.version-num { display: flex; flex-direction: column; }
.version-notes { font: 13px/19px var(--font); }
.conflict { border-color: var(--wait-line); }

/* --- the composer --- */
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 6px; }
.pane-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.page-tree { display: flex; flex-direction: column; padding: 0 6px 8px; }
.tree-folder { padding: 8px 8px 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tree-page { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title state" "file error"; gap: 0 6px; width: 100%; padding: 6px 8px; border: 0;
  border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tree-page.nested { padding-left: 18px; }
.tree-page[draggable="true"] { cursor: grab; }
.tree-page.dragging { opacity: .4; }
.tree-page.drop-before { box-shadow: inset 0 2px 0 var(--accent); border-radius: 0; }
.tree-page.drop-after { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.tree-folder.drop-into { background: var(--accent-bg); color: var(--accent); border-radius: 6px; }
.tree-nopdf { font-style: normal; font-family: var(--font); color: var(--wait); }
.tree-page:hover { background: var(--line-soft); }
.tree-page.on { background: var(--accent-bg); }
.tree-title { grid-area: title; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-file { grid-area: file; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-state { grid-area: state; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tree-new { color: var(--ok); } .tree-edited { color: var(--wait); }
.tree-error { grid-area: error; justify-self: end; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bad); color: var(--surface); font-size: 11px; font-weight: 700; }
.tree-deleted { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; font-size: 13px; color: var(--muted); }
/* The side: a tab each for the pages, the pictures and what to check, one shown at a time */
.side-tabs { flex: none; display: flex; padding: 0 6px; border-bottom: 1px solid var(--line); }
.side-tabs button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 55px; padding: 2px 4px 0;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; }
.side-tabs button:hover { color: var(--ink); }
.side-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
.tab-count-bad { background: var(--bad); color: var(--surface); }
.tab-count-warn { background: var(--wait-bg); color: var(--wait); box-shadow: inset 0 0 0 1px var(--wait-line); }
.side-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.side-tools { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 8px; }
.side-tools .button { gap: 5px; padding: 0 8px; white-space: nowrap; }
.side-tools .button .icon { width: 16px; height: 16px; margin-right: 0; }
.side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.side-scroll > * { flex-shrink: 0; }
.side-foot { flex: none; padding: 8px 12px 10px; border-top: 1px solid var(--line-soft); }
.side-summary { flex: none; padding: 12px 12px 8px; }
.side-empty { padding: 12px 4px; color: var(--muted); font-size: 13px; line-height: 18px; }
.side-good { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.side-search { flex: none; position: relative; display: block; margin: 0 10px 8px; }
.side-search .icon { position: absolute; left: 9px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--muted); pointer-events: none; }
.side-search .image-filter { width: 100%; font-size: 13px; padding: 5px 8px 5px 30px; }

/* A button that's only a picture (its title and its label say what it does) */
.icon-button { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: var(--muted); cursor: pointer; }
.icon-button .icon { width: 16px; height: 16px; vertical-align: 0; }
.icon-button:hover { background: var(--line); color: var(--ink); }
.icon-button-bad:hover { background: var(--bad-bg); color: var(--bad); }

/* The pictures, in their folders. What can be done with a row is a picture at its end, there while the row is pointed at. */
.image-list { display: flex; flex-direction: column; padding: 0 8px 8px; }
.image-folder-row { position: relative; display: flex; align-items: center; border-radius: 6px; }
.image-folder-row.drop-into { background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent-line); }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 5px 6px 5px 2px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.image-folder-row:hover { background: var(--line-soft); }
.folder-toggle .caret { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--muted); }
.folder-toggle .caret .icon { width: 14px; height: 14px; vertical-align: 0; transition: transform .12s; }
.image-folder-row[aria-expanded="true"] .caret .icon { transform: rotate(90deg); }
.folder-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { margin-left: auto; padding-left: 6px; color: var(--muted); font-weight: 400; font-size: 12px; }
.image-group { display: flex; flex-direction: column; gap: 1px; margin-left: 9px; padding-left: 7px; border-left: 1px solid var(--line); }
.image-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; border-radius: 6px; }
.image-item[draggable="true"] { cursor: grab; }
.image-item.dragging { opacity: .45; }
.image-item:hover { background: var(--line-soft); }
.image-item.flash { background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok-line); }
.image-item.moving { background: var(--accent-bg); }
.image-insert { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border: 0; border-radius: 6px; background: none; color: var(--ink);
  font: inherit; cursor: pointer; text-align: left; }
.image-insert img { width: 44px; height: 33px; object-fit: contain; background: var(--line-soft); border-radius: 4px; flex: none; }
.image-name { min-width: 0; display: flex; flex-direction: column; }
.image-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 17px; }
.image-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; line-height: 14px; }
.image-item.new .image-file { color: var(--ok); }
.image-item.moved .image-file { color: var(--accent); }
.image-actions, .folder-upload { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.image-actions { display: none; gap: 1px; }
.image-item:hover .image-actions { display: inline-flex; }
.image-item:has(:focus-visible) .image-actions { display: inline-flex; }
.image-item:hover .image-insert { padding-right: 60px; }
.image-item:has(:focus-visible) .image-insert { padding-right: 60px; }
.folder-upload { opacity: 0; }
.image-folder-row:hover .folder-upload, .folder-upload:focus-visible { opacity: 1; }
.image-folder-row:hover .folder-toggle { padding-right: 32px; }
.image-folder-row:has(.folder-upload:focus-visible) .folder-toggle { padding-right: 32px; }
.image-move { flex: 0 0 calc(100% - 60px); min-width: 0; margin: 0 4px 6px 56px; padding: 4px 6px; border: 1px solid var(--accent-line); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; }
.page-meta { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.meta-grid { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1.6fr) 90px 130px 110px; gap: 8px; }
.meta-grid .field input { padding: 5px 8px; font-size: 13px; }
@media (max-width: 1400px) { .meta-grid { grid-template-columns: 1fr 1fr; } }
.meta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--muted); }

.manual-preview { flex: 1; min-height: 0; overflow: auto; }

/* --- the composer's four views --- */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--line-soft); }
.view-switch button { padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.view-tools { display: none; flex-wrap: wrap; align-items: center; gap: 8px; }
.view-full { margin-left: auto; }
.view-full[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.small-select { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; min-height: 30px; }
.button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.view { flex: 1 1 auto; min-height: 0; display: none; flex-direction: column; }
.main-pane[data-view="write"] .view-edit, .main-pane[data-view="markdown"] .view-edit, .main-pane[data-view="preview"] .view-preview,
.main-pane[data-view="design"] .view-design, .main-pane[data-view="pdf"] .view-pdf { display: flex; }
/* one page, two editors: Write shows the rich text, Markdown its text */
.main-pane[data-view="write"] #editor, .main-pane[data-view="markdown"] #rich { display: none; }
.main-pane[data-view="write"] .only-markdown, .main-pane[data-view="markdown"] .only-write { display: none; }
.view-switch .tab-quiet { margin-left: 6px; font-weight: 400; }
.view-switch .tab-quiet::before { content: ""; display: inline-block; height: 14px; margin: 0 12px -2px -9px; border-left: 1px solid var(--line); }
.main-pane[data-view="design"] .view-tools-design, .main-pane[data-view="pdf"] .view-tools-pdf { display: flex; }
.view-preview .manual-preview { padding: 28px max(26px, calc((100% - 860px) / 2)); }
.manual-preview [data-line] { border-radius: 3px; }
.manual-preview [data-line]:hover { box-shadow: -10px 0 0 -7px #90FFB1; }

/* The PDF: laid out in frames of its own */
.frame-box { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; background: #5F646C; }
.pdf-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #5F646C; }
.pdf-frame.waiting { visibility: hidden; }
/* The PDF laid out off the screen, to count its pages for the assistant: a page's size, never seen */
.pdf-measure { position: fixed; left: -20000px; top: 0; width: 1000px; height: 1300px; overflow: hidden; pointer-events: none; }
.view-design { flex-direction: row; }
.design-form { flex: 0 0 380px; min-height: 0; overflow-y: auto; padding: 10px 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) { .design-form { flex-basis: 320px; } }
.design-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding-bottom: 4px; }
.design-part { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.design-part[open] { padding-bottom: 12px; }
.design-part > summary { padding: 9px 0; font-weight: 600; font-size: 14px; cursor: pointer; }
.design-part[open] > summary { margin-bottom: 4px; }
.design-part > :not(summary) + :not(summary) { margin-top: 10px; }
.design-form .field input[type="text"], .design-form .field input[type="number"], .design-form .field select, .design-form textarea {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; width: 100%; }
.design-form textarea { resize: vertical; }
.field-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.field-row > .field { flex: 1 1 90px; }
.field-num { flex: 0 1 110px !important; }
.with-unit { display: flex; align-items: center; gap: 4px; }
.with-unit input { min-width: 0; }
.with-unit i { font-style: normal; color: var(--muted); font-size: 12px; }
.field-color { flex: 0 0 auto !important; }
.field-color input[type="color"] { width: 54px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.field-color input:disabled { opacity: .35; }
.color-pair { display: flex; align-items: center; gap: 4px; }
.design-form .field input.color-hex { width: 8.2em; padding: 5px 6px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.design-form .field input.color-hex.bad-hex { border-color: var(--bad); background: var(--bad-bg); }
.cover-fill-row > span { display: contents; }
.cover-fill-row > span[hidden] { display: none; }
.cover-fill-row > .field:first-child { flex: 1 1 150px; }
.fill-gradient .button-small { align-self: flex-end; height: 30px; }
.cover-fill-row > .fill-preview { display: grid; place-items: center; width: 64px; height: 44px; flex: none; border-radius: 6px;
  border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.fill-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fill-preset { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.fill-preset:hover { border-color: var(--accent-line); background: var(--line-soft); }
.fill-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(127,127,127,.4); flex: none; }
.check-field { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); }
.hint { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 400; }
p.hint { margin: 0; line-height: 17px; }
.field .hint { margin-left: 4px; }
.margins .field { flex: 1 1 64px; }
.band-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.band-set + .band-set { margin-top: 12px; }
.band-set legend { font-size: 13px; font-weight: 600; padding: 0 0 4px; }
.band-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tokens { line-height: 24px; }
.token { border: 1px solid var(--line); background: var(--line-soft); color: var(--ink); border-radius: 6px; padding: 0 5px; font: 11.5px var(--mono); cursor: pointer; }
.token:hover { border-color: var(--accent-line); color: var(--accent); }
.layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.layout-card { display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 12px; line-height: 15px; }
.layout-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-bg); }
.layout-card input { position: absolute; opacity: 0; pointer-events: none; }
.layout-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.layout-name em { display: block; }
.layout-thumb { position: relative; display: block; aspect-ratio: 8.5 / 11; border-radius: 4px; background: #111; overflow: hidden; border: 1px solid var(--line); }
.layout-thumb i, .layout-thumb b, .layout-thumb u { position: absolute; display: block; }
.thumb-hero i { left: 12%; right: 12%; top: 10%; height: 34%; background: #7d8792; outline: 1px solid #B3FF34; }
.thumb-hero b { left: 25%; right: 25%; top: 56%; height: 6%; background: #fff; }
.thumb-hero u { left: 32%; right: 32%; bottom: 9%; height: 7%; background: #fff; }
.thumb-full i { inset: 0; background: linear-gradient(#8d97a3, #4f5862 60%, #111); }
.thumb-full b { left: 10%; width: 55%; bottom: 20%; height: 7%; background: #fff; }
.thumb-full u { left: 10%; width: 35%; bottom: 8%; height: 6%; background: #fff; }
.thumb-light { background: #fff; }
.thumb-light b { left: 10%; width: 60%; top: 10%; height: 7%; background: #222; }
.thumb-light i { left: 10%; right: 10%; top: 26%; height: 40%; background: #9aa3ad; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.thumb-light u { left: 10%; width: 30%; bottom: 8%; height: 6%; background: #222; }
.thumb-title b { left: 15%; right: 15%; top: 42%; height: 9%; background: #fff; }
.thumb-title u { left: 32%; right: 32%; bottom: 9%; height: 7%; background: #fff; }
.thumb-none { background: repeating-linear-gradient(-45deg, var(--line-soft) 0 6px, var(--surface) 6px 12px); }
.cover-picture-row { display: flex; align-items: flex-end; gap: 10px; }
.cover-thumb { width: 64px; height: 44px; object-fit: contain; background: #111; border-radius: 5px; flex: none; }
.heading-table { width: 100%; border-collapse: collapse; }
.heading-table th, .heading-table td { padding: 3px 4px; text-align: left; font-weight: 500; }
.heading-table thead th { color: var(--muted); font-weight: 500; }
.heading-table tbody th { font-weight: 500; }
.heading-table tbody th .hint { display: block; margin: 0; }
.heading-table input[type="number"] { width: 64px; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.heading-table select { font: inherit; font-size: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.include-list { display: flex; flex-direction: column; gap: 2px; }
.include-page { display: grid; grid-template-columns: auto 1fr; gap: 0 7px; align-items: center; padding: 3px 0; flex: 1; min-width: 0; }
.include-page .mono { grid-column: 2; font-size: 11px; }
.include-row { display: flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: 6px; font-size: 13px; color: var(--ink); }
.include-row[draggable="true"] { cursor: grab; }
.include-row[draggable="true"]:hover { background: var(--line-soft); }
.include-row.dragging { opacity: .45; }
.include-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.include-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.include-row.left-out .include-page > span { color: var(--muted); }
.include-row .grip { width: 14px; flex: none; color: var(--muted); font-size: 15px; line-height: 1; text-align: center; user-select: none; }
.include-fixed { color: var(--muted); }
.include-fixed .include-page, .contents-row .include-page { grid-template-columns: 1fr; padding: 5px 0; }
.contents-row .include-page > span:first-child { font-weight: 600; }
.order-moves { display: inline-flex; gap: 2px; flex: none; }
.order-moves button { width: 22px; height: 22px; text-align: center; border-radius: 5px; }
.order-moves button:hover:not(:disabled) { background: var(--accent-bg); }
.order-moves button:disabled { opacity: .3; cursor: default; }
.dialog { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; width: min(460px, 92vw); background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog-wide { width: min(620px, 94vw); }
.dialog::backdrop { background: rgba(10,14,20,.45); }
.change-list { margin: 0; padding-left: 18px; max-height: 220px; overflow-y: auto; font-family: var(--mono); }

/* --- a manual page, as the plugin shows it and as it prints --- */
.doc { padding: 22px 26px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.doc h1, .doc h2, .doc h3, .doc h4 { margin: 1.3em 0 .5em; line-height: 1.25; }
.doc h1 { font-size: 1.6em; } .doc h2 { font-size: 1.35em; } .doc h3 { font-size: 1.12em; }
.doc > :first-child { margin-top: 0; }
.doc p, .doc ul, .doc ol, .doc table, .doc blockquote, .doc pre { margin: 0 0 1em; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li + li { margin-top: .3em; }
.doc img { max-width: 100%; height: auto; border-radius: 4px; }
.doc img.missing { min-width: 160px; min-height: 60px; outline: 2px dashed var(--bad); }
.doc a.missing { color: var(--bad); text-decoration: wavy underline; }
.doc table { border-collapse: collapse; width: 100%; font-size: .95em; }
.doc th, .doc td { padding: 6px 10px; border: 1px solid; text-align: left; vertical-align: top; }
.doc code { font-family: var(--mono); font-size: .9em; padding: 1px 5px; border-radius: 4px; }
.doc pre code { display: block; padding: 10px 12px; overflow-x: auto; }
.doc blockquote { padding: 8px 14px; border-left: 3px solid; border-radius: 0 6px 6px 0; }
.doc hr { border: 0; border-top: 1px solid; margin: 1.5em 0; }
/* The plugin's docs panel: HISE's dark markdown look */
.doc-plugin { background: #262626; color: #D8D8D8; font-family: "Lato", "Segoe UI", system-ui, sans-serif; }
.doc-plugin h1, .doc-plugin h2, .doc-plugin h3, .doc-plugin h4 { color: #FFFFFF; }
.doc-plugin a { color: #90FFB1; }
.doc-plugin th, .doc-plugin td { border-color: #444; } .doc-plugin th { background: #333; }
.doc-plugin code { background: #333; color: #E6DB74; }
.doc-plugin blockquote { background: #303030; border-color: #90FFB1; color: #CFCFCF; }
.doc-plugin hr { border-color: #444; }

/* --- proposals and who changed what --- */
.working { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.working-proposal { background: var(--accent-bg); border-color: var(--accent-line); }
.working .controls { gap: 14px; }
.banner-info { background: var(--accent-bg); border-color: var(--accent-line); }
.lead { max-width: 860px; }
.badge-ai { background: #EFE3FF; color: #5B2BB5; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.ai-mark { font-size: 10px; font-weight: 700; color: #5B2BB5; letter-spacing: .3px; }
@media (prefers-color-scheme: dark) { .badge-ai { background: #2E2147; color: #CDB4FF; } .ai-mark { color: #CDB4FF; } }
.proposal-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 0;
  border-top: 1px solid var(--line-soft); }
.proposal-row:first-of-type { border-top: 0; }
.proposal-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proposal-title { font-weight: 600; font-size: 16px; text-decoration: none; }
.proposal-title:hover { text-decoration: underline; }
.commit-list { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.tree-page { grid-template-areas: "title state" "file error" "edit edit"; }
.tree-edit { grid-area: edit; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the composer's history and line authors */
.editor-row { flex: 1 1 auto; min-height: 0; display: flex; }
.editor-row > .editor-box { flex: 1 1 auto; min-width: 0; }
.history-pane { flex: 0 0 300px; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface); }
.history-note { padding: 0 12px 6px; }
.history-list { list-style: none; margin: 0; padding: 0 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.history-item { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.history-item:hover { background: var(--line-soft); }
.history-who { font-weight: 600; font-size: 13px; }
.history-what { overflow-wrap: anywhere; }
.cm-authors .cm-gutterElement { padding: 0 6px 0 3px; }
.cm-author { display: block; height: 100%; min-width: 26px; padding-left: 5px; border-left: 3px solid hsl(var(--who) 60% 50%);
  font: 600 10.5px/1.9 var(--font); color: hsl(var(--who) 55% 38%); }
.cm-author.ai { border-left-style: dashed; }
@media (prefers-color-scheme: dark) { .cm-author { color: hsl(var(--who) 70% 72%); } }
.dialog-diff { width: min(980px, 96vw); }
.diff-box { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.diff-box .cm-editor { max-height: 62vh; }

/* the review */
.review { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 900px) { .review { grid-template-columns: minmax(0, 1fr); } }
.review-head h2 { font-size: 20px; line-height: 26px; }
.file-list { display: flex; flex-direction: column; padding: 0 6px; }
.file-list .tree-page { grid-template-areas: "title state" "file file" "edit edit"; }
.file-list .tree-page > .small { grid-area: edit; }
.notes-list { list-style: none; margin: 0; padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.notes-list p { margin: 2px 0 0; white-space: pre-wrap; }
.comment-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; }
.comment-form textarea { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; resize: vertical; }
.review-file-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-tools { display: flex; margin-left: auto; }
.review-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.review-body > .cm-editor { min-height: 100%; }
.review-body.left-out { opacity: .55; }
.review-overview { margin: 0; }
.review-tools [aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }

/* what changed, to read: each change a card, the unchanged parts folded between them */
.read { display: flex; flex-direction: column; gap: 10px; padding: 14px; max-width: 980px; margin: 0 auto; }
.chg-card { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); }
.chg-card.chg-left { border-left-color: var(--muted); }
.chg-card.chg-edited, .chg-card.chg-own { border-left-color: var(--wait); }
.chg-card.chg-new { border-left-color: var(--ok); }
.chg-card.chg-gone { border-left-color: var(--bad); }
.chg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.chg-n { font-weight: 600; font-size: 13px; }
.chg-where { color: var(--muted); font-size: 13px; }
.chg-count { margin-right: auto; }
.chg-stand { margin: 0; padding: 6px 12px; background: var(--line-soft); color: var(--muted); }
.chg-edited .chg-stand, .chg-own .chg-stand { background: var(--wait-bg); color: var(--wait); }
.chg-left .chg-body { opacity: .5; }
.chg-gone .chg-body .doc-read { text-decoration: line-through; text-decoration-color: var(--bad-line); }
.keep-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.keep-switch button { border: 0; background: var(--surface); color: var(--muted); font: 600 12.5px var(--font); padding: 5px 12px; cursor: pointer; }
.keep-switch button + button { border-left: 1px solid var(--line); }
.keep-switch button:hover { color: var(--ink); }
.keep-switch button[aria-pressed="true"][data-decide="kept"], .keep-switch button[aria-pressed="true"][data-keep="1"] { background: var(--ok-bg); color: var(--ok); }
.keep-switch button[aria-pressed="true"][data-decide="left"], .keep-switch button[aria-pressed="true"][data-keep="0"] { background: var(--bad-bg); color: var(--bad); }
.doc-read { padding: 14px 18px; font-size: 15px; background: var(--surface); color: var(--ink); border-radius: 0 0 10px 10px; }
.doc-read th, .doc-read td { border-color: var(--line); } .doc-read th { background: var(--line-soft); }
.doc-read code { background: var(--line-soft); }
.doc-read blockquote { background: var(--line-soft); border-color: var(--accent-line); }
.doc-read hr { border-color: var(--line); }
.doc-read img { max-height: 320px; width: auto; }
ins.chg { background: var(--ok-bg); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px var(--ok-line); }
del.chg { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; border-radius: 3px; padding: 0 1px; }
/* a block that came or went whole: tinted, a bar beside it, its words not boxed one by one */
.doc-read > .blk-ins, .doc-read > .blk-del { margin-left: -13px; padding: 2px 8px 2px 10px; border-left: 3px solid var(--ok); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--ok-bg) 60%, transparent); }
.doc-read > .blk-del { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 60%, transparent); }
.doc-read > ul.blk-ins, .doc-read > ol.blk-ins, .doc-read > ul.blk-del, .doc-read > ol.blk-del { padding-left: calc(1.4em + 10px); }
.doc-read li.blk-ins, .doc-read tr.blk-ins > * { background: color-mix(in srgb, var(--ok-bg) 60%, transparent); }
.doc-read li.blk-del, .doc-read tr.blk-del > * { background: color-mix(in srgb, var(--bad-bg) 60%, transparent); }
.doc-read .blk-ins ins.chg, .doc-read .blk-del del.chg { background: none; box-shadow: none; padding: 0; }
.doc-read > table.blk-ins, .doc-read > table.blk-del { margin-left: 0; padding: 0; border-left: 0; background: none; }
.doc-read img.chg-ins { outline: 3px solid var(--ok); outline-offset: 2px; }
.doc-read img.chg-del { outline: 3px solid var(--bad); outline-offset: 2px; opacity: .55; }
.plain-diff { padding: 10px 14px; font: 12.5px/1.65 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.plain-diff + .doc-read { border-top: 1px solid var(--line-soft); }
.pl-del { background: color-mix(in srgb, var(--bad-bg) 55%, transparent); } .pl-ins { background: color-mix(in srgb, var(--ok-bg) 55%, transparent); }
.pl-del del.chg, .pl-ins ins.chg { background: none; box-shadow: none; }
.read-gap { display: flex; flex-direction: column; }
.gap-bar { align-self: center; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; padding: 2px 10px; cursor: pointer; border-radius: 6px; }
.gap-bar:hover { background: var(--line-soft); color: var(--ink); }
.gap-bar::before, .gap-bar::after { content: " ··· "; opacity: .6; }
.gap-body { display: none; opacity: .8; }
.read-gap.shown .gap-body, .read.whole .gap-body { display: block; }
.read.whole .gap-bar { display: none; }

/* a PDF design: its settings, and the PDF before and after */
.design-review { display: flex; flex-direction: column; }
.set-parts { display: flex; flex-direction: column; gap: 14px; padding: 4px 14px 14px; }
.set-title { margin: 0; font-size: 15px; font-weight: 600; }
.set-part h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.set-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.set-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 18px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 7px 12px; }
.set-row + .set-row { border-top: 1px solid var(--line-soft); }
.set-name { font-weight: 600; font-size: 13.5px; }
.set-was { color: var(--muted); } .set-now { font-weight: 500; } .set-arrow { color: var(--muted); }
.set-was, .set-now { overflow-wrap: anywhere; font-size: 14px; }
.set-out .set-now { text-decoration: line-through; color: var(--muted); font-weight: 400; } .set-out .set-was { color: var(--ink); }
.set-colour { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 4px; border: 1px solid var(--line); }
.set-page { font-family: var(--mono); font-size: 12.5px; }
@media (max-width: 760px) { .set-row { grid-template-columns: 1fr 18px 1fr; } .set-name, .set-row .keep-switch { grid-column: 1 / -1; justify-self: start; } }
.pdf-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 14px 0; }
.pdf-compare figure { margin: 0; min-width: 0; }
.pdf-box { position: relative; height: min(64vh, 600px); border-radius: 8px; overflow: hidden; background: #5F646C; }
.pdf-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #E6E9EE; }
.pdf-wait.bad { color: #FFD3CE; padding: 0 16px; text-align: center; }
.pdf-compare-note { margin: 0; padding: 8px 14px 10px; }
@media (max-width: 760px) { .pdf-compare { grid-template-columns: 1fr; } }

/* the list of proposals: what each changes */
.proposal-files { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.proposal-files li { padding: 1px 8px; border-radius: 6px; background: var(--line-soft); font-size: 12.5px; }
.proposal-files b { font-weight: 600; }
.review-note { margin: 0; padding: 10px 14px; background: var(--wait-bg); border-bottom: 1px solid var(--wait-line); }
.deleted-file .cm-content { text-decoration: line-through; text-decoration-color: var(--bad); }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.before-after .doc { border-radius: 8px; max-height: none; }
.before-after.images img { max-width: 100%; border-radius: 6px; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.ba-label { margin: 0 0 4px; color: var(--muted); font-weight: 600; }
.bad-button { color: var(--bad); border-color: var(--bad-line); }
.bad-button:hover:not(:disabled) { background: var(--bad-bg); border-color: var(--bad); }
.cm-chunkButtons button { font: 600 11px var(--font); border-radius: 5px; border: 1px solid var(--line); padding: 1px 8px; cursor: pointer; }
.cm-chunkButtons button[name="accept"] { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.cm-chunkButtons button[name="reject"] { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* the assistant, beside the composer */
.composer.with-assistant { grid-template-columns: 240px minmax(0, 1fr) minmax(300px, 380px); }
@media (max-width: 1300px) { .composer.with-assistant { grid-template-columns: 220px minmax(0, 1fr) 320px; } }
.composer.full.with-assistant { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
@media (max-width: 900px) { .composer.with-assistant, .composer.full.with-assistant { grid-template-columns: minmax(0, 1fr); } }
.assistant-pane { min-width: 0; height: var(--pane-height); min-height: 420px; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.assistant-pane[hidden] { display: none; }
.assistant-model { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-sees { margin: 0; padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.assistant-off { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.assistant-off p { margin: 0; }
.assistant-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; max-width: 88%; padding: 7px 11px; border-radius: 12px 12px 3px 12px; background: var(--accent-bg); white-space: pre-wrap; }
.msg-ai.doc { padding: 0 2px; font-size: 13.5px; line-height: 1.5; }
.msg-ai.doc > :last-child { margin-bottom: 0; }
.msg-ai.doc p, .msg-ai.doc ul, .msg-ai.doc ol { margin: 0 0 .6em; }
.msg-ai.doc h1, .msg-ai.doc h2, .msg-ai.doc h3 { font-size: 1em; margin: .8em 0 .3em; }
.msg-ai.doc pre { white-space: pre-wrap; font-size: 12px; background: var(--line-soft); padding: 8px; border-radius: 6px; }
.msg-ai.doc code { font-family: var(--mono); font-size: 12px; }
.msg-tool { padding-left: 9px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.msg-error { padding: 6px 10px; border-radius: 8px; background: var(--bad-bg); border: 1px solid var(--bad-line); overflow-wrap: anywhere; }
.msg-busy { display: flex; align-items: center; gap: 6px; }
.dots::before { content: "\2022\2022\2022"; letter-spacing: 2px; animation: kd-pulse 1.2s ease-in-out infinite; }
@keyframes kd-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dots::before { animation: none; } }
.msg-hello p { margin: 0; } .msg-hello ul { margin: 4px 0 0; padding-left: 18px; }
.suggestion { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; }
.suggestion-open { border-color: var(--accent-line); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.suggestion p { margin: 0; }
.suggestion-head { font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.assistant-ask { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.assistant-ask textarea, .settings textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; resize: vertical; }
.assistant-ask textarea { min-height: 60px; }
.view-assistant { margin-left: auto; }
.view-assistant + .view-full { margin-left: 0; }
.suggest-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* the Settings page */
.settings { max-width: 880px; }
.settings-lede { margin: 0; max-width: 720px; }
.settings-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.settings-group legend { padding: 0 6px; font-weight: 600; font-size: 14px; color: var(--ink); }
.settings-group p { margin: 0; }
.preset-row { gap: 4px 12px; color: var(--muted); }
.check-list { list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--line-soft); }
.assistant-pane .pane-head .link-button { white-space: nowrap; }

/* the sign-in screen */
.main.signin-main { min-height: calc(100vh - 52px); max-width: none; justify-content: center; align-items: center; gap: 14px; padding: 32px 16px; }
.signin-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 26px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.07); }
.signin-card h1 { font-size: 22px; line-height: 28px; margin: 0; }
.signin-card p { margin: 0; }
.signin-card .muted { margin-top: 2px; }
.signin-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: var(--surface);
  font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.signin-button { min-height: 44px; font-size: 15px; width: 100%; }
.signin-dev { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.signin-dev .button { width: 100%; }
.signin-foot { max-width: 420px; text-align: center; margin: 0; }

/* --- pictures in buttons --- */
.icon { flex: 0 0 auto; vertical-align: -4px; }
.button .icon { margin-right: 4px; }
.button[aria-label] .icon:only-child, .view-full .icon { margin-right: 0; }
.tool-group button { display: inline-flex; align-items: center; gap: 6px; }
.tool-group select { min-height: 30px; padding: 0 26px 0 10px; border: 0; background-color: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.tool-group select:hover { background-color: var(--line-soft); }
.tool-group[hidden] { display: none; }

/* --- the page's title, as a title; its details folded away --- */
.title-row { display: flex; align-items: center; gap: 10px; }
.page-title { flex: 1 1 auto; min-width: 0; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink);
  font: 600 22px/30px var(--font); }
.page-title:hover { border-color: var(--line); }
.page-title:focus { border-color: var(--accent-line); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
.page-title::placeholder { color: var(--muted); font-weight: 400; }
.title-row [aria-expanded="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
/* the products page: what's waiting for review, beside each name */
.chip { display: inline-block; max-width: 320px; padding: 1px 10px; border-radius: 999px; background: var(--accent-bg); color: var(--accent);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.chip:hover { text-decoration: underline; }
/* Help */
.help { max-width: 860px; display: flex; flex-direction: column; gap: 14px; }
.help .card { gap: 8px; }
.help h2 { font-size: 18px; }
.help ol, .help ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.help dt { font-weight: 600; } .help dd { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .help dl { grid-template-columns: 1fr; } }
.page-details { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 2px; }
.page-details .meta-grid { grid-template-columns: minmax(200px, 2fr) minmax(120px, 1fr) 130px 120px; }
@media (max-width: 1100px) { .page-details .meta-grid { grid-template-columns: 1fr 1fr; } }

/* --- Write: the page as it reads, on a sheet --- */
.rich-box { overflow: auto; background: var(--line-soft); cursor: text; }
.doc-write { max-width: 860px; min-height: calc(100% - 36px); margin: 18px auto; padding: 40px 56px 80px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.06); font-size: 16px; line-height: 1.65; outline: none; cursor: auto; }
@media (max-width: 1000px) { .doc-write { margin: 0; padding: 24px 22px 60px; border: 0; border-radius: 0; min-height: 100%; } }
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; }
.ProseMirror pre { white-space: pre-wrap; }
.ProseMirror li { position: relative; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror-selectednode { outline: 3px solid var(--accent); outline-offset: 2px; }
li.ProseMirror-selectednode { outline: none; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 2px solid var(--ink); animation: kad-blink 1.1s steps(2, start) infinite; }
@keyframes kad-blink { to { visibility: hidden; } }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.doc-write h1 { font-size: 1.7em; } .doc-write h2 { font-size: 1.4em; } .doc-write h3 { font-size: 1.17em; } .doc-write h4 { font-size: 1em; }
.doc-write p { margin: 0 0 .9em; }
.doc-write li > p { margin-bottom: .25em; }
.doc-write a { color: var(--accent); cursor: text; }
.doc-write img { max-width: 100%; max-height: 420px; height: auto; border-radius: 4px; vertical-align: middle; cursor: pointer; }
.doc-write img.missing { display: inline-block; min-width: 180px; min-height: 64px; outline: 2px dashed var(--bad); background: var(--bad-bg); }
.doc-write th, .doc-write td { position: relative; min-width: 60px; border-color: var(--line); }
.doc-write th { background: var(--line-soft); font-weight: 600; }
.doc-write .selectedCell::after { content: ""; position: absolute; inset: 0; z-index: 2; background: color-mix(in srgb, var(--accent) 16%, transparent); pointer-events: none; }
.doc-write blockquote { margin-left: 0; margin-right: 0; background: var(--accent-bg); border-color: var(--accent); }
.doc-write blockquote > :last-child { margin-bottom: 0; }
.doc-write code { background: var(--line-soft); }
.doc-write pre { padding: 10px 12px; border-radius: 6px; background: var(--line-soft); font-family: var(--mono); font-size: .9em; }
.doc-write pre code { padding: 0; background: none; }
.doc-write hr { border-color: var(--line); }
.doc-write .is-empty::before { content: attr(data-placeholder); float: left; height: 0; color: var(--muted); pointer-events: none; }
.kad-misspelled { text-decoration: underline wavy var(--bad); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.spell-menu { position: fixed; z-index: 80; min-width: 190px; max-width: 320px; padding: 5px; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.spell-menu button { padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.spell-menu button:hover, .spell-menu button:focus { background: var(--accent-bg); outline: none; }
.spell-menu .spell-word { font-weight: 600; }
.spell-menu .spell-word:last-of-type { margin-bottom: 4px; }
.spell-menu p { margin: 0; padding: 6px 10px; color: var(--muted); font-size: 13px; }
.spell-menu button:not(.spell-word) { border-top: 1px solid var(--line-soft); border-radius: 0 0 6px 6px; color: var(--muted); }
.spell-menu button:not(.spell-word):hover { color: var(--ink); }

/* --- saving, in plain words; how it works, for who asks --- */
.savebar #save { display: inline-flex; align-items: center; gap: 4px; }
.savebar-how { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.how { display: inline-block; }
.how > summary { display: inline; color: var(--accent); cursor: pointer; list-style: none; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary:hover { text-decoration: underline; }
.how[open] { display: block; flex-basis: 100%; }
.how[open] > summary { display: block; margin-bottom: 4px; }
.how > span, .how > div { display: block; max-width: 900px; color: var(--muted); }
.dialog .how { display: block; }
.flash a { margin-left: 6px; font-weight: 600; }

/* --- feedback on KA Docs itself: Report a problem on every page, the list, a request --- */
.nav-count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--surface);
  font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; vertical-align: 1px; }
.report-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.report-button:hover { color: var(--ink); border-color: var(--accent-line); background: var(--line-soft); }
.report-button .icon { width: 16px; height: 16px; vertical-align: 0; }
@media (max-width: 1000px) {
  .report-button { padding: 0 8px; }
  .report-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* The dialog: what it is (three to choose from), a few words, the rest, pictures. */
.report { max-height: 94vh; overflow-y: auto; }
.report-kinds { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.report-kinds label { position: relative; cursor: pointer; }
.report-kinds input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.report-kinds label > span { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 8px; height: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; }
.report-kinds .icon { vertical-align: 0; color: var(--muted); }
.report-kinds b { font-weight: 600; }
.report-kinds small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 16px; }
.report-kinds label:hover > span { border-color: var(--accent-line); }
.report-kinds input:checked + span { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.report-kinds input:checked + span .icon { color: var(--accent); }
.report-kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .report-kinds { grid-template-columns: minmax(0, 1fr); } }
.report textarea, .reply-form textarea { font: inherit; font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 84px; }
.report [data-error]:empty, .reply-form [data-error]:empty { display: none; }
.picture-picker { display: flex; flex-direction: column; gap: 8px; }
.picture-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.picture-strip figure { position: relative; margin: 0; width: 104px; height: 78px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line-soft); }
.picture-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.picture-strip button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(20,23,28,.78);
  color: #FFFFFF; font-size: 16px; line-height: 20px; cursor: pointer; }
.picture-strip button:hover { background: var(--bad); }

/* The list: a request a pill, as a product is on its page. */
.list-filters a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap; }
.list-filters a:hover { color: var(--ink); }
.list-filters a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.request-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.request-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 168px; align-items: center; gap: 0 12px; padding: 9px 14px 9px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.request-row:hover { border-color: var(--accent-line); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.request-kind { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.request-kind .icon { width: 20px; height: 20px; vertical-align: 0; }
.kind-problem { background: var(--bad-bg); color: var(--bad); }
.kind-improvement { background: var(--accent-bg); color: var(--accent); }
.kind-feature { background: var(--wait-bg); color: var(--wait); }
.request-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; color: var(--ink); text-decoration: none; }
.request-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-number { color: var(--muted); font-weight: 500; }
.request-main:hover .request-title { color: var(--accent); text-decoration: underline; }
.request-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-counts { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.request-counts .icon { width: 15px; height: 15px; vertical-align: -3px; }
.news { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 11px; line-height: 18px; font-weight: 700; }
.news-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.request-row .status { justify-self: end; }
.request-empty { align-items: flex-start; }
@media (max-width: 760px) {
  .request-row { grid-template-columns: 36px minmax(0, 1fr); gap: 6px 12px; }
  .request-title, .request-meta { white-space: normal; }
  .request-counts, .request-row .status { grid-column: 2; justify-self: start; }
  .request-counts:empty { display: none; }
}

/* Where a request stands: a word in a pill, with a mark that isn't its colour alone. */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; line-height: 20px; font-weight: 600;
  white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status .icon { width: 13px; height: 13px; stroke-width: 3; vertical-align: 0; }
.status-new { background: var(--line-soft); color: var(--muted); }
.status-question { background: var(--wait-bg); color: var(--wait); box-shadow: inset 0 0 0 1px var(--wait-line); }
.status-planned { background: var(--accent-bg); color: var(--accent); }
.status-doing { background: var(--accent); color: var(--surface); }
.status-done { background: var(--ok-bg); color: var(--ok); }
.status-declined { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.status-declined i { background: none; border: 1.5px solid currentColor; }

/* A request: what was asked and said on the left; where it stands on the right. */
.request { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .request { grid-template-columns: minmax(0, 1fr); } }
.request-column, .request-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.request-head { display: flex; align-items: flex-start; gap: 12px; }
.request-head h1 { font-size: 22px; line-height: 28px; overflow-wrap: anywhere; }
.request-text { max-width: 780px; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-pictures { display: flex; flex-wrap: wrap; gap: 10px; }
.request-pictures a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line-soft); }
.request-pictures a:hover { border-color: var(--accent); }
.request-pictures img { display: block; width: auto; height: auto; max-width: min(100%, 420px); max-height: 280px; }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.thread-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg);
  scroll-margin-top: 70px; }
.thread-moved { border-color: var(--line); }
.thread-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.thread-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.reply-form { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--muted); }
.step-mark { position: relative; z-index: 1; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line);
  border-radius: 50%; background: var(--surface); }
.step-mark .icon { width: 12px; height: 12px; stroke-width: 3.5; vertical-align: 0; }
.step:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 28px; width: 2px; height: calc(100% - 22px); background: var(--line); }
.step-done { color: var(--ink); }
.step-done .step-mark { border-color: var(--ok); background: var(--ok); color: var(--surface); }
.step-done:not(:last-child)::after { background: var(--ok); }
.step-now { color: var(--ink); font-weight: 600; }
.step-now .step-mark { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.step-now .step-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 13.5px; line-height: 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
[data-vote][aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
/* On a phone the top bar is two lines, and scrolls away with the page: its menu under its name, to be swiped along. */
@media (max-width: 700px) {
  .topbar { position: static; flex-wrap: wrap; gap: 2px 10px; padding: 8px 16px 2px; }
  .topnav { order: 5; flex: 1 0 100%; overflow-x: auto; margin: 0 -6px; }
  .topnav a { white-space: nowrap; }
  .list-bar { top: 0; }
}
