/* Folio. The desk is quiet so the page can be read. */
:root {
  --top: 52px; --bar: 46px; --kb: 0px; --u: 1in;
}
/* Light: a white page on a quiet desk. Every colour in Folio is one of these names, so a look is a list of values. */
:root, :root[data-theme=light] {
  color-scheme: light;
  --desk: #f3f1ec; --panel: #fbfaf7; --ink: #1d2733; --soft: #5b6673; --line: #dcd8cf; --accent: #2f5d8a; --accent-ink: #fff;
  --good: #2e7d4f; --look: #a86200; --fix: #b3261e;
  --paper: #fff; --paper-ink: #111; --paper-soft: #66717e; --paper-line: #e3e0d8; --paper-rule: #333; --paper-tint: #f1efe9;
  --field: #fff; --field-ink: #111;
  --guide: #b9c9dc; --guide-ink: #6b8099; --note-ink: #1d4f85; --cite-line: #7a94b3;
  --excerpt: #fbf3dc; --found: #ffe08a; --found-here: #ffb347; --marked-ink: inherit;
  --hl-issue: rgba(255, 196, 61, .45); --hl-here: rgba(255, 140, 40, .6); --hl-find: rgba(120, 190, 255, .55);
  --notice: #f3f6fa; --notice-line: #d5dde7; --notice-2: #fbf6e9; --notice-2-line: #e6dcc0;
  --tip: #1d2733; --tip-ink: #fff; --scrim: rgba(15, 20, 28, .42);
  --shadow: 0 1px 3px rgba(20, 30, 40, .16), 0 8px 28px rgba(20, 30, 40, .10);
}
/* Dark: for the late hours. The page is dark too, so nothing on the screen is bright. */
:root[data-theme=dark] {
  color-scheme: dark;
  --desk: #121417; --panel: #1c1f24; --ink: #e8e6e1; --soft: #9aa3ad; --line: #343942; --accent: #7fb0e0; --accent-ink: #0e1c2a;
  --good: #6cc492; --look: #e6a94d; --fix: #f08a80;
  --paper: #1e2227; --paper-ink: #e6e3dc; --paper-soft: #98a1ab; --paper-line: #353a43; --paper-rule: #8b929b; --paper-tint: #2a2f36;
  --field: #14171b; --field-ink: #e8e6e1;
  --guide: #3d4651; --guide-ink: #8496aa; --note-ink: #8fc0f0; --cite-line: #5f7b99;
  --excerpt: #3a3320; --found: #6b5a1c; --found-here: #8a5a16; --marked-ink: #161616;
  --hl-issue: rgba(255, 196, 61, .30); --hl-here: rgba(255, 140, 40, .50); --hl-find: rgba(90, 160, 240, .45);
  --notice: #232a33; --notice-line: #36414e; --notice-2: #2c2819; --notice-2-line: #4a4226;
  --tip: #e8e6e1; --tip-ink: #14171b; --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 28px rgba(0, 0, 0, .35);
}
/* Sepia: the warmth of old paper, gentler than white over a long sitting. */
:root[data-theme=sepia] {
  color-scheme: light;
  --desk: #e6dbc3; --panel: #f1e7d1; --ink: #3a2e1f; --soft: #78674f; --line: #d3c3a1; --accent: #8a5426; --accent-ink: #fff8ea;
  --good: #4d7335; --look: #9a5b00; --fix: #a3321f;
  --paper: #f8f0dc; --paper-ink: #2f2518; --paper-soft: #7b6b54; --paper-line: #e0d2b2; --paper-rule: #5a4a35; --paper-tint: #efe4c9;
  --field: #fcf6e6; --field-ink: #2f2518;
  --guide: #cdbb95; --guide-ink: #8a775a; --note-ink: #8a4a1c; --cite-line: #b39a6b;
  --excerpt: #f0e0b2; --found: #f2d277; --found-here: #e9a84a; --marked-ink: inherit;
  --hl-issue: rgba(230, 160, 40, .40); --hl-here: rgba(220, 110, 30, .50); --hl-find: rgba(140, 170, 120, .55);
  --notice: #efe4c9; --notice-line: #d8c8a2; --notice-2: #f3e3b8; --notice-2-line: #d9c48a;
  --tip: #3a2e1f; --tip-ink: #fbf3df; --scrim: rgba(50, 38, 20, .42);
  --shadow: 0 1px 3px rgba(70, 50, 20, .18), 0 8px 28px rgba(70, 50, 20, .12);
}
/* High contrast: white on black with nothing faint, for tired eyes, bright rooms and low vision. */
:root[data-theme=contrast] {
  color-scheme: dark;
  --desk: #000; --panel: #000; --ink: #fff; --soft: #e6e6e6; --line: #fff; --accent: #ffd60a; --accent-ink: #000;
  --good: #5dff95; --look: #ffd60a; --fix: #ff8a80;
  --paper: #000; --paper-ink: #fff; --paper-soft: #e6e6e6; --paper-line: #bdbdbd; --paper-rule: #fff; --paper-tint: #1c1c1c;
  --field: #000; --field-ink: #fff;
  --guide: #9a9a9a; --guide-ink: #fff; --note-ink: #ffd60a; --cite-line: #ffd60a;
  --excerpt: #2b2400; --found: #ffd60a; --found-here: #ff9f0a; --marked-ink: #000;
  --hl-issue: rgba(255, 214, 10, .45); --hl-here: rgba(255, 159, 10, .70); --hl-find: rgba(100, 210, 255, .55);
  --notice: #000; --notice-line: #fff; --notice-2: #000; --notice-2-line: #ffd60a;
  --tip: #fff; --tip-ink: #000; --scrim: rgba(0, 0, 0, .8);
  --shadow: 0 0 0 2px #fff;
}
:root[data-theme=contrast] button.plain, :root[data-theme=contrast] .chip, :root[data-theme=contrast] #toolbar button[aria-pressed=true], :root[data-theme=contrast] #tools button[aria-pressed=true] { border-color: currentColor; }
:root[data-theme=contrast] .page { outline: 2px solid #fff; }
:root[data-theme=contrast] .ql-editor a, :root[data-theme=contrast] a { color: var(--accent); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--desk); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow: hidden; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 11px; cursor: pointer; min-height: 36px; touch-action: manipulation; }
button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.plain { border-color: var(--line); background: var(--panel); }
button.danger { color: var(--fix); }
button.icon { padding: 6px 10px; font-size: 18px; line-height: 1; }
button[disabled] { opacity: .45; cursor: default; }
input[type=text], input[type=url], input[type=search], input[type=password], textarea, select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--field-ink); font-size: 16px; }
textarea { resize: vertical; min-height: 84px; }
label { display: block; font-size: 13px; color: var(--soft); margin: 10px 0 4px; }
label > input, label > select, label > textarea { margin-top: 4px; }
.grid2 > label { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; }
a { color: var(--accent); }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top */
#top { position: fixed; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center; gap: 6px; padding: 0 10px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right));
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 30; }
#doc-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 40px; flex: 0 1 auto; max-width: 34vw; cursor: text; padding: 4px 6px; border-radius: 6px; }
#doc-title:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; min-height: 28px; font-size: 13px; color: var(--soft); white-space: nowrap; }
.save { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--soft); white-space: nowrap; padding: 4px 9px; min-height: 30px; }
.save .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.save[data-state=unsaved] .dot { background: var(--look); }
.save[data-state=saving] .dot { background: var(--look); animation: pulse 1s infinite; }
.save[data-state=offline] .dot, .save[data-state=failed] .dot, .save[data-state=conflict] .dot, .save[data-state=signin] .dot { background: var(--fix); }
.save[data-state=offline], .save[data-state=failed], .save[data-state=conflict], .save[data-state=signin] { color: var(--fix); font-weight: 600; }
@keyframes pulse { 50% { opacity: .35; } }
#tools { margin-left: auto; display: flex; gap: 2px; }
#tools button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
#btn-more { display: none; margin-left: auto; }

