/* ProofCube app: shell and per-view rules. Tokens: css/tokens.css; reset and type: css/base.css; components: css/components.css.
   Runs, run panel and measurements rules (formerly runs.css) are at the end of this file. */
.sample-note button { min-height: 44px; }
/* the header's one-row controls (pill, Retry now and its answer) are all --chip-h high and never wrap, so showing or hiding Retry now, or its answer, cannot change the header's height */
.retry-wrap { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: .4rem; height: var(--chip-h); min-width: 0; max-width: 100%; }
.retry-wrap[hidden], .retry-btn[hidden] { display: none; }
.retry-btn { height: var(--chip-h); min-height: var(--chip-h); padding-top: 0; padding-bottom: 0; }
#retry-result { min-width: 0; max-width: 16rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th button.sort { min-height: 44px; min-width: 24px; }
.grid td a { display: inline-block; min-height: 44px; line-height: 44px; margin-right: .5rem; }
@media (max-width: 720px) {
  html { scroll-padding-bottom: 4.5rem; }
  .assist { margin-bottom: 4.5rem; } /* the docked panel ends above the fixed bottom navigation, so its Close button can be scrolled clear */ /* a focused control scrolls clear of the fixed bottom navigation (WCAG 2.4.11) */
  .grid:not(.wide) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .grid:not(.wide), .grid:not(.wide) tbody, .grid:not(.wide) tr, .grid:not(.wide) td { display: block; width: 100%; }
  .grid:not(.wide) tr { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); margin-bottom: .75rem; padding: .5rem .75rem; }
  .grid:not(.wide) td { background: transparent; }
  .grid:not(.wide) td { border: 0; padding: .2rem 0; }
  .grid:not(.wide) td::before { content: attr(data-label) ": "; font-weight: 700; } /* the graph links stay a real table on a phone and scroll sideways inside .tscroll */
  .tiles { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
}
/* offline banner (design 4.9): a one-line slot (44 px) that is always laid out, so the banner appearing moves nothing. Amber tint, text pair of at least 4.5:1
   in light and dark, a left rule. The sentence is cut to one line with an ellipsis; Details lays the row over the content (absolute) without pushing it. */
