/* Resets carry zero specificity (:where), so every component
   class wins over them: a reset like `button { color: inherit }` at normal specificity beats
   `.btn` and paints ink text on ink buttons. */

:where(*), :where(*)::before, :where(*)::after { box-sizing: border-box; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(a) { color: inherit; }
:where(h1, h2, h3, h4, p, ul, ol, figure, dl, dd) { margin: 0; }
:where(ul, ol) { padding: 0; }
:where(svg) { display: block; }
:where(img) { display: block; max-width: 100%; }
:where([hidden]) { display: none !important; }

html { background: var(--bg); }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.shell { height: 100vh; min-height: 720px; display: flex; flex-direction: column; overflow: hidden; }
.grow { flex: 1; min-width: 0; }
.row-gap { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; }

.h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.h2 { font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.015em; }
.h3 { font-size: 16px; line-height: 1.35; font-weight: 700; }
.sub { font-size: 14px; color: var(--ink-soft); }
.label { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: .01em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
.strong { font-weight: 700; }
.prose { font-size: 15px; line-height: 1.65; color: var(--ink); max-width: 72ch; }
.prose p + p { margin-top: 10px; }
.prose ul, .prose ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose code, .code-inline { font-family: var(--mono); font-size: 13px; white-space: nowrap; background: var(--paper-2); border-radius: 4px; padding: 1px 5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-text { color: var(--danger); font-size: 14px; }

.mark { width: 24px; height: 24px; flex: none; }
.mark .sq { fill: var(--ink); }
.mark .e { fill: var(--bg); }
.mark.lg { width: 40px; height: 40px; }
.mark.md { width: 36px; height: 36px; }

.page { flex: 1; width: 100%; max-width: var(--page-w); margin: 0 auto; padding: var(--page-top) var(--gutter) var(--page-bottom); display: flex; flex-direction: column; gap: var(--section-gap); }
.page.narrow { max-width: var(--narrow-w); padding-top: var(--narrow-top); gap: 24px; }
/* One column for every page: a column page starts where the lists start; only its content is narrower. */
.page.column { gap: 24px; }
.page.column > * { max-width: var(--column-w); }
.page.center-col { align-items: center; text-align: center; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .sub { margin-top: 4px; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: center; gap: 12px; }
.section-head .h3 { flex: 1; min-width: 0; }

/* The work pages (a capture, a workflow) fill the screen: a main area and a rail. */
.work { flex: 1; min-height: 0; display: flex; }
.rail { width: 400px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }

/* A scrollbar must not move a centred column: the page and every reading column keep its room
   whether or not they scroll. */
.scroll:has(> .doc-col) { scrollbar-gutter: stable both-edges; }

/* Anything on its way in or out takes no clicks. */
[data-motion] { pointer-events: none; }

/* A page swapped in fades in once its first view has drawn. */
#page { transition: opacity var(--dur) var(--ease); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#page[data-motion] { opacity: 0; transition: none; }

/* A theme change fades every colour across; the switch's own marker keeps its slide. */
html.theme-fade, html.theme-fade *:not(.seg-thumb), html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease), border-color var(--dur-slow) var(--ease), fill var(--dur-slow) var(--ease), stroke var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease) !important;
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 20px; }
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-hard) transparent; }
.divider { height: 1px; background: var(--line); }

.narrow-note { display: none; }
@media (max-width: 1079px) {
  .needs-wide > :not(.narrow-note) { display: none !important; }
  .needs-wide > .narrow-note { display: flex; flex: 1; align-items: center; justify-content: center; padding: 24px; }
}

/* The landmark holds the page heading and the page without adding a box to the layout. */
.page-landmark { display: contents; }
.page-loading { flex: 1; display: grid; place-items: center; min-height: 240px; color: var(--ink-faint); opacity: 0; animation: page-loading-in var(--dur) var(--ease) 400ms forwards; }
.page-loading .ico { width: 22px; height: 22px; }
@keyframes page-loading-in { to { opacity: 1; } }