/* ---------------------------------------------------------------- toolbar */
#toolbar { position: fixed; inset: var(--top) 0 auto 0; height: var(--bar); display: flex; align-items: center; gap: 2px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 29; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
#toolbar::-webkit-scrollbar { display: none; }
#toolbar button { min-width: 36px; padding: 5px 8px; flex: none; }
#toolbar button.wide { min-width: 132px; text-align: left; border-color: var(--line); background: var(--field); color: var(--field-ink); }
#toolbar button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
#toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 5px; flex: none; }
.sc-btn { font-variant: small-caps; }

/* ---------------------------------------------------------------- desk and page */
#desk { position: fixed; inset: calc(var(--top) + var(--bar)) 0 0 0; display: flex; }
#column { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#scroller { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 26px 16px 48px; scroll-padding: 80px 0 120px; overscroll-behavior: contain; }
.page { position: relative; width: calc(8.5 * var(--u)); max-width: 100%; min-height: calc(11 * var(--u)); margin: 0 auto; background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow);
  padding: calc(var(--margin, 1) * var(--u)); font-family: var(--font, "Times New Roman", Times, serif); font-size: var(--size, 12pt); line-height: var(--lh, 2.3); }
.page.guides { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(9 * var(--u) - 1px), var(--guide) calc(9 * var(--u) - 1px), var(--guide) calc(9 * var(--u))), linear-gradient(var(--paper), var(--paper));
  background-origin: content-box, border-box; background-clip: content-box, border-box; }
#running-head, #running-foot { position: absolute; left: calc(var(--margin, 1) * var(--u)); right: calc(var(--margin, 1) * var(--u)); display: flex; justify-content: space-between; color: var(--paper-soft); pointer-events: none; line-height: 1.2; }
#running-head { top: calc(.5 * var(--u)); }
#running-foot { bottom: calc(.45 * var(--u)); }
#running-head span, #running-foot span { flex: 1; } #running-head span:nth-child(2), #running-foot span:nth-child(2) { text-align: center; } #running-head span:nth-child(3), #running-foot span:nth-child(3) { text-align: right; }

.ql-container { font: inherit; height: auto; }
.ql-editor { padding: 0; overflow: visible; line-height: inherit; font: inherit; min-height: calc(3 * var(--u)); tab-size: 4; caret-color: var(--paper-ink); -webkit-user-select: text; user-select: text; word-wrap: break-word; }
.ql-editor.ql-blank::before { left: calc(var(--indent, .5) * var(--u)); right: 0; font-style: italic; color: var(--paper-soft); }
.ql-editor p { margin: 0; text-indent: calc(var(--indent, .5) * var(--u)); }
.ql-editor p.noindent-true, .ql-editor p[class*="ps-"], .ql-editor p.ql-align-center, .ql-editor p.ql-align-right, .ql-editor li, .ql-editor td p, .ql-editor blockquote { text-indent: 0; }
.ql-editor p.ps-title, .ql-editor p.ps-subtitle, .ql-editor p.ps-centered { text-align: center; }
.ql-editor p.ps-signature { text-align: right; line-height: 1.15; white-space: pre-wrap; }
.ql-editor p.ps-centered, .ql-editor p.ps-header_block { white-space: pre-wrap; }
.ql-editor p.ps-caption { text-align: center; font-style: italic; }
.ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4, .ql-editor h5, .ql-editor h6 { font-size: inherit; margin: 0; line-height: inherit; }
.ql-editor blockquote { border: 0; padding: 0; }
.ql-editor ol, .ql-editor ul { padding-left: calc(.5 * var(--u)); margin: 0; }
.ql-editor li { padding-left: calc(.25 * var(--u)); }
.ql-editor img { max-width: 100%; height: auto; vertical-align: middle; }
.ql-editor table { border-collapse: collapse; width: 100%; line-height: 1.3; margin: 6pt 0; }
.ql-editor td { border: 1px solid var(--paper-rule); padding: 3pt 5pt; }
.ql-editor a { color: inherit; text-decoration: underline; }
.ql-editor .sc { font-variant: small-caps; }
.ql-editor .cite { border-bottom: 1px dotted var(--cite-line); }
.ql-editor .ps-bibliography .cite, .ql-editor blockquote + p .cite { border-bottom: 0; }
.ql-editor .fn { cursor: pointer; }
.ql-editor .fn > span { vertical-align: super; font-size: .72em; line-height: 0; padding: 0 1px; color: var(--note-ink); }
.ql-editor .fn > span::after { counter-increment: fn; content: counter(fn); content: counter(fn) / ""; }
.ql-editor .pagebreak { height: 0; border-top: 1px dashed var(--guide-ink); margin: calc(var(--size, 12pt) * 1.1) 0; position: relative; text-indent: 0; line-height: 1; }
.ql-editor .pagebreak::after { content: "page break"; content: "page break" / ""; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: var(--paper); padding: 0 10px; font: 11px/16px -apple-system, "Segoe UI", sans-serif; color: var(--guide-ink); letter-spacing: .04em; }
::highlight(folio-issue) { background-color: var(--hl-issue); }
::highlight(folio-here) { background-color: var(--hl-here); }
::highlight(folio-find) { background-color: var(--hl-find); }
/* a highlighter's colours are made for dark ink: the words under one stay dark in the dark looks */
.ql-editor span[style*="background-color"], #footnotes span[style*="background"] { color: var(--marked-ink); }