.offline-slot { position: relative; height: 44px; }
.offline-row { display: flex; align-items: center; gap: .5rem; min-height: 44px; background: var(--banner-bg); color: var(--banner-fg); border-bottom: 1px solid var(--warn); border-left: 6px solid var(--warn); }
.offline-row:not([data-shown]) { visibility: hidden; }
.offline-banner { flex: 1; min-width: 0; margin: 0; padding: .5rem 0 .5rem 1rem; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-details { flex: none; margin-right: .5rem; color: var(--banner-fg); }
.offline-row[data-open] { position: absolute; top: 0; left: 0; right: 0; z-index: 6; align-items: flex-start; }
.offline-row[data-open] .offline-banner { white-space: normal; overflow: visible; }
.warnbar { position: fixed; left: 0; right: 0; bottom: var(--bottom-nav-h); z-index: 4; } /* storage notices overlay the page */
.warnbar p { margin: 0; padding: .5rem 1rem; background: var(--banner-bg); color: var(--banner-fg); border-top: 1px solid var(--warn); border-left: 6px solid var(--warn); font-size: .9rem; }
body:has(.warnbar p:not([hidden])) main { margin-bottom: 12rem; }
@media (max-width: 720px) { .retry-wrap { flex: 1 0 4.5rem; } #retry-result { max-width: none; }
}
.toast { position: fixed; right: 1rem; bottom: 1rem; max-width: min(28rem, calc(100vw - 2rem)); }

/* Status marks (js/status.js): shape + word + colour; the shape is stroke only and takes the text colour, so forced-colors keeps it. */
.st-shape { width: 1em; height: 1em; vertical-align: -.15em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.st-checked { color: var(--st-ok); } .st-refuted { color: var(--err); } .st-undecided { color: var(--muted); } .st-refused { color: var(--warn); }
.st-not-run { color: var(--muted); } .st-stale { color: var(--warn); } .st-queued, .st-running { color: var(--accent); } .st-hand { color: var(--warn); }
.badge.st-hand { border-style: dotted; border-width: 2px; } .badge.st-not-run { border-style: dashed; }

/* Entity tabs (views/entitytabs.js): buttons with role=tab; the selected one is filled and bold, so it is not colour alone. */
[role="tabpanel"]:focus-visible { outline: var(--ring) solid var(--focus); outline-offset: 2px; }

/* Forced colors (Windows High Contrast and similar; PWA design 12): the browser replaces every colour with system colours, so a state that is only a fill
   disappears. The current page and the chosen tab are therefore also marked by a heavier border and an underline, which survive. Borders, focus
   outlines (3 px, kept) and the status shapes (stroke: currentColor) are drawn in system colours by the browser and need nothing more. */
@media (forced-colors: active) {
  .navlink[aria-current="page"], .landing a[aria-current="page"], .tabs a[aria-current="page"], .tabs [role="tab"][aria-selected="true"] { border: 3px solid Highlight; text-decoration: underline; text-decoration-thickness: .15em; }
}

/* Assistant panel shell (views/assist.js): hidden until opened; docked at the right edge from 1100 px up, below the main content on narrower screens. */
.assist { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface); }
@media (min-width: 1100px) {
  body[data-assist="open"] main { margin-right: 22rem; }
  body[data-assist="open"] .assist { position: fixed; top: 4rem; right: 0; bottom: 0; width: 21rem; overflow: auto; border-top: 0; border-left: 1px solid var(--border); box-sizing: border-box; }
}
.chip { border: 1px solid var(--line, currentColor); border-radius: 999px; padding: .25rem .75rem; background: transparent; color: inherit; font: inherit; cursor: pointer; min-height: 2rem; }
.chip[aria-pressed="true"] { border-width: 3px; font-weight: 600; }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.views { list-style: none; padding: 0; margin: .5rem 0; }
.views li { margin: .25rem 0; }

/* Dense density (Settings > Appearance): spacing only, same words and controls. Targets stay at least 24 by 24 CSS px (WCAG 2.5.8); Guided keeps 44. */
:root[data-density] main { padding-top: .5rem; }
:root[data-density] .grid th, :root[data-density] .grid td { padding: .15rem .4rem; }
@media (max-width: 720px) { :root[data-density] .list-table td { padding: 0; } }
:root[data-density] .grid th button.sort { min-height: 24px; min-width: 24px; padding: .1rem .25rem; }
:root[data-density] .grid td a { min-height: 24px; line-height: 24px; }
:root[data-density] .grid td button { min-height: 24px; padding-top: .1rem; padding-bottom: .1rem; }
:root[data-density] .chip { min-height: 24px; padding: .05rem .6rem; }
:root[data-density] .field { margin-bottom: .4rem; }
:root[data-density] .tile .num { font-size: 1.5rem; }

/* Alerts (views/alerts.js, views/alertrules.js). The level carries a shape and a word; unread is a word too. */
.alerts { list-style: none; padding: 0; margin: .5rem 0; }
.alert { border-bottom: 1px solid var(--line, currentColor); padding: .5rem 0; overflow-wrap: anywhere; }
.alert[data-read="no"] { border-left: 4px solid currentColor; padding-left: .5rem; }
.alert details { display: inline-block; margin-left: .5rem; }
fieldset.rule { margin: .5rem 0; }

.tile .badge.ev { color: var(--fg); }
.bar { stroke: var(--fg); stroke-width: 1; }
.bar.live { fill: var(--accent); }
.bar.ended { fill: var(--panel); }
/* Forced colors: system colours only (the page's own colours are replaced there); each bar state also differs by more than colour: live has a heavy edge, not-run a dashed edge and the hatch, ended a plain edge. */
@media (forced-colors: active) {
  .bar { stroke: CanvasText; }
  .bar.live { fill: Highlight; stroke-width: 3; }
  .bar.ended { fill: Canvas; }
}
.empty .btn { margin-top: var(--sp-2); }

/* kind switch: one scrolling row, never four wrapped rows */
.tabs.kinds { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scroll-snap-type: x proximity; margin-top: var(--sp-3); }
.tabs.kinds a { flex: none; white-space: nowrap; scroll-snap-align: center; }
.chip { border-color: var(--border-strong); font-size: var(--fs-sm); }
.chip[aria-pressed="true"] { border-width: 1px; }
.empty .actions { justify-content: center; }
.results { list-style: none; margin: 0 0 var(--sp-4); padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.result { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--surface-2); }
@media (min-width: 721px) { html { scroll-padding-bottom: 6rem; }
}
.history { padding-left: 1.2rem; }

@media (max-width: 720px) {
  .result { padding: var(--sp-3); } /* the state chip leads; evidence is a quiet word */

}
@media (pointer: coarse) {
  .tabs.kinds a, .tabset > .tabs [role="tab"] { min-height: var(--hit); }
}
/* ===== end S4 ===== */
/* ===== S2 shell: header, sidebar / tab bar, breadcrumbs, landing tabs, palette, shortcut sheet (APP-DESIGN S2; self-contained block) ===== */
:root { --tabbar-h: 3.5rem; --bottom-nav-h: 0px; } /* the height the fixed phone tab bar takes (0 on a desktop); the graph sheet and main's padding read it */
html { scroll-padding-top: calc(var(--topbar-h) + var(--sp-3)); }
kbd { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font: var(--fw-medium) var(--fs-xs)/1.3rem var(--font-mono); text-align: center; white-space: nowrap; }
/* header: one row, 56 px, sticky. The chips in it are --chip-h high: 36 px with a mouse, 44 px on a touch screen or a phone. */
.top { --chip-h: 2.25rem; position: sticky; top: 0; z-index: var(--z-nav); display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-3); height: var(--topbar-h); padding: 0 var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border); }
@media (pointer: coarse), (max-width: 720px) { .top { --chip-h: var(--hit); }
}
.brand { flex: none; display: inline-flex; align-items: center; gap: .6rem; min-height: var(--chip-h); color: var(--text); text-decoration: none; font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: -.01em; }
/* Proof Knot bl5 (README "Logo"): the lockup when wide, else the mark; the -dark files on dark (--knot-l, --knot-d) */
.brand img { flex: none; } .knot { width: 2.625rem; height: 2.625rem; } .knot-wide { height: auto; } .brand .knot-l { display: var(--knot-l); } .brand .knot-d { display: var(--knot-d); }
@media (max-width: 720px), (max-height: 520px) { .brand .knot-wide { display: none; } }
@media (min-width: 721px) and (min-height: 521px) { .brand .knot, .brand strong { display: none; } }
.brand:hover { color: var(--text); }
.palette-open { flex: 1 1 14rem; max-width: 26rem; min-width: 0; margin-left: var(--sp-4); justify-content: flex-start; min-height: var(--chip-h); height: var(--chip-h); padding: 0 var(--sp-3); gap: var(--sp-2); background: var(--surface-2); border-color: var(--border); box-shadow: none; color: var(--text-2); font-weight: var(--fw-regular); }
.palette-open:hover:not(:disabled) { background: var(--surface-sunken); border-color: var(--border-strong); }
.po-keys { margin-left: auto; display: inline-flex; gap: var(--sp-1); }
.assist-toggle { margin-left: auto; min-height: var(--chip-h); height: var(--chip-h); padding: 0 var(--sp-3); gap: var(--sp-2); }
.top .pill { flex: 0 1 auto; min-width: 0; max-width: 15rem; min-height: var(--chip-h); height: var(--chip-h); }
.pill-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-tip { display: none; position: absolute; top: calc(100% - 4px); right: var(--sp-4); z-index: var(--z-popover); width: min(21rem, calc(100vw - 1.5rem)); flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--sh-3); font-size: var(--fs-sm); }
.pill-tip::before { content: ""; position: absolute; left: 0; right: 0; top: -.6rem; height: .6rem; }
.pill-tip .tip-probe { color: var(--text-3); font-size: var(--fs-xs); }
#mode-pill:hover ~ .pill-tip, #mode-pill:focus-visible ~ .pill-tip, .pill-tip:hover { display: flex; }
.top[data-esc] .pill-tip { display: none; }
/* sidebar (desktop): sticky under the header, grouped, with a collapsed rail kept in localStorage; the same element is the phone's tab bar below */
#nav { float: left; position: sticky; top: var(--topbar-h); z-index: var(--z-sticky); display: flex; flex-direction: column; gap: var(--sp-4); width: var(--sidebar-w); height: calc(100vh - var(--topbar-h)); padding: var(--sp-4) var(--sp-3); overflow-y: auto; overflow-x: hidden; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.navlink, #nav button.navlink { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: var(--sp-3); width: 100%; min-height: var(--hit); padding: 0 var(--sp-3); border: 1px solid transparent; border-radius: var(--r-md); background: transparent; box-shadow: none; text-decoration: none; text-align: left; color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.navlink:hover, #nav button.navlink:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; color: var(--text); }
.navlink[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semibold); }
.navlink .ic { width: 1.25rem; height: 1.25rem; }
a[data-n]:not([data-n=""])::after { content: attr(data-n); margin-left: auto; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: var(--r-full); display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-fg); font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.more-menu { position: fixed; z-index: var(--z-popover); left: calc(var(--sidebar-w) + var(--sp-2)); bottom: var(--sp-4); min-width: 14rem; }
.more-menu[hidden] { display: none; }
.more-menu [aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semibold); }
:root[data-nav="rail"] { --sidebar-w: var(--sidebar-w-collapsed); }
:root[data-nav="rail"] .nav-label { display: none; }
:root[data-nav="rail"] .nl-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root[data-nav="rail"] #nav { padding-inline: var(--sp-2); }
:root[data-nav="rail"] .navlink { justify-content: center; padding: 0; }
:root[data-nav="rail"] a[data-n]:not([data-n=""])::after { position: absolute; top: 3px; right: 3px; min-width: 1rem; height: 1rem; margin: 0; font-size: 10px; }
:root[data-nav="rail"] .nav-collapse .ic { transform: scaleX(-1); }
main { margin-left: max(var(--sidebar-w), calc((100% + var(--sidebar-w) - var(--content-max)) / 2)); padding: var(--sp-4) var(--sp-5) var(--sp-8); max-width: var(--content-max); }
body[data-assist="open"] main { margin-left: var(--sidebar-w); }
@media (min-width: 1100px) { body[data-assist="open"] .assist { top: var(--topbar-h); }
}
@media (min-width: 721px) and (max-height: 520px) { /* landscape phone: the rail, and a header that scrolls away */
  :root { --sidebar-w: var(--sidebar-w-collapsed); --topbar-h: 3rem; }
  .top { position: static; } #nav { top: 0; height: 100vh; padding-inline: var(--sp-2); gap: var(--sp-2); } html { scroll-padding-top: 0; }
  .nav-label, #nav button.nav-collapse { display: none; }
  .nl-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .navlink { justify-content: center; padding: 0; }
  a[data-n]:not([data-n=""])::after { position: absolute; top: 3px; right: 3px; min-width: 1rem; height: 1rem; margin: 0; font-size: 10px; }
}
/* breadcrumbs and the in-page tabs of Work, Library and Explore */
.crumbs { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; color: var(--text-2); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; margin: 0 var(--sp-2); color: var(--text-3); }
.crumbs a, .crumbs span { display: inline-flex; align-items: center; justify-content: center; min-height: 1.75rem; min-width: 1.5rem; padding: 0 .125rem; color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--text); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-3); }
.meta a { display: inline-flex; align-items: center; min-height: 1.75rem; min-width: 1.5rem; }
.meta > * + *::before { content: "\00b7"; margin-right: var(--sp-3); }
.landing { display: flex; gap: 2px; width: max-content; max-width: 100%; margin: var(--sp-2) 0 var(--sp-4); padding: 3px; overflow-x: auto; scrollbar-width: none; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-md); }
.landing::-webkit-scrollbar { display: none; }
.landing a { flex: none; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 2.25rem; padding: 0 var(--sp-3); border: 1px solid transparent; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.landing a:hover { background: var(--surface-2); color: var(--text); }
.landing a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: var(--fw-semibold); box-shadow: var(--sh-1), 0 0 0 1px var(--border-strong); }
@media (pointer: coarse) { .landing a, .crumbs a, .crumbs span { min-height: var(--hit); }
}
.landing a[data-n]:not([data-n=""])::after { margin-left: 0; }
/* phone: a compact header (brand, one search button, assistant, the mode chip) and a fixed bottom tab bar of 5 that main leaves room for */
@media (max-width: 720px) {
  :root { --topbar-h: 3.5rem; --bottom-nav-h: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .top { gap: var(--sp-2); padding: 0 var(--sp-3); }
  .palette-open { flex: none; width: var(--hit); max-width: none; margin-left: auto; padding: 0; justify-content: center; }
  .po-text, .po-keys, .at-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .assist-toggle { margin-left: 0; width: var(--hit); padding: 0; }
  .pill-tip { right: var(--sp-3); }
  #nav { position: fixed; top: auto; right: 0; bottom: 0; left: 0; float: none; flex-direction: row; gap: 0; width: auto; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 var(--sp-1) env(safe-area-inset-bottom); overflow: visible; background: var(--surface); border-top: 1px solid var(--border); z-index: var(--z-nav); }
  .nav-group, .nav-foot, .nav-more { display: contents; }
  .nav-label, #nav button.nav-collapse { display: none; }
  .navlink, #nav button.navlink { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; width: auto; min-height: var(--tabbar-h); padding: 4px 2px; border-radius: var(--r-md); font-size: var(--fs-xs); text-align: center; }
  .navlink[aria-current="page"] { background: transparent; }
  .navlink[aria-current="page"] .ic { background: var(--accent-soft); border-radius: var(--r-full); box-shadow: 0 0 0 5px var(--accent-soft); }
  a[data-n]:not([data-n=""])::after { position: absolute; top: 4px; left: calc(50% + .45rem); margin: 0; min-width: 1rem; height: 1rem; font-size: 10px; }
  .more-menu { left: auto; right: var(--sp-2); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sp-2)); }
  main { margin-left: 0; padding: 0 1rem calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sp-6)); max-width: none; }
}
@media (max-width: 430px) { .brand { min-width: var(--hit); justify-content: center; } .brand strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
#palette { display: flex; flex-direction: column; width: min(40rem, 100%); max-height: 72vh; overflow: hidden; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--sh-3); }
#palette mark { background: none; color: inherit; font-weight: var(--fw-bold); text-decoration: underline; }
@media (max-width: 720px) { #palette { max-height: 80vh; }
}
@media (forced-colors: active) { kbd { border-color: CanvasText; }
} /* the current nav item and landing tab are marked in the forced-colors block above */
@media print { #nav, .top, .skip, .crumbs, .landing { display: none; }
}
/* ===== APP-DESIGN S3: Home, provenance chip, empty states (self-contained block; begin) ===== */
#home > h2 { margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-lg); }
#home > .note, #home > .banner { margin-bottom: var(--sp-4); }
#home > .card { margin-bottom: var(--sp-4); }
#home .card h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--sp-2); }
#home .card h2 .count { font-size: var(--fs-xs); background: var(--neutral-soft); color: var(--text-2); border-radius: var(--r-full); padding: 0 .5rem; font-variant-numeric: tabular-nums; }
.sample-note { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.sample-note .ic { color: var(--info); }
.sample-note .banner-text { flex: 1 1 14rem; }
.sample-note button { margin-left: auto; }
.home-hero { padding: var(--sp-5); }
.home-hero h2 { font-size: var(--fs-xl); margin: 0 0 var(--sp-2); }
.home-hero .lead { max-width: 42rem; color: var(--text-2); font-size: var(--fs-md); margin: 0 0 var(--sp-4); }
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: var(--sp-3); }
.home-action { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ic t go" "ic h go"; grid-template-rows: auto 1fr; column-gap: var(--sp-3); align-items: start; align-content: center; min-height: 4.5rem; text-decoration: none; color: var(--text); padding: var(--sp-3) var(--sp-4); }
.home-action > .ic:first-child { grid-area: ic; align-self: center; width: 1.5rem; height: 1.5rem; color: var(--accent); }
.home-action .ha-title { grid-area: t; font-weight: var(--fw-semibold); }
.home-action .ha-hint { grid-area: h; color: var(--text-2); font-size: var(--fs-sm); }
.home-action .ha-go { grid-area: go; align-self: center; color: var(--text-3); }
.home-action.primary { border-color: var(--accent); background: var(--accent-soft); }
.home-action:hover .ha-title { color: var(--accent); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
.home-grid > .card, .home-side > .card { margin: 0; }
.home-side { display: grid; gap: var(--sp-4); min-width: 0; }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1fr) 22rem; }
}
.run-list { list-style: none; margin: 0; padding: 0; }
.run-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--border); min-height: var(--hit); }
.run-list li:first-child { border-top: 0; }
.run-list .rl-title { font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.run-list .rl-res { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; justify-content: flex-end; }
.run-list .rl-when { grid-column: 1 / -1; margin: 0; font-size: var(--fs-xs); }
.home-attn .attn-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.home-attn .attn-list li { display: flex; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.home-attn .attn-list li:first-child { border-top: 0; }
.home-attn .attn-list .ic { color: var(--warn); margin-top: .15rem; }
.home-attn #attention-none { display: flex; gap: var(--sp-2); align-items: flex-start; }
.home-attn #attention-none .ic { color: var(--ok); margin-top: .15rem; }
.home-attn #last-exported { margin: var(--sp-3) 0 0; padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--sp-2); }
.quick .btn { justify-content: flex-start; }
.home-review { border-left: 4px solid var(--warn); }
.review-counts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.home-skel .card { margin-bottom: var(--sp-4); } .home-skel .skel-tile { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); list-style: none; }
.home-skel .skel-tile .skeleton { margin-bottom: var(--sp-2); }
.more { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); }
/* provenance chip: one quiet chip, a plain-language popover on hover, focus or tap */
.ev-tip { position: relative; display: inline-flex; vertical-align: middle; }
.ev-tip > button.badge.ev { box-shadow: none; min-height: 1.5rem; cursor: help; padding: .05rem .5rem; }
.ev-pop { position: absolute; z-index: var(--z-popover); left: 0; top: calc(100% + 6px); width: 17rem; max-width: 80vw; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); box-shadow: var(--sh-2); font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: var(--fw-regular); letter-spacing: 0; text-align: left; white-space: normal; display: none; pointer-events: none; }
.ev-pop b { display: block; color: var(--text); margin-bottom: var(--sp-1); }
.ev-pop .ev-line { display: block; } .ev-pop .ev-line + .ev-line { margin-top: var(--sp-1); } .ev-pop i { font-style: normal; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text); }
.ev-tip[data-end] .ev-pop { left: auto; right: 0; }
.ev-tip:not([data-dismissed]):hover .ev-pop, .ev-tip:not([data-dismissed]):focus-within .ev-pop, .ev-tip[data-open] .ev-pop { display: block; }
@media (pointer: coarse) { .ev-tip > button.badge.ev { min-height: var(--hit); padding: 0 .85rem; }
}
@media (forced-colors: active) { .ev-pop { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
}
/* ===== APP-DESIGN S3 (end) ===== */

/* ===== APP-DESIGN S8a: assistant panel (views/assist.js, chat/panel.js) (begin) ===== */
.assist { display: flex; flex-direction: column; gap: var(--sp-3); background: var(--surface); box-shadow: var(--sh-2); }
.assist[hidden] { display: none; }
.as-what, .assist .note { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 720px) {
  .assist, body[data-assist="open"] .assist { position: fixed; z-index: var(--z-dialog); left: 0; right: 0; bottom: 0; margin: 0; max-height: 82vh; overflow-y: auto; padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-strong); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--sh-3); box-sizing: border-box; }
}
@media (max-width: 720px) and (max-height: 520px) { .assist, body[data-assist="open"] .assist { max-height: 94vh; }
}
@media (forced-colors: active) { .assist { border: 1px solid CanvasText; }
}
/* ===== APP-DESIGN S8a: assistant panel (end) ===== */
/* ===== S7 screens (Settings, Import and export, Compare, Alerts, Use cases): begin. Self-contained; tokens only. ===== */
/* Settings: grouped inset list, section index on the left (wide) or rows with chevrons (phone). */
.set { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: var(--sp-6); align-items: start; margin-top: var(--sp-4); }
@media (max-width: 899px) {
  .set { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
}

/* Import and export: two cards. */
.tx { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; margin-top: var(--sp-4); }
@media (max-width: 899px) { .tx { grid-template-columns: minmax(0, 1fr); }
}

/* Alerts: cards in a list; rules as sentence-like forms. */
.alerts { display: grid; gap: var(--sp-3); margin: var(--sp-3) 0; }
li.alert { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-1); }
li.alert[data-read="no"] { border-left: 4px solid var(--accent); }
.alerts > li.empty { margin: 0; }
fieldset.rule { box-shadow: var(--sh-1); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
/* The switch knob is a pseudo-element, which the global reduced-motion rule (selector *) does not reach. */
:root[data-motion="reduce"] input.switch::before { transition: none !important; }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="allow"]) input.switch::before { transition: none !important; }
}
/* ===== S7 screens: end ===== */
/* ===== S9a accessibility fixes: begin ===== */
/* Between the phone layout and the 1100 px docked panel the Assistant sits in the page flow under the floated sidebar; keep it clear of the sidebar so its controls are not covered (WCAG 2.4.11, 2.5.8). */
@media (min-width: 721px) and (max-width: 1099px) { .assist { margin-left: var(--sidebar-w); } }
/* WebKit sizes a file input's inner button and label to their own width inside a flex field and pushes the page 150 px sideways at 360 px (WCAG 1.4.10); a block box at the field's width keeps it inside. */
input[type="file"] { display: block; width: 100%; }
/* ===== S9a accessibility fixes: end ===== */
