/* The house style for screens: the parts every Tüccar web page shares, by the rules in
   tuccar/design/README.md (Web). Values come from tokens.css, which `screen.write` puts beside this
   file with the fonts and the logo. A page's own stylesheet lays out that page and never restyles
   these parts; change one here and every screen takes it on its next build. */

@font-face { font-family: Spectral; font-weight: 400; font-display: swap; src: url(fonts/Spectral-Regular.ttf); }
@font-face { font-family: Spectral; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/Spectral-Italic.ttf); }
@font-face { font-family: Spectral; font-weight: 600; font-display: swap; src: url(fonts/Spectral-SemiBold.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url(fonts/InterTight-Regular.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url(fonts/InterTight-Medium.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url(fonts/InterTight-SemiBold.ttf); }

/* One measure for every screen: the bar and the content share its left edge. */
:root {
  color-scheme: light only;
  --measure: 1120px;
  --gutter: max(24px, calc((100vw - var(--measure)) / 2));
  --rail: 176px;
  --bar: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: var(--bar); }
/* A reading page (the website) is set in the serif. An app screen (the console) puts `app` on its
   body: Inter Tight at table size, with tabular figures. */
body { margin: 0; background: var(--color-paper); color: var(--color-ink);
  font: var(--type-body)/1.6 var(--font-serif); -webkit-font-smoothing: antialiased; }
body.app { font: var(--type-table)/1.5 var(--font-sans); font-variant-numeric: tabular-nums; }
::selection { background: var(--color-accent); color: var(--color-paper); }
a { color: var(--color-ink); text-decoration-color: var(--color-accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: 600; letter-spacing: -.012em; text-wrap: balance; }

/* Words: the tracked-capital marker over a section, the dek under a headline. */
.kicker { margin: 0; font: 600 var(--type-kicker)/1.4 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--color-accent); }
.dek { font: var(--type-lede)/1.5 var(--font-serif); color: var(--color-ink-soft); }
.muted { color: var(--color-muted); }
.error { color: var(--color-loss-text); }
/* A signed figure takes its sign's colour, and always shows the + or −. */
.gain { color: var(--color-gain); }
.loss { color: var(--color-loss-text); }
/* A status between fine and alert, in words set by weight (Ali, 2026-10-22: the watch colour leaves every
   text role; it stays a mark, as on the balance's pressed pan). Named for the tone, so it never meets a
   service's own "watch" (a tier, a verdict). */
.caution { font-weight: 600; color: var(--color-ink); }
/* A verdict (a call, a watch, a pass, an unpriced name) told by weight and ink, never by colour: a verdict is
   not a sign. The word always shows. Markup: span.verdict with call, watch, pass or unpriced. */
.verdict { font-family: var(--font-sans); white-space: nowrap; }
.verdict.call { font-weight: 600; color: var(--color-ink); }
.verdict.watch { font-weight: 500; color: var(--color-ink); }
.verdict.pass, .verdict.unpriced { font-weight: 400; color: var(--color-muted); }

/* Actions: the main one filled in ink, the others outlined. */
.button { display: inline-block; font: 500 var(--type-table)/1 var(--font-sans); letter-spacing: .02em; text-decoration: none;
  color: var(--color-paper); background: var(--color-ink); border: 1px solid var(--color-ink); border-radius: 0; padding: 12px 19px; cursor: pointer; }
.button:hover { background: var(--color-accent); border-color: var(--color-accent); }
.button.quiet { color: var(--color-ink); background: transparent; border-color: var(--color-hairline); }
.button.quiet:hover { border-color: var(--color-ink); }
.button:disabled { opacity: .55; cursor: default; }

/* The bar: the lockup, the sections, the main action at the right. */
.bar { position: sticky; top: 0; z-index: 2; height: var(--bar); padding: 0 var(--gutter); display: flex; align-items: center; gap: 36px;
  background: var(--color-paper); border-bottom: 1px solid var(--color-hairline); }
.bar .home { margin-right: auto; display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.bar .lockup { display: block; height: 30px; width: auto; }
.bar nav { display: flex; gap: 30px; }
.bar nav a { font: 500 var(--type-table)/1 var(--font-sans); text-decoration: none; color: var(--color-ink-soft); white-space: nowrap; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }
.bar .button { padding: 10px 15px; }

/* Sections: a service's own pages, in a row beside its marker. The bar's link look, one size down;
   the open page is marked as the bar marks its section. On a phone the row scrolls. */
nav.sections { display: flex; gap: var(--space-5); overflow-x: auto; }
nav.sections a { font: 500 var(--type-caption)/1.4 var(--font-sans); text-decoration: none; color: var(--color-ink-soft); white-space: nowrap; }
nav.sections a:hover, nav.sections a[aria-current] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }

/* A section: its marker in the left rail, its content on the grid. */
.rail { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail > .kicker { padding-top: .9em; }

/* Dateline: the head of a page about a day (the desk's front page): the when, a claim for the day in the
   reading face, the dek, then the day's key figures in a strip. Markup: header.dateline > p.when, h1, p.dek,
   dl.figures. */
.dateline { padding: var(--space-5) 0 var(--space-4); border-bottom: 1px solid var(--color-ink); }
.dateline .when { margin-bottom: 6px; font: 500 var(--type-table)/1.5 var(--font-sans); color: var(--color-ink-soft); }
.dateline h1 { font: 600 var(--type-briefing_headline)/1.15 var(--font-serif); letter-spacing: -.012em; max-width: 30em; }
.dateline .dek { margin-top: 8px; max-width: 44em; }
.dateline .figures { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-hairline); }
/* Figures: key figures in a strip, each its label over its value and a line under it (a delta toned by its sign,
   or a date). The email's stats, on a screen. Markup: dl.figures > div > dt, dd > small; a `secondary` figure
   drops on a phone, so put it last. */
.figures { margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.figures > div { min-width: 0; padding: 0 18px; border-left: 1px solid var(--color-hairline); }
.figures > div:first-child { padding-left: 0; border-left: 0; }
.figures dt { overflow: hidden; font: 600 var(--type-kicker)/1.4 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; text-overflow: ellipsis; }
.figures dd { margin: 2px 0 0; font: 600 var(--type-lede)/1.2 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.figures dd small { display: block; font: 500 var(--type-caption)/1.4 var(--font-sans); white-space: normal; }
/* Sheet: a dense page in two columns, the wide one first, each a column of ruled sections with their marker over
   them; one column on a phone. A reading page keeps the rail. Markup: div.sheet > div.main + div.aside, each of
   `section`s led by a p.kicker. */
.sheet { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: var(--space-7); padding-top: var(--space-5); }
.sheet > div { min-width: 0; }
.sheet section + section { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-hairline); }
.sheet section > .kicker { margin-bottom: var(--space-3); }

/* Plain forms: a label above each field, one column. */
label { display: block; font: 500 var(--type-caption)/1.5 var(--font-sans); color: var(--color-ink); }
label .note { color: var(--color-muted); margin-left: 8px; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; color: var(--color-ink);
  font: 400 var(--type-body)/1.45 var(--font-serif); background: var(--color-paper); border: 1px solid var(--color-hairline); border-radius: 0; }
textarea { resize: vertical; min-height: 4.4em; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--color-ink); box-shadow: inset 0 -2px 0 var(--color-accent); }
[aria-invalid="true"] { border-color: var(--color-loss-text); }
/* An app screen's selects read at table size in the sans, as the rest of the screen does. */
body.app select { font: 400 var(--type-table)/1.4 var(--font-sans); padding: 7px 9px; }
/* Filters: labelled selects in one row above what they filter, one `p` each; they wrap on a phone. */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: flex-end; }
.filters select { width: auto; min-width: 10rem; }

/* A ruled panel holds one form or one notice. */
.panel { padding: var(--space-5); border: 1px solid var(--color-hairline); background: var(--color-paper); }
.panel > * + * { margin-top: var(--space-4); }

/* Ruled tables: tracked-capital heads, figures right-aligned (`num`), row rules in grid, inactive
   and child rows muted, the total in bold. A `secondary` column drops on a phone; a `long` cell (an
   address, a link) may break inside a word. */
.table { width: 100%; border-collapse: collapse; font: var(--type-table)/1.5 var(--font-sans); font-variant-numeric: tabular-nums; }
.table th { color: var(--color-muted); font-size: var(--type-kicker); font-weight: 600; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.table th, .table td { padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--color-grid); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; }
.table .long { overflow-wrap: anywhere; }
.table tr.inactive td { color: var(--color-muted); }
.table tr.child td { color: var(--color-muted); }
.table tr.total td { font-weight: 600; border-top: 1px solid var(--color-ink); }

/* The balance: the voices for a claim left of a pivot and the voices against it right, on one scale for
   every balance on a page (--scale: the largest side shown), both counts printed. Position carries the
   side, never a hue: a stance is not a sign. Against is the darker pan, because it is what can break the
   claim; under pressure (`pressed`) it takes the watch colour. Markup: span.balance with --for, --against
   and --scale, holding .n.for, .pan.for > i, .pivot, .pan.against > i, .n.against. */
.balance {
  --for: 0;
  --against: 0;
  --scale: 1;
  display: inline-grid; grid-template-columns: 2.5em 1fr 1px 1fr 2.5em; align-items: center; width: 100%; max-width: 15rem;
  column-gap: 6px; font: 500 var(--type-caption)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.balance .n { color: var(--color-ink-soft); }
.balance .n.for { text-align: right; }
.balance .pan { display: flex; height: 7px; background: var(--color-grid); }
.balance .pan.for { justify-content: flex-end; }
.balance .pan i { display: block; height: 100%; }
.balance .pan.for i { width: calc(var(--for) / var(--scale) * 100%); background: var(--color-hairline); }
.balance .pan.against i { width: calc(var(--against) / var(--scale) * 100%); background: var(--color-ink-soft); }
.balance .pivot { width: 1px; height: 15px; background: var(--color-ink); }
.balance.pressed .pan.against i { background: var(--color-watch); }
.balance.pressed .n.against { color: var(--color-ink); font-weight: 600; }

/* Strip: a subject's weekly counts as bars, oldest first, beside the latest week's count (`.n`). The page
   scales each strip to the subject's own busiest week but never to fewer than five, so one voice never draws
   a full bar; a week with none, or one nobody read, is a hairline tick (`rect.none`). Ink only: a strip shows
   breadth, never sign. Markup: span.strip holding an svg (a viewBox, one rect per week) and span.n; the svg's
   height is --strip-height, so a page can show the same strip large. */
.strip { --strip-height: 16px; display: inline-flex; align-items: flex-end; gap: var(--space-2); white-space: nowrap; }
.strip svg { display: block; height: var(--strip-height); width: auto; overflow: visible; }
.strip rect { fill: var(--color-ink); }
.strip rect.none { fill: var(--color-hairline); }
.strip .n { min-width: 2ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Timeline: dated marks on one line from a start to an end, with today on it: a call's life (its entry, its
   catalysts, its falsifier's date, the sessions it is scored at) or a risk's signposts. A mark sits at --at, a
   percentage of the line by calendar day; the part already run is ink to --to. The word of a mark a reader acts
   on (`.note`) sits above the line, clear of the ticks; the scale's labels sit below. Markup: figure.timeline >
   div.line holding span.done, span.mark (tick, key or today), span.note (today; `end` sets it left of its
   mark), span.scale (start, end; `minor` drops its label on a phone) > span.label; then a figcaption. */
.timeline { --to: 0%; margin: 0; padding-top: 34px; }
.timeline .line { position: relative; height: 1px; margin-bottom: 32px; background: var(--color-hairline); }
.timeline .done { position: absolute; left: 0; top: -1px; height: 3px; width: var(--to); background: var(--color-ink); }
.timeline .mark, .timeline .note, .timeline .scale { --at: 0%; position: absolute; left: var(--at); }
.timeline .mark { bottom: 0; border-left: 1px solid var(--color-ink); }
.timeline .mark.tick { height: 9px; }
.timeline .mark.key { height: 22px; bottom: -10px; border-left-width: 3px; margin-left: -1px; }
.timeline .mark.today { height: 30px; bottom: -14px; border-left-color: var(--color-accent); }
.timeline .note { bottom: 13px; margin-left: 6px; white-space: nowrap; font: 500 var(--type-caption)/1 var(--font-sans); color: var(--color-ink); }
.timeline .note.today { color: var(--color-accent); }
.timeline .note.end { margin-left: 0; transform: translateX(calc(-100% - 6px)); }
.timeline .scale { top: 0; height: 6px; border-left: 1px solid var(--color-muted); }
.timeline .scale .label { position: absolute; top: 12px; left: 0; transform: translateX(-50%); white-space: nowrap; font: 400 var(--type-caption)/1 var(--font-sans); color: var(--color-muted); }
.timeline .scale.start .label { transform: none; }
.timeline .scale.end .label { transform: translateX(-100%); }
.timeline figcaption { font: var(--type-caption)/1.5 var(--font-sans); color: var(--color-muted); }

/* Pairs: labelled values in two columns, each label set like a table's head (a record's status and dates, a
   first look's figures, what a pass did). Markup: dl.pairs of dt and dd; a span.muted in a dd is its caption, on
   a line of its own. */
.pairs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; }
.pairs dt { padding-top: 2px; font: 600 var(--type-kicker)/1.6 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); }
.pairs dd { margin: 0; }
.pairs dd .muted { display: block; }

/* On an app screen (`app` on the body, or on a block that shows one), prose keeps the serif, because Spectral
   carries reading wherever it is, and an h4 is the label over a block inside a section, set like the prose's
   h4. The label has no specificity, so a page or the prose spaces it. */
.app .prose { font: var(--type-body)/1.65 var(--font-serif); font-variant-numeric: normal; }
:where(.app) h4 { margin: 0 0 var(--space-2); font: 600 var(--type-kicker)/1.4 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--color-ink-soft); }

/* Prose: a long reading page (a plan, a design record) set from plain markup, at one measure.
   Headings, paragraphs, lists, quotes, code and rules take their spacing here; its tables are
   `.table`, its charts a `figure` holding the chart's PNG. */
.prose { max-width: 46em; }
.prose > * + * { margin-top: var(--space-4); }
.prose h1 { font-size: var(--type-headline); line-height: 1.15; }
.prose h2 { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-hairline); font-size: var(--type-lede); line-height: 1.3; }
.prose h3 { margin-top: var(--space-5); font-size: var(--type-body); line-height: 1.4; }
.prose h4, .prose h5, .prose h6 { margin: var(--space-5) 0 0; font: 600 var(--type-kicker)/1.4 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--color-ink-soft); }
.prose h1 + *, .prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: var(--space-2); }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 1.4em; }
.prose li + li, .prose li > ul, .prose li > ol { margin-top: var(--space-1); }
.prose li > p + p { margin-top: var(--space-2); }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: var(--space-4); border-left: 2px solid var(--color-accent); color: var(--color-ink-soft); }
.prose code { font: .86em/1.4 var(--font-mono); background: var(--color-canvas); padding: .1em .3em; }
.prose pre { overflow-x: auto; padding: var(--space-3) var(--space-4); background: var(--color-canvas); font: var(--type-caption)/1.5 var(--font-mono); }
.prose pre code { padding: 0; background: none; font: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--color-hairline); }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure img { display: block; max-width: 100%; height: auto; }
.prose figcaption { margin-top: var(--space-2); font: var(--type-caption)/1.5 var(--font-sans); color: var(--color-muted); }
.prose .table { display: block; overflow-x: auto; }

@media (max-width: 900px) {
  .rail { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .rail > .kicker { padding-top: 0; }
}
@media (max-width: 700px) {
  :root { --bar: 56px; }
  /* On a phone the bar is two rows: the lockup and the action, then the sections, which scroll. */
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: calc(var(--bar) - 1px); height: auto; gap: 0 var(--space-4); }
  .bar .lockup { height: 26px; }
  .bar nav { grid-row: 2; grid-column: 1 / -1; gap: var(--space-5); overflow-x: auto; padding-bottom: 14px; }
  .table .secondary { display: none; }
  .timeline .scale.minor .label { display: none; }
  /* The day's figures three to a row, the sheet in one column, the aside ruled off under the main column. */
  .figures { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--space-3); }
  .figures > div:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .figures > div:nth-child(n + 4) { padding-top: 10px; border-top: 1px solid var(--color-grid); }
  .figures .secondary { display: none; }
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .sheet > .aside { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-hairline); }
}