#footnotes { margin-top: calc(var(--size, 12pt) * 2); font-size: var(--fn-size, 10pt); line-height: var(--fn-lh, 1.15); }
#footnotes:empty { display: none; }
#footnotes::before { content: ""; display: block; width: 33%; border-top: 1px solid var(--paper-rule); margin-bottom: 6pt; }
#footnotes .note { display: flex; gap: 4px; padding: 3px 4px; margin: 0 -4px; border-radius: 4px; cursor: pointer; }
#footnotes .note:hover { background: var(--paper-tint); }
#footnotes .note sup { flex: none; min-width: 1.1em; }
#footnotes .note .empty { color: var(--paper-soft); font-style: italic; }
#footnotes .sc { font-variant: small-caps; }

#status { flex: none; display: flex; align-items: center; gap: 4px 16px; padding: 3px 14px; min-height: 32px; border-top: 1px solid var(--line); background: var(--panel); color: var(--soft); font-size: 13px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
#status::-webkit-scrollbar { display: none; }
#status button { min-height: 26px; padding: 2px 8px; font-size: 13px; color: var(--soft); flex: none; }
#status .count { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; border-color: var(--line); }
#status .count small { font-weight: 400; color: var(--soft); margin-left: 6px; font-size: 12.5px; }
#status .goal { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
#status .goal i { display: block; width: 84px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
#status .goal i b { display: block; height: 100%; background: var(--good); }
#status .goal.over { color: var(--fix); font-weight: 600; } #status .goal.over i b { background: var(--fix); }
#status .push { margin-left: auto; }
table.counts { width: 100%; border-collapse: collapse; font-size: 14.5px; } table.counts td { padding: 6px 2px; border-bottom: 1px solid var(--line); } table.counts td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
table.counts td small { display: block; color: var(--soft); font-size: 12.5px; } table.counts tr.lead td { font-size: 17px; }

/* ---------------------------------------------------------------- proofreading view */
.page.proofing #editor, .page.proofing #footnotes { display: none; }
.page.proofing { background-image: none; background-clip: border-box; background-origin: padding-box; }
#proof { display: block; }
.proof-head { display: flex; gap: 14px; align-items: flex-start; font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--soft); background: var(--notice); border: 1px solid var(--notice-line); border-radius: 10px; padding: 10px 12px; margin: 0 0 18px; }
.proof-head.outside { background: var(--notice-2); border-color: var(--notice-2-line); margin-top: -8px; } .proof-head .plain { background: var(--field); color: var(--field-ink); border-color: var(--line); }
.proof-head b { color: var(--ink); } .proof-head button { flex: none; } .proof-head button.primary { color: var(--accent-ink); }
#proof textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; overflow: hidden; background: transparent; color: inherit; padding: 0; margin: 0; border-radius: 0;
  font-family: var(--font, "Times New Roman", Times, serif); font-size: var(--size, 12pt); line-height: 1.75; white-space: pre-wrap; overflow-wrap: break-word; }
#proof-text { min-height: calc(4 * var(--u)); }
#proof-notes { margin-top: 22px; } #proof-notes .rule { width: 33%; border-top: 1px solid var(--paper-rule); margin-bottom: 8px; }
.proof-row { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 6px; } .proof-row sup { flex: none; min-width: 1.2em; padding-top: 6px; font-size: 10pt; }
#proof .proof-note { font-size: var(--fn-size, 10pt); line-height: 1.5; min-height: 1.6em; }
body.proofing #toolbar > * { opacity: .35; pointer-events: none; }
#tools button[data-proof][aria-pressed=true] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* ---------------------------------------------------------------- welcome */
#welcome { max-width: 760px; margin: 4vh auto 0; }
#welcome h1 { font: 600 30px/1.2 Georgia, "Times New Roman", serif; }
#welcome .lede { color: var(--soft); margin: 6px 0 22px; font-size: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; display: block; width: 100%; min-height: 0; }
.card:hover { border-color: var(--accent); background: var(--panel); }
.card[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.card b { display: block; font-size: 16px; }
.card small { color: var(--soft); display: block; margin-top: 3px; line-height: 1.35; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.muted { color: var(--soft); } .small { font-size: 13px; } .fine { font-size: 12.5px; color: var(--soft); line-height: 1.45; }

/* ---------------------------------------------------------------- side panel */
#panel { width: 400px; max-width: 46vw; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
#panel > header { display: flex; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
#panel > header h2 { font-size: 16px; flex: 1; }
#panel-body { overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 40px; flex: 1; overscroll-behavior: contain; }
#panel-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 20px 0 8px; }
#panel-body h3:first-child { margin-top: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px -16px 14px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border-radius: 0; border-bottom: 2px solid transparent; padding: 8px 10px; white-space: nowrap; color: var(--soft); }
.tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin: 0 0 10px; background: var(--paper); color: var(--paper-ink); }
.item .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--paper-soft); }
.item .citation { display: block; font: 14px/1.45 "Times New Roman", Times, serif; margin: 4px 0 2px; padding-left: 1.4em; text-indent: -1.4em; overflow-wrap: anywhere; }
.item .warn { font-size: 12.5px; color: var(--look); margin: 4px 0 0; }
.item .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.item .acts button { min-height: 32px; padding: 4px 10px; font-size: 13.5px; border-color: var(--paper-line); color: var(--paper-ink); }
.item .acts button.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.item .acts button.danger { color: var(--fix); }
.pill { display: inline-block; font-size: 11.5px; border-radius: 999px; padding: 1px 8px; border: 1px solid currentColor; }
.pill.good { color: var(--good); } .pill.look { color: var(--look); } .pill.fix { color: var(--fix); }
.rules { margin: 0; padding-left: 18px; font-size: 13.5px; } .rules li { margin: 4px 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13.5px; margin: 0; } .facts dt { color: var(--soft); } .facts dd { margin: 0; overflow-wrap: anywhere; }

/* review */
.score { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.score div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; background: var(--paper); color: var(--paper-ink); }
.score b { display: block; font-size: 20px; } .score small { color: var(--paper-soft); font-size: 11.5px; }
details.report { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: var(--paper); color: var(--paper-ink); }
details.report > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: start; }
details.report > summary::-webkit-details-marker { display: none; }
details.report .mark { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--good); }
details.report[data-status=look] .mark { background: var(--look); } details.report[data-status=fix] .mark { background: var(--fix); }
details.report .name { font-weight: 600; } details.report .headline { font-size: 13.5px; color: var(--paper-soft); }
details.report .n { font-size: 12.5px; color: var(--paper-soft); white-space: nowrap; padding-top: 2px; }
details.report .inside { padding: 0 12px 12px; border-top: 1px solid var(--paper-line); }
details.report .about { font-size: 12.5px; color: var(--paper-soft); margin: 9px 0; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; } .stats span { font-size: 12.5px; background: var(--paper-tint); color: var(--paper-ink); border-radius: 6px; padding: 2px 8px; }
.issue { border-top: 1px solid var(--paper-line); padding: 8px 0; font-size: 13.5px; }
.issue q { display: block; font: 14px/1.4 "Times New Roman", serif; color: var(--paper-ink); quotes: none; background: var(--excerpt); border-radius: 4px; padding: 2px 6px; margin: 4px 0; overflow-wrap: anywhere; }
.issue .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; } .issue .acts button { min-height: 30px; padding: 3px 9px; font-size: 13px; border-color: var(--paper-line); color: var(--paper-ink); }
.issue .acts button.primary { color: var(--accent-ink); border-color: var(--accent); }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; } table.mini td, table.mini th { border-bottom: 1px solid var(--paper-line); padding: 3px 4px; text-align: left; }
#issue-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--kb) + env(safe-area-inset-bottom)); width: min(680px, calc(100vw - 20px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 9px 10px 9px 14px; z-index: 35; display: flex; gap: 8px; align-items: center; }
#issue-bar .msg { flex: 1; font-size: 13.5px; min-width: 0; } #issue-bar .msg b { display: block; font-size: 12px; color: var(--soft); font-weight: 600; }
#issue-bar button { flex: none; }

/* history */
.rev { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; border-bottom: 1px solid var(--line); padding: 9px 2px; cursor: pointer; width: 100%; text-align: left; border-radius: 0; }
.rev small { color: var(--soft); } .rev .why { font-size: 12px; color: var(--soft); text-align: right; }

/* ---------------------------------------------------------------- drawer, menu, overlay */
#scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
#drawer { position: fixed; inset: 0 auto 0 0; width: min(380px, 92vw); background: var(--panel); z-index: 45; box-shadow: var(--shadow); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
#drawer header { padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px; } #drawer header h2 { flex: 1; font: 600 22px Georgia, serif; }
#drawer .list { overflow: auto; flex: 1; padding: 0 10px 10px; }
#drawer .paper { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; width: 100%; text-align: left; padding: 10px; border-radius: 10px; align-items: center; }
#drawer .paper[aria-current=true] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#drawer .paper b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #drawer .paper small { color: var(--soft); grid-column: 1; }
#drawer .paper .dots { grid-row: 1 / span 2; grid-column: 2; }
#drawer footer { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 6px; flex-wrap: wrap; }
#menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; max-width: min(340px, 94vw); max-height: min(70vh, 560px); overflow: auto; }
#menu button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: baseline; border-radius: 8px; padding: 8px 10px; }
#menu button small { color: var(--soft); margin-left: auto; font-size: 12px; } #menu button[aria-checked=true] { color: var(--accent); font-weight: 600; }
#menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; } #menu .label { font-size: 11.5px; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 2px; }
#overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; background: var(--scrim); }
.dialog { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); width: min(640px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.dialog.wide { width: min(1080px, 100%); height: 100%; }
.dialog > header { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 20px; flex: none; } .dialog > header h2 { flex: 1; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog > .body { padding: 4px 20px 18px; overflow: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.dialog > footer { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; flex: none; }
.note-editor { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12pt/1.5 "Times New Roman", Times, serif; min-height: 110px; }
.note-editor .ql-editor { min-height: 90px; } .note-editor .ql-editor p { text-indent: 0; }
#toast { position: fixed; left: 50%; bottom: calc(76px + var(--kb) + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--tip); color: var(--tip-ink); padding: 9px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70;
  max-width: min(560px, calc(100vw - 24px)); text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.qr { background: #fff; border-radius: 10px; padding: 8px; display: inline-block; line-height: 0; } .qr svg { width: 210px; height: 210px; }

/* reader */
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0; height: 100%; min-height: 0; }
.reader .text { overflow: auto; -webkit-overflow-scrolling: touch; padding: 6px 22px 80px; background: var(--paper); color: var(--paper-ink); font: 17px/1.6 Georgia, "Times New Roman", serif; border-radius: 0 0 0 14px; }
.reader .text p { margin: 0 0 .85em; overflow-wrap: anywhere; } .reader .text .pg { font: 600 12px -apple-system, "Segoe UI", sans-serif; color: var(--paper-soft); border-top: 1px solid var(--paper-line); margin: 22px 0 10px; padding-top: 6px; letter-spacing: .05em; text-transform: uppercase; }
.reader .text h4 { font: 600 18px/1.3 Georgia, serif; margin: 1.3em 0 .4em; }
.reader .text mark { background: var(--found); color: inherit; border-radius: 2px; } .reader .text mark.here { background: var(--found-here); }
.reader .side { overflow: auto; padding: 4px 16px 60px; border-left: 1px solid var(--line); }
.reader .side h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 18px 0 6px; }
.terms { display: flex; flex-wrap: wrap; gap: 5px; } .terms button { min-height: 28px; padding: 2px 9px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; }
.keyline { font-size: 13.5px; border-left: 3px solid var(--line); padding: 2px 0 2px 9px; margin: 0 0 9px; cursor: pointer; } .keyline:hover { border-color: var(--accent); } .keyline small { color: var(--soft); }
#quote-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--tip); color: var(--tip-ink); border-radius: 12px; padding: 6px; display: flex; gap: 4px; align-items: center; box-shadow: var(--shadow); z-index: 5; max-width: calc(100% - 20px); }
#quote-bar button { color: var(--tip-ink); white-space: nowrap; flex: none; } #quote-bar button.primary { background: var(--accent); color: var(--accent-ink); } #quote-bar input { width: 92px; padding: 6px 8px; font-size: 15px; }
.hit { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 14px; } .hit small { color: var(--soft); } .hit p { margin: 3px 0 5px; font: 15px/1.45 Georgia, serif; } .hit .ctx { color: var(--soft); }

/* ---------------------------------------------------------------- login */
body.login { overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font: 600 34px Georgia, serif; } .login-card .lede { color: var(--soft); margin: 4px 0 18px; } .login-card button { width: 100%; margin-top: 14px; min-height: 44px; } .error { color: var(--fix); min-height: 1.2em; font-size: 14px; }

/* ---------------------------------------------------------------- phones and small tablets */
@media (max-width: 860px) {
  :root { --top: 48px; --bar: 48px; --u: .62in; }
  #tools, #fmt-chip { display: none; }
  #btn-more { display: block; }
  #doc-title { max-width: none; flex: 1 1 auto; }
  .save #save-text { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
  #toolbar { inset: auto 0 var(--kb) 0; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bar) + env(safe-area-inset-bottom)); z-index: 32; }
  #toolbar button { min-width: 42px; min-height: 40px; font-size: 16px; } #toolbar button.wide { min-width: 116px; }
  #desk { inset: var(--top) 0 calc(var(--bar) + var(--kb) + env(safe-area-inset-bottom)) 0; }
  #scroller { padding: 0 0 40px; }
  .page { width: 100%; min-height: calc(100vh - var(--top) - var(--bar)); box-shadow: none; padding: 46px max(18px, env(safe-area-inset-right)) 40px max(18px, env(safe-area-inset-left)); font-size: calc(17px * var(--scale, 1)); }
  .page.guides { background-image: none; background-clip: border-box; background-origin: padding-box; }
  .page.compact { line-height: calc(var(--lh, 2.3) * .7); }
  .proof-head { flex-direction: column; } #proof textarea { font-size: 17px; }
  .page.compact .ql-editor blockquote { line-height: inherit; }
  #running-head { top: 14px; left: 18px; right: 18px; font-size: 13px; } #running-foot { display: none; }
  #panel { position: fixed; inset: var(--top) 0 0 0; width: auto; max-width: none; border-left: 0; z-index: 34; padding-bottom: env(safe-area-inset-bottom); }
  #overlay { padding: 0; align-items: flex-end; } .dialog, .dialog.wide { width: 100%; border-radius: 16px 16px 0 0; max-height: 94%; } .dialog.wide { height: 100%; max-height: 100%; border-radius: 0; }
  .dialog > .body { padding: 4px 16px 16px; } .dialog > header { padding-left: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .reader { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); } .reader .side { display: none; border-left: 0; } .reader.show-side .side { display: block; } .reader.show-side .text { display: none; } .reader.show-side ~ #quote-bar { display: none; } .reader .text { border-radius: 0; padding: 6px 16px 90px; }
  #menu { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + var(--kb) + env(safe-area-inset-bottom)); max-width: none; max-height: 72vh; } #menu button { min-height: 44px; font-size: 16px; }
  #status { padding: 2px 10px; min-height: 30px; gap: 4px 12px; }
  #scroller { scroll-padding: 60px 0 80px; }
  #issue-bar { bottom: calc(var(--bar) + 8px + var(--kb) + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(var(--bar) + 70px + var(--kb) + env(safe-area-inset-bottom)); }
  #menu button small { max-width: 46%; text-align: right; }
  button { min-height: 40px; }
}
@media (min-width: 861px) { .only-small { display: none !important; } }
@media (max-width: 860px) { .only-wide { display: none !important; } }
@media print { :root { --paper: #fff; --paper-ink: #000; } #top, #toolbar, #panel, #status, #issue-bar, #toast { display: none !important; } body { overflow: visible; background: #fff; } #desk { position: static; } #scroller { overflow: visible; padding: 0; } .page { box-shadow: none; padding: 0; width: auto; } }

/* ---------------------------------------------------------------- bringing the sources together */
table.matrix th { font-weight: 600; font-size: 12px; vertical-align: bottom; max-width: 120px; } table.matrix td { cursor: pointer; white-space: nowrap; } table.matrix td:first-child { cursor: default; white-space: normal; min-width: 120px; }
table.matrix td.has { background: var(--paper-tint); } table.matrix td.gap small { color: var(--look); font-weight: 600; } table.matrix td small { color: var(--soft); }
.side { display: grid; gap: 18px; align-items: start; } .side section { min-width: 0; } .side h3 { font-size: 14px; margin: 0 0 8px; padding-bottom: 5px; border-bottom: 2px solid var(--line); }
.passage { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 0 0 12px; font: 15px/1.5 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.passage .cue { display: inline-block; font: 600 11px/1.5 -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--look); color: var(--look); border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.passage .acts { margin-top: 4px; } .passage .acts button { min-height: 28px; padding: 2px 10px; font: 13px -apple-system, "Segoe UI", sans-serif; }
.outline { font: 14px/1.6 "Times New Roman", Times, serif; } .outline h4 { font: 700 14px/1.5 "Times New Roman", serif; margin: 10px 0 2px; } .outline p { margin: 0 0 6px; text-indent: 1.4em; } .outline blockquote { margin: 0 0 6px 1.6em; }
.outline hr { border: 0; border-top: 1px solid var(--paper-rule); width: 33%; margin: 10px 0 6px; } .outline p.small { text-indent: 0; font-size: 12px; }
.dialog .item { background: var(--paper); }
@media (max-width: 1180px) and (min-width: 861px) { #fmt-chip { display: none; } #tools button { padding: 7px 8px; } }

/* ---------------------------------------------------------------- choosing a look */
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.look { display: block; text-align: left; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 0; background: transparent; }
.look[aria-checked=true] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.look .swatch { display: block; height: 74px; padding: 10px 12px 0; }
.look .swatch i { display: block; height: 100%; border-radius: 5px 5px 0 0; padding: 9px 10px; font: 11px/1.5 "Times New Roman", serif; font-style: normal; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.look .name { display: block; padding: 8px 12px 9px; font-weight: 600; font-size: 14px; } .look .name small { display: block; font-weight: 400; color: var(--soft); font-size: 12px; line-height: 1.3; }

/* ---------------------------------------------------------------- the workbench: finding, following, joining, measuring, proving */
.hit mark, .kwic mark { background: var(--found); color: inherit; border-radius: 2px; padding: 0 1px; }
.origin { display: inline-block; font: 600 10.5px/1.6 -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .05em; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; color: var(--soft); }
.origin[data-o=you], .origin[data-o=paper] { color: var(--accent); } .origin[data-o=asserted], .origin[data-o=cards] { color: var(--good); } .origin[data-o=computed], .origin[data-o=notes] { color: var(--look); }
.spark { display: flex; align-items: flex-end; gap: 1px; height: 22px; border-bottom: 1px solid var(--line); } .spark i { flex: 1; background: var(--accent); border-radius: 1px 1px 0 0; min-width: 2px; }
.kwic { display: grid; gap: 0; font: 14px/1.5 Georgia, "Times New Roman", serif; } 
.kwic button { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 118px; gap: 0 6px; align-items: baseline; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 2px; min-height: 0; font: inherit; color: inherit; background: none; width: 100%; }
.kwic .l { text-align: right; white-space: nowrap; overflow: hidden; direction: rtl; text-overflow: ellipsis; color: var(--soft); } .kwic .r { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.kwic small { font: 11.5px -apple-system, "Segoe UI", sans-serif; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.cover { font-size: 12.5px; color: var(--paper-soft); margin-top: 5px; display: flex; align-items: center; gap: 8px; min-height: 1.2em; }
.meter { display: inline-block; width: 54px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--paper-ink) 14%, transparent); overflow: hidden; flex: none; } .meter i { display: block; height: 100%; background: var(--good); }
.strip-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--soft); margin: 0 0 2px 42%; font-variant-numeric: tabular-nums; }
.strip-row { display: grid; grid-template-columns: 42% 1fr; align-items: center; gap: 0; font-size: 13px; padding: 3px 0; } .strip-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.strip { position: relative; height: 18px; border-bottom: 1px solid var(--line); } .strip i { position: absolute; bottom: 0; width: 2px; height: 9px; margin-left: -1px; background: var(--soft); } .strip b { position: absolute; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
.chg { border-left: 3px solid var(--paper-line); padding: 2px 0 2px 10px; margin: 0 0 12px; } .chg[data-k=added] { border-color: var(--good); } .chg[data-k=removed] { border-color: var(--fix); } .chg[data-k=reworded] { border-color: var(--look); }
.chg small { font: 600 11px -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--paper-soft); } .chg p { margin: 2px 0 0; font: 15px/1.5 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
ins { text-decoration: none; background: color-mix(in srgb, var(--good) 24%, transparent); border-radius: 2px; } del { color: var(--fix); text-decoration: line-through; text-decoration-thickness: 1px; }
:root[data-theme=contrast] ins { background: none; text-decoration: underline; text-decoration-thickness: 2px; color: var(--good); }
.chart { position: relative; margin: 4px 0 2px; } .chart .top { position: absolute; left: 0; top: 0; font-size: 11.5px; color: var(--soft); } svg.growth { display: block; width: 100%; height: 150px; border-bottom: 1px solid var(--line); }
svg.growth .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); } svg.growth .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; } svg.growth .goal { stroke: var(--good); stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.dayrow { display: grid; grid-template-columns: 96px 1fr 52px 52px; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; font-variant-numeric: tabular-nums; } .dayrow .num { text-align: right; font-weight: 600; } .dayrow small { color: var(--soft); text-align: right; }
.dayrow .bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); } .dayrow .bar i { display: block; height: 100%; background: var(--accent); } .dayrow .bar i.in { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 56px; border-bottom: 1px solid var(--line); } .hours i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; }
.skel { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 8px; border-bottom: 1px solid var(--line); padding: 10px 0; } .skel .n { font: 600 13px -apple-system, "Segoe UI", sans-serif; color: var(--soft); text-align: right; padding-top: 3px; }
.skel[data-flagged="1"] .n { color: var(--look); } .skel .opens { margin: 0; font: 16px/1.45 Georgia, "Times New Roman", serif; cursor: pointer; } .skel .opens:hover { color: var(--accent); } .skel .closes { margin: 2px 0 0; font: italic 14px/1.4 Georgia, serif; color: var(--soft); }
.skel .warn { font-size: 13px; color: var(--look); margin: 4px 0 0; } .skel select { margin-top: 6px; width: auto; min-height: 30px; padding: 2px 8px; font-size: 13px; } .skel-head { margin: 18px 0 2px; cursor: pointer; font-family: Georgia, serif; }
blockquote.yours { margin: 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font: 15px/1.5 Georgia, serif; border-radius: 0 6px 6px 0; }
.reader .text u.kept { text-decoration: underline; text-decoration-color: var(--good); text-decoration-thickness: 2px; text-underline-offset: 3px; }
#status .cited { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
details > summary { cursor: pointer; color: var(--soft); }
@media (max-width: 860px) { .kwic button { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .kwic small { grid-column: 1 / -1; text-align: left; } .dayrow { grid-template-columns: 84px 1fr 46px; } .dayrow small { display: none; } }
.dialog > .body h3 { margin-top: 18px; } .dialog > .body h3:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- the face and size of the type */
#toolbar button.face { min-width: 150px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; } #toolbar #tb-size { min-width: 56px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { #toolbar button.face { min-width: 132px; } }

/* ---------------------------------------------------------------- ideas: worksheets, and the timeline */
/* Lanes and notes are told apart by hue. The hues are named here, once for each look, and mixed into the paper. */
:root { --lane-0: #2f5d8a; --lane-1: #2e7d4f; --lane-2: #a86200; --lane-3: #b3261e; --lane-4: #6b3fa0; --lane-5: #0f7c8a; --lane-6: #b3541e; --lane-7: #5c7a1f; --lane-8: #a3336f; --lane-9: #4f5b66;
  --note-0: #e9c84a; --note-1: #7cc47f; --note-2: #6fb3e0; --note-3: #e8917a; --note-4: #b592e0; --note-5: #e0b070; --note-6: #a7b0ba; --mix: 16%; --note-mix: 34%; }
:root[data-theme=dark] { --lane-0: #7fb0e0; --lane-1: #6cc492; --lane-2: #e6a94d; --lane-3: #f08a80; --lane-4: #b79be8; --lane-5: #5cc6d4; --lane-6: #f0a070; --lane-7: #a9cc6a; --lane-8: #e88bc0; --lane-9: #a3adb8; --mix: 22%; --note-mix: 26%; }
:root[data-theme=sepia] { --lane-0: #3d5f80; --lane-1: #4d7335; --lane-2: #9a5b00; --lane-3: #a3321f; --lane-4: #6a4590; --lane-5: #2a7078; --lane-6: #a5561f; --lane-7: #66752a; --lane-8: #973a66; --lane-9: #6a5d4a; }
:root[data-theme=contrast] { --lane-0: #ffd60a; --lane-1: #5dff95; --lane-2: #ff9f0a; --lane-3: #ff8a80; --lane-4: #d0a8ff; --lane-5: #64d2ff; --lane-6: #ffb38a; --lane-7: #d4ff6a; --lane-8: #ff9fd6; --lane-9: #fff; --mix: 0%; --note-mix: 0%;
  --note-0: #ffd60a; --note-1: #5dff95; --note-2: #64d2ff; --note-3: #ff8a80; --note-4: #d0a8ff; --note-5: #ff9f0a; --note-6: #fff; }
.lane-c0 { --hue: var(--lane-0); } .lane-c1 { --hue: var(--lane-1); } .lane-c2 { --hue: var(--lane-2); } .lane-c3 { --hue: var(--lane-3); } .lane-c4 { --hue: var(--lane-4); }
.lane-c5 { --hue: var(--lane-5); } .lane-c6 { --hue: var(--lane-6); } .lane-c7 { --hue: var(--lane-7); } .lane-c8 { --hue: var(--lane-8); } .lane-c9 { --hue: var(--lane-9); }
.note-c0 { --hue: var(--note-0); } .note-c1 { --hue: var(--note-1); } .note-c2 { --hue: var(--note-2); } .note-c3 { --hue: var(--note-3); } .note-c4 { --hue: var(--note-4); } .note-c5 { --hue: var(--note-5); } .note-c6 { --hue: var(--note-6); }

.says { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 10px 0 14px; } .says b { display: block; } .says b[data-level=look] { color: var(--look); } .says b[data-level=fix] { color: var(--fix); } .says b[data-level=good] { color: var(--good); }
.says p { margin: 3px 0 0; font-size: 13.5px; color: var(--soft); }
button.sheet { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; background: var(--paper); color: var(--paper-ink); }
button.sheet[data-level=look] { border-left-color: var(--look); } button.sheet[data-level=fix] { border-left-color: var(--fix); } button.sheet small { color: var(--paper-soft); text-align: right; font-size: 12px; } button.sheet span { grid-column: 1 / -1; font-size: 13.5px; color: var(--paper-soft); }
.sheet-body .about { font: 17px/1.5 Georgia, "Times New Roman", serif; margin: 0 0 8px; } details.method { margin: 0 0 6px; } details.method p { font-size: 14px; color: var(--soft); margin: 6px 0 0; border-left: 3px solid var(--line); padding-left: 12px; }
label.box { display: block; margin: 12px 0 0; } label.box > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; } label.box.narrow { max-width: 420px; } label.box textarea { min-height: 56px; resize: vertical; }
.rows > h3, .checks > h3 { margin: 20px 0 6px; font-size: 14px; }
.rowcard { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; gap: 0 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px 10px 4px; margin: 0 0 8px; background: var(--paper); color: var(--paper-ink); }
.rowcard[data-state=confirmed], .rowcard[data-state=strong], .rowcard[data-state=true] { border-left: 3px solid var(--good); } .rowcard[data-state=possible], .rowcard[data-state=medium] { border-left: 3px solid var(--look); }
.rowcard[data-state=against], .rowcard[data-state=false], .rowcard[data-state=weak] { border-left: 3px solid var(--fix); } .rowcard[data-state=ruled_out] { opacity: .7; }
.rowcard .n { text-align: right; color: var(--paper-soft); font: 600 13px -apple-system, "Segoe UI", sans-serif; padding-top: 22px; } .rowcard .del { align-self: start; min-height: 30px; min-width: 30px; color: var(--paper-soft); }
.rowcard .cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px 10px; } .rowcard .col { grid-column: span 12; margin: 0; } .rowcard .col > span { display: block; font-size: 11.5px; color: var(--paper-soft); margin-bottom: 2px; }
.rowcard .col.k-text { grid-column: span 6; } .rowcard .col.k-line { grid-column: span 6; } .rowcard .col.k-source { grid-column: span 5; } .rowcard .col.k-page, .rowcard .col.k-date { grid-column: span 3; } .rowcard .col.k-choice { grid-column: span 4; }
.rowcard .col textarea { min-height: 44px; resize: vertical; } .rowcard .read { grid-column: span 12; justify-self: start; min-height: 30px; padding: 2px 10px; font-size: 13px; }
.check { border-bottom: 1px solid var(--line); padding: 8px 0; } .check label { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: inherit; cursor: pointer; } .check label input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.check small { color: var(--soft); } .check > input { margin: 6px 0 0 28px; width: calc(100% - 28px); display: none; } .check[data-on="1"] > input, .check > input:not(:placeholder-shown) { display: block; }
.sheet-acts { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; } .ask-in { position: sticky; top: 0; z-index: 3; background: var(--panel); padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; align-items: flex-end; } .ask-in label { margin: 0; }
table.scores th input { min-width: 120px; font-weight: 600; } table.scores th .row { margin-top: 4px; } table.scores td input { min-width: 160px; } table.scores select { width: auto; min-width: 58px; } table.scores td.total { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
table.scores tr.lead td.total { color: var(--good); } table.scores th, table.scores td { vertical-align: top; }
.square { position: relative; width: min(100%, 560px); aspect-ratio: 1 / 1; margin: 14px 0 26px 26px; border: 2px solid var(--ink); background: linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat, var(--paper); touch-action: none; }
.square .corner { position: absolute; width: 46%; border: 0; background: none; color: var(--paper-soft); font-size: 12.5px; padding: 4px 6px; min-height: 0; } .square .corner[data-k="0"] { left: 2%; top: 2%; } .square .corner[data-k="1"] { right: 2%; top: 2%; text-align: right; }
.square .corner[data-k="2"] { left: 2%; bottom: 2%; } .square .corner[data-k="3"] { right: 2%; bottom: 2%; text-align: right; }
.square .ax-x { position: absolute; left: 0; right: 0; bottom: -24px; text-align: center; font-size: 12.5px; color: var(--soft); } .square .ax-y { position: absolute; left: -24px; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); white-space: nowrap; font-size: 12.5px; color: var(--soft); }
.square .point { position: absolute; transform: translate(-50%, -50%); background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 4px 11px; font-size: 13px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: grab; user-select: none; touch-action: none; }
.square .point.dragging, .note.dragging { cursor: grabbing; box-shadow: var(--shadow); z-index: 5; }
.swatches { display: flex; gap: 6px; } .swatches button { width: 26px; height: 26px; min-height: 0; min-width: 0; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--hue) 70%, var(--paper)); border: 2px solid transparent; } .swatches button[aria-pressed=true] { border-color: var(--ink); }
.board { position: relative; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: auto; touch-action: none; }
.note { background: color-mix(in srgb, var(--hue) var(--note-mix), var(--paper)); color: var(--paper-ink); border: 1px solid color-mix(in srgb, var(--hue) 60%, var(--paper-line)); border-radius: 8px; padding: 6px 8px 4px; }
.board .note { position: absolute; width: 190px; touch-action: none; } .note.star { border-width: 2px; border-color: var(--hue); } .note .grip { cursor: grab; color: var(--paper-soft); font-size: 11px; line-height: 12px; letter-spacing: 2px; text-align: center; user-select: none; }
.note textarea { border: 0; background: transparent; padding: 2px 0; min-height: 0; resize: none; font-size: 14px; color: inherit; } .note .row { gap: 2px; margin-top: 2px; } .note .row input { border: 0; border-top: 1px solid color-mix(in srgb, var(--hue) 50%, transparent); border-radius: 0; background: transparent; font-size: 12px; padding: 3px 0; min-height: 0; color: inherit; flex: 1; min-width: 0; }
.note .row button { min-height: 26px; min-width: 26px; padding: 0 3px; font-size: 14px; color: var(--paper-soft); } .notelist section { margin: 0 0 14px; } .notelist .note { margin: 0 0 6px; } .notelist h3 { margin: 14px 0 6px; font-size: 14px; }
.tabs.mini button { padding: 5px 10px; font-size: 13.5px; }
details.lesson { border-bottom: 1px solid var(--line); padding: 8px 0; } details.lesson summary { color: var(--ink); font-weight: 600; } details.lesson .n { display: inline-block; min-width: 30px; color: var(--soft); font-weight: 400; font-variant-numeric: tabular-nums; }
details.lesson p { margin: 8px 0 8px 30px; font-size: 14px; } details.lesson .row { margin: 0 0 6px 30px; flex-wrap: wrap; }

.dialog.full { width: min(1500px, 100%); } .tl-body { display: flex; flex-direction: column; } .tl { display: flex; flex-direction: column; min-height: 0; }
.tl-bar, .tl-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; } .tl-bar button, .tl-filter button { min-height: 34px; padding: 4px 11px; font-size: 14px; } .tl-bar button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tl-zoom { display: inline-flex; gap: 2px; align-items: center; } .tl-filter input { flex: 1 1 180px; min-width: 140px; } .tl-filter select { width: auto; flex: 0 1 auto; max-width: 180px; }
.tl-wrap { overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--paper-ink); } .tl-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 100%; }
.tl-lanes { border-right: 1px solid var(--paper-line); background: var(--paper-tint); position: relative; z-index: 2; } .tl-corner { height: 30px; font: 600 11px/30px -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--paper-soft); padding: 0 10px; border-bottom: 1px solid var(--paper-line); position: sticky; top: 0; background: var(--paper-tint); }
button.tl-lane { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 6px; text-align: left; border: 0; border-left: 4px solid var(--hue); border-bottom: 1px solid var(--paper-line); border-radius: 0; padding: 8px 8px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--paper-ink); background: none; min-height: 0; overflow: hidden; }
button.tl-lane small { color: var(--paper-soft); font-weight: 400; } button.tl-lane span { overflow: hidden; text-overflow: ellipsis; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; position: relative; } .tl-axis { position: sticky; top: 0; height: 30px; border-bottom: 1px solid var(--paper-line); background: var(--paper); z-index: 1; }
.tl-axis span { position: absolute; top: 0; font: 11.5px/30px -apple-system, "Segoe UI", sans-serif; color: var(--paper-soft); padding-left: 5px; white-space: nowrap; border-left: 1px solid var(--paper-line); font-variant-numeric: tabular-nums; }
.tl-inner { position: relative; } .tl-rule { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--paper-line); opacity: .6; } .tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fix); opacity: .5; }
.tl-row { position: relative; border-bottom: 1px solid var(--paper-line); }
button.tl-card { position: absolute; height: 44px; min-height: 0; display: block; text-align: left; padding: 3px 8px; border: 1px solid var(--hue); border-left-width: 4px; border-radius: 7px; background: color-mix(in srgb, var(--hue) var(--mix), var(--paper)); color: var(--paper-ink); overflow: hidden; }
button.tl-card small { display: block; font: 11px/15px -apple-system, "Segoe UI", sans-serif; color: var(--paper-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; } button.tl-card small i { font-style: normal; } button.tl-card small b { color: var(--fix); }
button.tl-card span { display: block; font-size: 13px; line-height: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } button.tl-card.wide { border-left-width: 1px; border-top-width: 3px; }
button.tl-card.sure-probable { border-style: dashed; border-left-style: solid; } button.tl-card.sure-disputed, button.tl-card.sure-unknown { border-style: dotted; border-left-style: solid; } button.tl-card.sure-disputed { border-left-color: var(--fix); }
button.tl-card.over { box-shadow: 0 0 0 2px color-mix(in srgb, var(--look) 70%, transparent); } button.tl-card:hover, button.tl-card:focus-visible { z-index: 3; min-width: max-content; max-width: 420px; }
.tl-grip { height: 12px; cursor: ns-resize; margin: 2px auto 0; width: 80px; border-radius: 6px; background: linear-gradient(var(--line), var(--line)) 50% 50% / 40px 3px no-repeat; touch-action: none; }
.tl-empty { padding: 40px 20px; text-align: center; color: var(--paper-soft); } .tl-loose { margin-top: 12px; } .tl-loose h3 { font-size: 13px; margin: 0 0 4px; }
button.tl-line { display: grid; grid-template-columns: 10px minmax(84px, auto) minmax(0, 1fr) auto; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 7px 2px; min-height: 0; }
button.tl-line i, i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--hue); align-self: center; } button.tl-line small { color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; } button.tl-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag, .flagged { color: var(--fix); } p.flagged { margin: 0 0 8px; font-size: 14px; } table.tl-table tr { cursor: pointer; } table.tl-table tr.over td:first-child { box-shadow: inset 3px 0 0 var(--look); } table.tl-table td { vertical-align: top; padding: 6px 6px; }
.tl-edit { max-width: 860px; } .tl-edit .read { display: block; min-height: 1.3em; font-size: 12.5px; color: var(--fix); margin-top: 3px; } .tl-edit .read[data-ok="1"] { color: var(--good); }
@media (max-width: 860px) { .tl-grid { grid-template-columns: 92px minmax(0, 1fr); } button.tl-lane { font-size: 12.5px; padding: 6px 4px 0 6px; } .rowcard .col.k-text, .rowcard .col.k-line, .rowcard .col.k-source, .rowcard .col.k-choice { grid-column: span 12; } .rowcard .col.k-page, .rowcard .col.k-date { grid-column: span 6; }
  .board { height: 460px; } .square { margin-left: 22px; width: calc(100% - 26px); } button.tl-line { grid-template-columns: 10px auto minmax(0, 1fr) auto; } }
@media (max-width: 1320px) and (min-width: 861px) { #tools button { padding: 7px 7px; font-size: 14px; } }
