/* Workspace stylesheet — desktop-first: responsive overrides live in max-width
   media queries placed after their base rules, so source order decides
   equal-specificity ties. 768px (= 48rem) is the shared breakpoint and 480px
   the narrow-phone one; individual components also use 1024px, 640px and 600px
   (and a few one-off widths next to the component that needs them), beside the
   (hover: none), prefers-reduced-motion and print queries.

   Section index (the file opens with fonts + theme tokens, then):
     Public pages
     App shell
     Global search
     Cards, grids, tiles
     Page furniture
     Badges & tags
     Activity tutorial
     Forms & misc
     Form sections (``core.forms.Fieldset``)
     Flash messages
     Achievements
     Brainstorming ideas
     Analyzing network
     Analyzing radar & timeline
     Analyzing competency map
     Analyzing world map
     Radial boards (futures wheel, mindmap)
     Trend board
     Kompetenz-Explorer
     Trend Viewer
     Triage
     Scenario generator
     Empty states
     Breadcrumbs
     Copy-to-clipboard field
     Dashboard workflow
     Command palette & shortcuts
     Analyzing research activity
     Activity focus mode
     Three horizons board
     Idea clustering board
     Whiteboard
     News feed
     Deep research agents
     Real-Time Delphi
     Print
     Scenario matrix (2x2)
     Polak Game
     Competency needs table
     Workshop planner
     Timeline / Gantt
     Theory of Change
     Scenario detail
     Scenario artifacts
     Strategy Explorer
     Signage dashboard */

/* Atkinson Hyperlegible ships regular, italic, bold and bold italic; a 600
   request resolves to the 700 face. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-v12-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-v12-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-v12-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-v12-latin-700italic.woff2") format("woff2");
}

/* Color lives in the generated /branding/style.css: core/styling.py derives
   every token from the palette inputs (core/palette.py) and emits it after this
   sheet, so the rules below only ever read tokens. What stays declared here is
   shape, not color. */
:root {
  /* One monospace stack for every code-like surface (diffs, logs, prompts, the
     markdown editor), so they share a face instead of drifting per rule. */
  --font-mono: ui-monospace, "Cascadia Code", SFMono-Regular, Menlo, Consolas, monospace;

  /* The member shell's topbar height: the notice stack offsets itself by it so
     a flash never covers the site title or the language switch. */
  --topbar-height: 3.25rem;
}

:root[data-theme="dark"] .achievement-card__icon { background: var(--surface-muted); }
:root[data-theme="dark"] .achievement-toast__icon,
:root[data-theme="dark"] .achievement-card--unlocked .achievement-card__icon { background: var(--tint-positive); }

body {
  background: var(--surface-muted);
}

/* Smooth in-page scrolling (anchor links, skip link); the global
   prefers-reduced-motion block (after the flash messages) forces this back to
   auto. */
html {
  scroll-behavior: smooth;
}

/* The sidebar is sticky on mobile, so give the skip-link target headroom to
   land below it instead of underneath. */
#main-content {
  scroll-margin-top: 4rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

.muted {
  color: var(--pico-muted-color);
}

/* One line cut with an ellipsis, for a long identifier. */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A table cell takes the row's leftover width instead of widening the table. */
td.truncate {
  width: 100%;
  max-width: 0;
  min-width: 8rem;
}

/* "Something is on its way" for any surface that fills from a fetch — a
   suggestion list, a board's first render. A sheen crossing the element beats a
   spinner sitting next to it, because it occupies the space the content will.
   The global reduced-motion block stills it. */
.is-loading {
  position: relative;
}
.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--ink) 8%, transparent),
    transparent
  );
  /* The sheen travels by background-position, not transform: the element is
     often a search form whose suggestion dropdown hangs outside it, so it
     cannot be given an overflow clip to keep a moving child inside. */
  background-size: 250% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  from { background-position: 250% 0; }
  to { background-position: -250% 0; }
}

/* Keyboard focus should always be clearly visible; Pico only styles a subset of
   interactive elements, so cover everything focusable in one place. The -ink
   accent is the theme-aware one — the deep velvet base all but disappears
   against a dark surface. */
:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* Pressed feedback: button-shaped controls dip slightly while active. The
   independent translate property composes with transform instead of replacing
   it — :active reaches every ancestor of the pressed element, and a container
   with role=button may be positioned by a transform of its own (the whiteboard
   note), which a transform here would cancel for as long as the press lasts. */
button:not(:disabled):active,
[role="button"]:active,
[type="submit"]:not(:disabled):active {
  translate: 0 1px;
}

/* Screen-reader-only: visually hidden but announced and reachable by AT. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: off-screen until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--brand-velvet);
  color: var(--on-brand);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---------- Public pages ---------- */

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.public-main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Kept after both base rules so source order lets the narrow padding win. */
@media (max-width: 768px) {
  .public-header {
    padding: 0.75rem 1rem;
  }
  .public-main {
    padding: 1.5rem 1rem;
  }
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* The app shell stretches to the viewport, so the footer settles at the bottom
   rather than trailing a short page. */
.app-main > .public-footer {
  margin-top: auto;
}

.public-footer-brand {
  display: inline-flex;
  color: var(--brand-moss-ink);
}

.public-footer-brand .brand-logo {
  font-size: 1.35rem;
}

.public-footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.public-footer-nav a {
  text-decoration: none;
}

/* Cookie-consent banner: a non-modal bar at the bottom of every page the
   operator asks for consent on. It sits last in the DOM, so
   it is read after the page rather than ahead of it. Sticky rather than fixed:
   it stays in flow and so reserves exactly its own height — however long the
   operator's wording turns out to be — instead of floating over the last row of
   the page it is shown on. */
.cookie-banner {
  position: sticky;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 100%;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -2px 12px var(--shadow-medium);
}

.cookie-banner h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin: 0;
}

@media (max-width: 640px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }
}

.legal-page {
  max-width: 46rem;
}

/* Documentation browser: page tree | prose | "on this page" rail. The third
   column exists only while the open doc has a table of contents
   (.docs-layout--rail); hub and index pages stay two columns. */
.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2rem 2.5rem;
  align-items: start;
}

.docs-layout--rail {
  grid-template-columns: 15rem minmax(0, 1fr) 12rem;
}

/* Below rail width the TOC leaves its column and sits as a compact card above
   the prose; the page tree spans both of those rows. */
@media (max-width: 1280px) {
  .docs-layout--rail {
    grid-template-columns: 15rem minmax(0, 1fr);
    row-gap: 1.5rem;
  }

  .docs-layout--rail .docs-index {
    grid-row: 1 / span 2;
  }

  .docs-layout--rail .docs-toc {
    grid-column: 2;
    grid-row: 1;
  }

  .docs-layout--rail .docs-layout__content {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 768px) {
  .docs-layout,
  .docs-layout--rail {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .docs-layout--rail .docs-index {
    grid-row: auto;
  }

  .docs-layout--rail .docs-layout__content {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Pico lays a <nav> and its lists out as a horizontal menu bar: flex row,
   negative gutter margins on the first/last <ul> and menu-item padding on
   every <li> and link. Both docs navs are vertical lists; the ul reset keeps
   the nav.* form because Pico's `nav ul:first-of-type` margin rule carries
   class-level specificity that a bare `.docs-* ul` selector would lose to. */
nav.docs-index,
nav.docs-toc {
  display: block;
}

nav.docs-index ul,
nav.docs-toc ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-index li,
.docs-toc li {
  display: block;
  margin: 0;
  padding: 0;
}

.docs-index a,
.docs-toc a {
  display: block;
  margin: 0;
  text-decoration: none;
}

.docs-index {
  position: sticky;
  top: 1rem;
  /* The list is longer than a laptop viewport, and a sticky element does not
     scroll with the page — without its own scroller its last pages are
     unreachable while reading a doc. */
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .docs-index {
    position: static;
    max-height: none;
  }
}

/* Beats Pico's input margin-bottom, which carries a :not() class level. */
.docs-index .docs-index__filter {
  margin-bottom: 1rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  height: auto;
}

.docs-index__empty {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.docs-index__heading {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.docs-index__heading a {
  color: inherit;
  text-decoration: none;
}

/* Folder groups in the page tree — mirror the docs/ subfolder tree. Pico
   treats every <details> as an accordion; strip its bottom margin and
   chevron, the summary draws its own triangle. */
.docs-index__folder {
  margin: 0;
}

.docs-index__folder > summary {
  cursor: pointer;
  list-style: none;
  line-height: 1.4;
}

.docs-index__folder > summary::-webkit-details-marker {
  display: none;
}

.docs-index__folder > summary::after {
  display: none;
}

/* The disclosure triangle, drawn by hand so it sits inside the heading's
   letter-spaced small caps rather than beside them. */
.docs-index__folder > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: 0.15rem;
  letter-spacing: normal;
  transition: transform 0.15s ease;
}

.docs-index__folder[open] > summary::before {
  transform: rotate(90deg);
}

/* The doubled class beats Pico's accordion summary color, which carries a
   :not([role]) class level. */
.docs-index .docs-index__group {
  margin: 1.25rem 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.docs-index .docs-index__group:hover {
  color: var(--ink);
}

.docs-index__folder > ul {
  border-left: 1px solid var(--border-soft);
}

.docs-index a {
  padding: 0.3rem 0.6rem;
  border-radius: var(--pico-border-radius);
  color: var(--ink);
}

.docs-index__folder a {
  padding-left: 1rem;
}

.docs-index a:hover {
  background: var(--pico-muted-border-color);
}

.docs-index a.active {
  background: var(--pico-muted-border-color);
  font-weight: 600;
}

.docs-layout__content {
  max-width: 48rem;
  min-width: 0;
}

/* Anchor jumps from the TOC would otherwise land flush with the viewport edge. */
.docs-layout__content .prose :is(h1, h2, h3, h4) {
  scroll-margin-top: 1rem;
}

.docs-layout__trail {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.docs-toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.85rem;
}

.docs-toc__heading {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Each link carries a segment of one continuous rail line. */
.docs-toc a {
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 2px solid var(--border-soft);
  line-height: 1.4;
  color: var(--ink-muted);
}

.docs-toc a:hover {
  border-left-color: var(--pico-primary);
  color: var(--ink);
}

.docs-toc__level-1 a {
  padding-left: 1.6rem;
}

/* Below rail width (the layout reflow above) the TOC becomes a card above the
   prose; its entries flow into columns so the card stays shallow. */
@media (max-width: 1280px) {
  .docs-toc {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding: 0.85rem 1.1rem 0.95rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
  }

  nav.docs-toc ul {
    columns: 14rem;
    column-gap: 2.5rem;
  }

  .docs-toc li {
    break-inside: avoid;
  }

  .docs-toc a {
    border-left: 0;
    padding: 0.2rem 0;
  }

  .docs-toc__level-1 a {
    padding-left: 0.9rem;
  }
}

/* nav.* form so it beats the nav.docs-toc display opt-out above. */
@media (max-width: 768px) {
  nav.docs-toc {
    display: none;
  }
}

.docs-pager {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.docs-pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--ink);
}

.docs-pager__link--next {
  margin-left: auto;
  text-align: right;
}

.docs-pager__dir {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.docs-pager__title {
  font-weight: 600;
}

/* nh3 strips every class from the rendered Markdown, so the doc's own elements
   are styled by tag under this container. The reference tables are wide; let
   them scroll rather than squeeze the prose column. */
.docs-layout__content .prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  font-size: 0.9rem;
  border-collapse: collapse;
}

.docs-layout__content .prose th,
.docs-layout__content .prose td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--pico-muted-border-color);
}

.docs-layout__content .prose th {
  background: var(--pico-card-background-color);
  font-weight: 600;
}

.docs-layout__lead {
  color: var(--ink-muted);
}

.docs-layout__hubs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.docs-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  text-decoration: none;
  color: var(--ink);
}

.docs-hub-card:hover {
  border-color: var(--pico-primary);
}

.docs-hub-card__title {
  font-weight: 600;
}

.docs-hub-card__desc {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* The parts a documentation PDF holds: a checkbox each, the part's docs beneath
   its name. Shared by the docs browser and the console. */
.docs-export {
  max-width: 42rem;
}

.docs-parts__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.docs-parts__item input[type="checkbox"] {
  flex: none;
  margin-top: 0.2rem;
}

.docs-parts__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.docs-parts__label {
  font-weight: 600;
}

.docs-parts__docs {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Read-only repo source viewer: a line-numbered file, or a directory listing. */
.docs-source-page {
  max-width: 62rem;
}

.docs-source-page__head h1 {
  font-size: 1.05rem;
  word-break: break-all;
}

.docs-source {
  counter-reset: srcline;
  overflow-x: auto;
  margin: 0;
  padding: 0.6rem 0;
  font-size: 0.8rem;
  line-height: 1.55;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.docs-source .src-line {
  counter-increment: srcline;
}

/* The number is the anchor: clicking it deep-links to that line. */
.docs-source .src-line__no::before {
  content: counter(srcline);
  display: inline-block;
  width: 3em;
  margin-right: 1em;
  padding-right: 0.6em;
  text-align: right;
  color: var(--ink-muted);
  border-right: 1px solid var(--pico-muted-border-color);
  user-select: none;
  -webkit-user-select: none;
}

.docs-source .src-line:target {
  display: block;
  background: var(--pico-muted-border-color);
}

.docs-source .src-line__no {
  text-decoration: none;
}

.docs-source-page__trunc {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.docs-source-page__dir {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-source-page__dir li {
  padding: 0.25rem 0;
}

.docs-source-page__dir li.is-dir a {
  font-weight: 600;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  color: var(--brand-moss-ink);
}

.brand-logo {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--pico-primary);
}

/* The built-in wordmark — bracket, IN/ZU/KO, arrow — is real text in the body
   face: every measure is in em, so the footer's and header's font-size scale
   the whole mark, and currentColor carries it into the dark scheme. */
.brand-wordmark {
  color: var(--brand-moss-ink);
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 0.16em;
  padding: 0.06em 0.7em 0.42em 0;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-wordmark::before {
  content: "";
  flex: none;
  width: 0.3em;
  border: 0.1em solid currentColor;
  border-right: 0;
}

.brand-wordmark__text {
  padding-top: 0.12em;
}

.brand-wordmark__arrow {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.85em;
  height: 0.42em;
}

/* The corporate design's ribbon (templates/partials/brand_ribbon.html): five
   stroked segments, one per brand hue. */
.brand-ribbon {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.brand-ribbon__segment {
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-ribbon__segment--velvet { stroke: var(--brand-velvet); }
.brand-ribbon__segment--cornflower { stroke: var(--brand-cornflower); }
.brand-ribbon__segment--olive { stroke: var(--brand-olive); }
.brand-ribbon__segment--monarch { stroke: var(--brand-monarch); }
.brand-ribbon__segment--pink-silk { stroke: var(--brand-pink-silk); }

/* The ribbon as a "please wait" mark (brand_ribbon.html with loader=True),
   sized to the text it sits in. It crawls along its own path: each segment
   draws in after the one before and is wiped from its start once the next is
   down, so a worm two segments long travels the ribbon and leaves it empty for
   a beat before the next pass. Every segment measures 1 (pathLength), so one
   dash of 1 with a gap of 2 slides from just before the segment (1.05) to just
   past it (-1.05). Reduced motion leaves the whole ribbon drawn: the resting
   offset is 0. A whitelabelled workspace gets a straight line (--plain). */
.brand-ribbon--loader {
  display: inline-block;
  flex: none;
  width: 3.5em;
  vertical-align: middle;
}
/* Beside a status badge in a heading, scaled to the badge, not the heading. */
.page-title .brand-ribbon--loader {
  width: 2em;
}
.brand-ribbon--loader .brand-ribbon__segment {
  stroke-width: 30;
  stroke-dasharray: 1 2;
  animation: ribbon-crawl 1.6s linear infinite backwards;
}
.brand-ribbon--loader .brand-ribbon__segment:nth-child(2) { animation-delay: 0.2s; }
.brand-ribbon--loader .brand-ribbon__segment:nth-child(3) { animation-delay: 0.4s; }
.brand-ribbon--loader .brand-ribbon__segment:nth-child(4) { animation-delay: 0.6s; }
.brand-ribbon--loader .brand-ribbon__segment:nth-child(5) { animation-delay: 0.8s; }
/* Velvet is nearly the dark surface's own color; its -ink tone is the same
   velvet on light and lifted on dark, so the moving head never vanishes. */
.brand-ribbon--loader .brand-ribbon__segment--velvet { stroke: var(--brand-velvet-ink); }
.brand-ribbon--plain .brand-ribbon__segment { stroke: var(--action); }
@keyframes ribbon-crawl {
  0% { stroke-dashoffset: 1.05; }
  12.5%, 25% { stroke-dashoffset: 0; }
  37.5%, 100% { stroke-dashoffset: -1.05; }
}

/* The page loader (partials/page_loader.html): while the next page is on its
   way, the whole ribbon swims across the top edge of the viewport, a loading bar
   in the brand's shape. It lies over the top bar and takes no clicks. Reduced
   motion leaves it resting in the middle. */
.page-loader {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1100;
  height: 1.5rem;
  overflow: hidden;
  pointer-events: none;
}
.page-loader .brand-ribbon {
  display: block;
  width: 7.5rem;
  translate: calc(50vw - 50%) 0;
  animation:
    page-loader-cross 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite,
    page-loader-swim 0.6s ease-in-out infinite alternate;
}
.page-loader .brand-ribbon__segment {
  stroke-width: 20;
  stroke-dasharray: none;
  animation: none;
}
@keyframes page-loader-cross {
  from { translate: -100% 0; }
  to { translate: 100vw 0; }
}
@keyframes page-loader-swim {
  to { scale: 1 0.55; }
}

.brand-name {
  font-weight: 600;
}

.hero {
  padding: 2rem 0 1rem;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  max-width: 30ch;
}

.hero-lead {
  max-width: 60ch;
  font-size: 1.1rem;
}

.hero--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 3rem;
  padding-bottom: 2rem;
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--action-ink);
}

.hero--split h1 {
  margin-bottom: 1rem;
}

.hero-cta {
  width: auto;
  margin-top: 0.5rem;
}

.hero-copy .brand-ribbon {
  max-width: 22rem;
  margin-top: 1.5rem;
}

.hero-figure {
  position: relative;
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1.5rem 3rem -1.5rem var(--shadow-strong);
}

.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  filter: grayscale(1);
}

/* The manual's imagery: a black-and-white photo with the ribbon winding over
   its lower edge. The figure clips overflow, so the ribbon may run past it. */
.hero-figure .brand-ribbon {
  position: absolute;
  left: -3%;
  bottom: 6%;
  width: 106%;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero--split {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .hero--split .hero-figure {
    order: -1;
  }
}

.login-card {
  max-width: 26rem;
  margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: 2rem;
}

.login-card .brand-ribbon {
  width: 55%;
  margin-bottom: 1rem;
}

/* The "stay signed in" toggle: checkbox and label on one line, help beneath. */
.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
}
.login-remember input {
  margin: 0;
}
.login-remember__help {
  display: block;
  margin-bottom: 1.25rem;
}

/* SSO fallback below the credentials form: a centered "or" divider and a
   full-width secondary button matching the primary submit above it. */
.login-sso-divider {
  margin: 1.25rem 0 0.75rem;
  text-align: center;
}

.login-sso {
  display: block;
  width: 100%;
  text-align: center;
}

/* ---------- App shell ---------- */

.app-shell {
  --sidebar-width: 15rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  padding: 2rem 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar .brand {
  padding: 0.25rem 0.75rem 0.75rem;
}

.sidebar-heading {
  margin: 1rem 0 0.35rem;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sidebar-search {
  margin: 0 0 0.75rem;
  padding: 0;
  position: relative;
}

.sidebar-search input {
  --pico-form-element-spacing-vertical: 0.4rem;
  --pico-form-element-spacing-horizontal: 0.65rem;
  margin: 0;
  height: auto;
  font-size: 0.85rem;
  line-height: 1.3;
  background: var(--surface-muted);
  border-radius: 0.5rem;
}

/* The Ctrl-K hint sits inside the search field; it is also a second way in, so
   it keeps the 24 CSS pixel target floor whatever the root font size. */
.sidebar-search__shortcut {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  width: auto;
  min-height: 24px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink-muted);
}
.sidebar-search__shortcut kbd {
  padding: 0.05rem 0.3rem;
  font-size: 0.65rem;
  line-height: 1.4;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.3rem;
  color: var(--ink-muted);
}
.sidebar-search input {
  padding-right: 4.2rem;
}

/* The "?" in the topbar opens the shortcut help the ? key also opens. */
.user-actions__shortcuts {
  width: 1.9rem;
  height: 1.9rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-muted);
  font-weight: 700;
  line-height: 1;
}
.user-actions__shortcuts:hover,
.user-actions__shortcuts:focus {
  color: var(--pico-primary);
  border-color: var(--pico-primary);
}

/* explicit resets: Pico's own nav spacing rules would skew the layout */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Pico's nav align-items:center would center the items */
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Pico centers nav ul items */
  gap: 2px;
  margin: 0;
  padding: 0;
}

/* Pico shifts the first nav list left by its horizontal spacing to align
   horizontal menus; our lists are vertical and already inset, so keep them
   aligned with the brand and search above. */
.sidebar-nav ul:first-of-type {
  margin-left: 0;
}

.sidebar-nav li {
  margin: 0;
  padding: 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-radius: 0.6rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.sidebar-nav li a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.sidebar-nav li a.active {
  background: var(--nav-active-bg);
  box-shadow: inset 3px 0 0 var(--action);
  color: var(--brand-moss-ink);
  font-weight: 600;
}

.sidebar-nav li a[class*="module-"]::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--module-hue);
}

/* The focused-project chip sits directly under the Projects link. */
.sidebar-nav li.sidebar-focus {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sidebar-nav .sidebar-focus a {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.sidebar-focus-mark {
  flex: none;
  color: var(--action);
}

.sidebar-focus-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-focus form {
  margin: 0;
}

/* The `button` prefix outranks Pico's `button[type=submit] { width: 100% }`. */
button.sidebar-focus-clear {
  width: auto;
  margin: 0;
  padding: 0.1rem 0.5rem;
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-focus-clear:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

/* ---------- Global search ---------- */

/* The dashboard search mirrors the sidebar box: it only appears on the narrow
   layout, where the sidebar search is hidden. */
.dashboard-search {
  display: none;
}

@media (max-width: 768px) {
  .dashboard-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    /* Anchors the live suggestion dropdown, as the other two search forms do. */
    position: relative;
  }
  .dashboard-search input {
    margin: 0;
    flex: 1;
  }
  .dashboard-search button {
    margin: 0;
    width: auto;
  }
}

.search-page-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}


/* Live suggestion dropdown shared by the sidebar and search-page forms. */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.4rem;
  box-shadow: 0 8px 24px var(--shadow-medium);
  max-height: 20rem;
  overflow-y: auto;
}

/* The overlay is the last child of the role="search" form, so Pico's group rule
   ([role=search] > :last-child) would round its right side to a 5rem pill. Keep
   the panel's own radius instead. */
form[role="search"] .search-suggestions {
  border-radius: 0.4rem;
}

.search-suggestions li a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.3rem;
  text-decoration: none;
}

.search-suggestions li.is-active a,
.search-suggestions li a:hover {
  background: var(--surface-muted);
}

.search-suggestions .muted {
  flex: 0 0 auto;
  font-size: 0.8rem;
}

/* @mention highlight inside a rendered comment. */
mark.mention {
  background: transparent;
  color: var(--pico-primary);
  font-weight: 600;
  padding: 0;
}

/* Version-history diff rendering. */
.revision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.revision-header form {
  margin: 0;
}

.revision-field {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
}

.revision-diff {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

.diff-line {
  padding: 0 0.4rem;
}

.diff-add {
  background: var(--diff-add-bg);
}

.diff-del {
  background: var(--diff-del-bg);
}

.diff-ctx {
  color: var(--ink-muted);
}

.search-page-form input {
  margin: 0;
  flex: 1;
}

.search-page-form button {
  margin: 0;
  width: auto;
}

.search-group h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

/* The matched words inside a result title, so a long title shows at a glance
   why it is in the list. */
.search-group mark {
  padding: 0 0.1em;
  border-radius: 3px;
  background: var(--badge-warning-bg);
  color: inherit;
}
.search-result__snippet mark {
  color: var(--ink);
}

/* "showing the first 20" — the per-model cap truncates silently otherwise. */
.search-group__more {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

/* A hit: the title, then the excerpt around the matched words. */
.search-results li {
  align-items: flex-start;
}
.search-result {
  flex: 1;
  min-width: 0;
}
.search-result__snippet {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* The type chips above the results: one row of filters that stays in view,
   in place of a dropdown that names types without saying which have hits. */
.search-types {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* Pico's nav default is space-between */
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.search-types__chip {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}
.search-types__chip:hover {
  border-color: var(--pico-primary);
}
.search-types__chip.is-active {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-background);
  color: var(--on-brand);
}
.search-types__chip.is-active .muted {
  color: inherit;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-height);
  padding: 0.75rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

/* The name gives way before the actions do: it is cut short rather than
   pushing the actions onto another row. */
.topbar-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.topbar .user-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

/* Beside the sidebar on a tablet the actions need the whole row; the sidebar's
   brand already names the workspace there. */
@media (max-width: 1024px) {
  .topbar {
    padding-inline: 1rem;
  }
  .topbar-title {
    display: none;
  }
  .topbar .user-actions {
    column-gap: 0.5rem;
  }
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-actions form {
  margin: 0;
}

.sidebar .user-actions {
  display: none;
}

.nav-search {
  display: none;
  margin: 0;
  padding: 0.35rem;
  width: auto;
  background: none;
  border: none;
  color: var(--ink-muted);
}

.nav-search svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* The ☰ button that opens the full navigation tree (partials/nav_dialog.html)
   once the sidebar has collapsed into a strip; the strip itself only ever shows
   the first link or two, so without it a phone cannot reach the modules. */
.nav-menu {
  display: none;
  margin: 0;
  padding: 0.35rem;
  width: auto;
  background: none;
  border: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.nav-menu svg {
  width: 1.3rem;
  height: 1.3rem;
  display: block;
}

.nav-photo {
  display: none;
  line-height: 1;
  color: var(--ink-muted);
  text-decoration: none;
}

.nav-photo svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* The quick "new chat" action posts, so unlike its neighbors it is a form. */
.nav-chat {
  display: none;
  margin: 0;
}

.nav-chat button {
  margin: 0;
  padding: 0.35rem;
  width: auto;
  background: none;
  border: none;
  line-height: 1;
  color: var(--ink-muted);
}

.nav-chat svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.user-actions__home {
  font-size: 0.9rem;
  text-decoration: none;
}

/* The viewer role's standing reminder; its title carries the full sentence. */
.user-actions__role {
  cursor: help;
}

.photo-review-preview {
  margin: 0 0 1rem;
}

.photo-review-preview img {
  max-width: 100%;
  max-height: 22rem;
  border-radius: var(--pico-border-radius);
}

.user-actions__user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.user-actions__user .avatar {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.7rem;
}

.app-content {
  padding: 2rem;
  max-width: 72rem;
  width: 100%;
}

/* Floating "back to top"; ui-behaviors.js unhides it once the page is long
   enough behind the reader to be worth the shortcut. */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-muted);
  box-shadow: 0 2px 8px var(--shadow-medium);
}

.to-top[hidden] {
  display: none;
}

.to-top:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  background: var(--surface);
}

.to-top svg {
  width: 1.15rem;
  height: 1.15rem;
}

@media (max-width: 768px) {
  .to-top {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    overflow-x: auto;
    scrollbar-width: none;
    /* The bar scrolls without a scrollbar, so its trailing edge fades out to
       show there is more navigation past the right of the screen. */
    mask-image: linear-gradient(to right, black calc(100% - 1.5rem), transparent);
  }
  .sidebar .brand {
    padding: 0 0.5rem 0 0;
  }
  .sidebar-heading {
    display: none;
  }
  .nav-photo,
  .nav-chat {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .sidebar-search {
    display: none;
  }
  .sidebar-nav,
  .sidebar-nav ul {
    flex-direction: row;
    align-items: center;
  }
  .sidebar-nav li a {
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
  .topbar {
    display: none;
  }
  .nav-search,
  .nav-menu {
    display: inline-flex;
  }
  .sidebar .user-actions,
  .sidebar .user-actions > * {
    flex: 0 0 auto;
  }
  .sidebar .user-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.5rem;
  }
  .sidebar .user-actions > * {
    white-space: nowrap;
  }
  .app-content {
    padding: 1rem;
  }
}

/* ---------- Cards, grids, tiles ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Mobile override kept after the base rule so source order lets it win; it also
   lets wide content (tables) scroll instead of stretching the viewport. */
@media (max-width: 768px) {
  .card {
    padding: 1rem;
    overflow-x: auto;
  }
}

/* App lists are relationship/navigation/selection lists (related entries, draft
   suggestions, dashboard rollups), not prose — drop the bullet markers and hanging
   indent everywhere. Prose contexts (rendered markdown) opt back in below.
   list-style is set on the item because Pico's `ul li{list-style:square}` targets
   the element directly and would otherwise beat a value inherited from the list. */
ul,
ol {
  margin-left: 0;
  padding-left: 0;
}

ul li,
ol li {
  list-style: none;
}

/* Prose blocks render authored markdown, where list markers carry meaning. */
.report-body ul,
.report-body ol,
.doc-summary ul,
.doc-summary ol,
.prose ul,
.prose ol {
  margin-left: revert;
  padding-left: revert;
}

.report-body li,
.doc-summary li,
.prose li {
  list-style: revert;
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

/* A section heading or a related-entries panel right after the body
   description would otherwise touch it (.prose zeroes its own trailing
   margin), so give it breathing room. */
.prose + h2,
.prose + .related-links {
  margin-top: 1.5rem;
}

/* Research map: the agent's trace, one row per tool call (search, page read,
   document, recorded signal). A colored left border keys each row to its kind
   so the shape of a run reads at a glance. */
.research-map {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.research-step {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-left: 2px solid var(--border-soft);
  background: var(--surface-muted);
  border-radius: 0.4rem;
}

/* The raw tool name that produced a step, shown as a monospace chip so the
   reader can see which tool ran (e.g. fetch_page, record_signal). */
.research-step__tool {
  flex: none;
  font-size: 0.8rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--ink-muted);
}

.research-step__label {
  font-weight: 500;
  /* Long URLs in a step summary must wrap inside the card, not overflow it. */
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Long crawled URLs are one unbreakable token; give them a break opportunity so
   the cell wraps inside the card instead of forcing the table past its edge. */
.crawl-memory td a,
.source-table td a {
  overflow-wrap: anywhere;
}

.card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--brand-velvet-ink);
  text-decoration: underline;
}

/* Links inside content cards and page titles read as clickable from their context
   (table rows, lists, headings), so they carry no resting underline — only on hover.
   Tag chips and button-style links keep their own affordance. */
.card a,
.page-title a {
  text-decoration: none;
}

.card a:hover,
.page-title a:hover {
  text-decoration: underline;
}

.card [role="button"]:hover {
  text-decoration: none;
}

/* Prose blocks, one-line notes and muted paragraphs render running text, where
   color alone would not mark a link, so inline links stay underlined. */
.report-body a,
.doc-summary a,
.prose a,
.empty-note a,
.card p.muted a,
.style-preview__card p a {
  text-decoration: underline;
}

/* Rendered markdown wraps its content in block elements; collapse the outer
   margins so a prose block sits like the single paragraph it replaces. */
.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

/* A file path or a dotted identifier offers no break opportunity of its own, so
   inline code long enough to outgrow the column drags the whole page sideways. */
.prose code {
  overflow-wrap: anywhere;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
/* A closing card under a catalog grid, pointing to where its results go. */
.catalogue-next {
  margin-top: 1.5rem;
}

.module-grid .card {
  margin-bottom: 0;
}

/* Clickable tiles (module overviews, session grids) lift on hover the way the
   news cards do; plain content cards stay static. Shadow only — a border change
   would override the per-module top accent. */
.module-card,
.module-grid .card:has(> h2 a) {
  transition: box-shadow 0.15s ease;
}
.module-card:hover,
.module-card:focus-within,
.module-grid .card:has(> h2 a):hover,
.module-grid .card:has(> h2 a):focus-within {
  box-shadow: 0 4px 14px var(--shadow-weak);
}

.module-card {
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--module-hue, var(--border-soft));
  text-decoration: none;
}

.module-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.module-card p {
  flex: 1;
}

.module-card [role="button"] {
  width: auto;
  align-self: flex-start;
  margin-top: 0.5rem;
  margin-bottom: 0;
  --pico-background-color: transparent;
  --pico-color: var(--module-ink, var(--pico-contrast));
  --pico-border-color: var(--border-soft);
}

.module-card [role="button"]:hover { --pico-border-color: var(--module-hue, var(--border-soft)); }

/* Tiles share a row at up to --stat-columns per row and wrap below 7rem each.
   The count queries balance the rows: five tiles fit one row, six split three
   and three, so no row ends in a lone tile. */
.stat-grid {
  --stat-columns: 4;
  --stat-gap: 0.85rem;
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(max(7rem, (100% - (var(--stat-columns) - 1) * var(--stat-gap)) / var(--stat-columns)), 1fr)
  );
  gap: var(--stat-gap);
  margin-bottom: 1.5rem;
}
.stat-grid:has(> :nth-child(5):last-child) {
  --stat-columns: 5;
}
.stat-grid:has(> :nth-child(6):last-child) {
  --stat-columns: 3;
}
/* Where five tiles no longer fit one row they split three and two, on a
   six-track grid so both rows run edge to edge. */
@media (min-width: 577px) and (max-width: 1100px) {
  .stat-grid:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .stat-grid:has(> :nth-child(5):last-child) > * {
    grid-column: span 2;
  }
  .stat-grid:has(> :nth-child(5):last-child) > :nth-child(n + 4) {
    grid-column: span 3;
  }
}
/* A phone holds two tiles a row; an odd last tile takes the whole row. */
@media (max-width: 576px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* The dashboard's focused-project lead block. */
.focus-block {
  margin-bottom: 2rem;
}

.focus-block__eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--action-ink);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0;
  text-decoration: none;
}

/* The label takes the tile's spare height, so the values of a row line up even
   when one label wraps to a second line. */
.stat-tile > .stat-label {
  flex-grow: 1;
}

/* A narrow tile wraps a long German compound at a syllable, not mid-letter. */
.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pico-muted-color);
  hyphens: auto;
}

/* Figures read as data, not display type: the UI sans keeps digits legible and
   evenly spaced at a glance where the serif's old-style figures do not. */
.stat-value {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Tiles that carry free text (provider lists, timestamps) rather than a single
   number: such values break mid-word in a narrow tile, so step down a size and
   wrap on word boundaries. */
.stat-value--text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stat-tile .stat-value { color: var(--module-ink); }

/* Content counts on the console statistics page: one panel per module holding a
   heading, the module's total and its per-model rows. Fifty-odd content models
   are unreadable as one tile each, so the tile treatment is reserved for the
   handful of headline figures and the long tail reads as grouped lists.
   Multi-column rather than grid: the panels differ wildly in height (one saved
   view against a dozen activities), and a grid row is as tall as its tallest
   cell, so a grid leaves holes where columns pack tight. */
.stat-modules {
  columns: 16rem;
  column-gap: 1rem;
  margin-bottom: 0.5rem;
}

.stat-module {
  break-inside: avoid;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
}

.stat-module__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.stat-module__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.stat-module__total {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-module ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-module li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

.stat-module__count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.stat-module .stat-module__total { color: var(--module-ink); }

/* The panels with no module hue of their own borrow derived text tones whose
   hues stay apart from the six module hues. */
.stat-module.module-core { --module-ink: var(--hat-blue-ink); }
.stat-module.module-projects { --module-ink: var(--chart-pos-ink); }
.stat-module.module-workshops { --module-ink: var(--brand-pink-silk-ink); }
.stat-module.module-news { --module-ink: var(--chart-neg-ink); }
.stat-module.module-assistant { --module-ink: var(--badge-warning-fg); }
.stat-module.module-knowledge { --module-ink: var(--hat-green-ink); }

/* Proportion bar in a breakdown table (review status, roles): the bar column
   takes the slack so the label and the figure stay in fixed columns. */
.stat-share {
  width: 100%;
}

.stat-share__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.stat-bar {
  display: block;
  height: 0.5rem;
  min-width: 3rem;
  background: var(--surface-muted);
  border-radius: 0.25rem;
  overflow: hidden;
}

.stat-bar__fill {
  display: block;
  height: 100%;
  background: var(--brand-cornflower);
}

/* The console overview's two read-only activity panels: side by side where
   there is room, stacked below it. */
.console-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.console-panels > .card {
  margin-bottom: 0;
}

/* Clustered index of every console page: each group is a self-contained panel
   holding a heading and its link list, so the console's ~18 destinations read as
   a few tidy grouped lists rather than a wall of cards or ragged floating links.
   Multi-column packs the groups tight: Monitoring holds twice the links of the
   others, and a grid row as tall as its tallest cell would leave the short
   groups trailing empty space. */
.console-nav {
  columns: 15rem;
  column-gap: 1rem;
}

/* Each group is a <nav>; Pico lays <nav> out as a spaced-out flex row, which
   would fling the heading and its links apart, so force a plain vertical block. */
.console-nav__group {
  display: block;
  break-inside: avoid;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
}

/* The ungrouped Overview section is the active page here, so its group renders
   with no links; drop it rather than leave an empty leading grid cell. */
.console-nav__group:not(:has(a)) {
  display: none;
}

.console-nav__heading {
  margin: 0 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
}

/* Pico renders nav <ul> as a flex row and its <li> inline-block; force a plain
   left-aligned vertical stack. */
.console-nav__group ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.console-nav__group li {
  display: block;
  margin: 0;
  padding: 0;
}

.console-nav__group li a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: var(--pico-contrast);
  /* Long compounds ("Benutzer*innenverwaltung") have no natural break point. */
  hyphens: auto;
  overflow-wrap: anywhere;
}

.console-nav__group li a:hover {
  background: var(--surface);
  color: var(--action-ink);
}

/* ---------- Page furniture ---------- */

/* Title on the left, actions on the right, wrapping onto a second line when
   the row runs out of width. Each header keeps only what it does differently.
   (.public-header is page chrome with its own bar styling, not one of these.) */
.page-header,
.card-header-row,
.entry-header,
.section-heading,
.kx-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header,
.entry-header {
  margin-bottom: 1rem;
}

.kx-row-head {
  margin-bottom: 0.75rem;
}

/* A multi-line entry title keeps its actions level with the first line. */
.entry-header {
  align-items: flex-start;
}

@media (max-width: 768px) {
  /* Stack the title over its actions so the actions take the full width and
     wrap onto extra lines instead of overflowing the viewport. */
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header .row-actions {
    width: 100%;
  }
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* The profile's two errands — your content, and your account settings — kept
   apart instead of running together as one row of six buttons. */
.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.profile-nav__group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.profile-nav__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* The "use this device's zone" button time-zone.js drops under the settings
   form's zone select: a compact inline control, not a full-width form button. */
.time-zone__device {
  width: auto;
  margin-top: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  /* Side by side the two groups shrink to one button per line each; stacked
     they keep their rows whole. */
  .profile-nav {
    flex-direction: column;
    gap: 0.9rem;
  }
}

.card-header-row h2 {
  margin: 0;
}

.page-title {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}

/* "42 signals" under a list heading: how much is here, before you start
   reading rows to find out. */
.list-count {
  margin: -0.25rem 0 0;
  font-size: 0.9rem;
}

/* The favorite star and the status badge stay beside the title, on the
   baseline of its first line, however many lines a long title wraps to. */
.entry-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.entry-title > :not(h1) {
  flex: none;
}

.entry-header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.35rem;
}
/* When the title shares a flex row with inline badges (.entry-title), that
   wrapper carries the spacing before the meta line instead — a margin on the
   flex-item h1 would push it out of line with the badges. A long German
   compound breaks rather than widening the page; a phone breaks it at a
   syllable, while a desktop line keeps its words whole. */
.entry-title h1 {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

/* Mobile title sizing kept after the base rules above so source order lets it
   win over their 1.9rem. */
@media (max-width: 768px) {
  .page-title,
  .entry-header h1 {
    font-size: 1.5rem;
  }
  .entry-title h1 {
    hyphens: auto;
  }
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

/* Horizontal tab bar, rendered by partials/tab_nav.html. On the workspace shell
   the module sections live in the sidebar (.sidebar-subnav); this bar carries
   the project sub-pages, the Kompetenz-Explorer's views, the messaging
   Inbox/Sent tabs, and the mobile-only fallback for the sections. */
.module-nav {
  display: flex;
  justify-content: flex-start; /* Pico's nav default is space-between */
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.module-nav a {
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: var(--pico-muted-color);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.module-nav a:hover {
  color: var(--pico-color);
}

.module-nav a.active {
  color: var(--pico-primary);
  border-bottom-color: var(--action);
  font-weight: 600;
}

/* The module's name leads the phone section bar, since the strip above has
   usually scrolled the module link out of view; it is the way back up. */
.module-nav a.module-nav__module {
  flex: 0 0 100%;
  padding: 0.25rem 0.9rem 0.35rem;
  border-bottom: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Section sub-navigation nested under the active module in the sidebar. The
   guide line and indent tie the sections visually to their parent module. */
/* `.sidebar-nav li .sidebar-subnav` (0,2,1) beats both `.sidebar-nav ul` (0,1,1)
   and `.sidebar-nav ul:first-of-type` (0,2,1, on source order) so the spacing
   and inset actually apply instead of the dense list defaults. */
.sidebar-nav li .sidebar-subnav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 6px 0 14px 0.9rem;
  padding-left: 0.85rem;
  list-style: none;
  border-left: 1px solid var(--border-soft);
}

.sidebar-nav .sidebar-subnav li a {
  padding: 0.34rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
  border-radius: 0.5rem;
}

/* Group heading that clusters a long sub-nav (the console). Modules without
   groups render no heading, so this only appears where sections carry one. A
   hairline rule sets each cluster apart without adding much height. */
.sidebar-nav .sidebar-subnav li.sidebar-subnav__group {
  margin: 0.55rem 0 0.2rem;
  padding: 0.5rem 0.7rem 0;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  border-top: 1px solid var(--border-soft);
}

.sidebar-nav .sidebar-subnav li.sidebar-subnav__group:first-child {
  margin-top: 0.1rem;
  padding-top: 0;
  border-top: none;
}

.sidebar-nav .sidebar-subnav li a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.sidebar-nav .sidebar-subnav li a.active {
  background: var(--nav-active-bg);
  box-shadow: inset 3px 0 0 var(--action);
  color: var(--brand-moss-ink);
  font-weight: 600;
}

/* The horizontal section bar is the sidebar sub-nav's small-screen counterpart:
   the sidebar collapses to a scrolling strip there, where a nested tree cannot
   sit. Desktop shows the sidebar tree instead. This override must follow both
   base rules — the stylesheet is desktop-first, so an earlier max-width block
   would lose to these on the cascade. */
[data-module-nav] {
  display: none;
}

@media (max-width: 768px) {
  /* Match the base container's `.sidebar-nav li .sidebar-subnav` (0,2,1) so the
     hide wins; a lower-specificity selector would leave the tree in the strip. */
  .sidebar-nav li .sidebar-subnav {
    display: none;
  }
  /* One scrolling row rather than a stack of wrapped rows: the module crumb
     leads, then the active section, then the rest past the faded edge. */
  [data-module-nav] {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, black calc(100% - 1.5rem), transparent);
  }
  [data-module-nav] a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  [data-module-nav] a.module-nav__module {
    flex: 0 0 auto;
    order: -2;
    padding-inline: 0 0.9rem;
  }
  [data-module-nav] a.active {
    order: -1;
  }
}

/* ---------- Badges & tags ---------- */

/* Pill primitive shared by status badges, tags and strength badges. Variants
   below adjust weight, spacing and color. */
.status-badge,
.tag,
.strength-badge,
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.strength-badge {
  align-self: flex-start;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
}

.badge {
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-fg);
  /* Keep a pill on one line so a longer label (e.g. a profile name) hugs its
     text instead of wrapping into a cramped multi-line blob. */
  white-space: nowrap;
  width: fit-content;
}

.status-badge {
  letter-spacing: 0.02em;
  /* Short status labels stay on one line; a wrapped pill reads as a bloated blob. */
  white-space: nowrap;
}

/* One rule per badge meaning, listing every family that speaks it: review and
   run states (.status-*), log levels (.log-*), signal strength (.strength-*),
   the research profile/confidence pills and the triage decisions. A family
   joins a meaning here rather than restating the token pair.
   .status-reviewed/.status-validated double as generic info/green pills
   (Enabled, OK, Open, internal…), not only as review states. */
.confidence-badge--on_track,
.objective-status--achieved,
.idea-status--adopted,
.question-answered,
.cib-state-consistent,
.status-accepted,
.status-validated,
.status-success,
.strength-strong,
.profile-deep,
.confidence-3,
.triage-decision-accepted {
  background: var(--badge-positive-bg);
  color: var(--badge-positive-fg);
}

.objective-status--open,
.idea-status--new,
.question-open,
.status-draft,
.status-queued,
.strength-weak {
  background: var(--badge-pending-bg);
  color: var(--badge-pending-fg);
}

.okr-badge,
.idea-status--evaluating,
.status-reviewed,
.log-INFO,
.profile-standard {
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
}

.confidence-badge--at_risk,
.question-partly,
.cib-state-inconsistent,
.status-running,
.status-warning,
.log-WARNING,
.confidence-2 {
  background: var(--badge-warning-bg);
  color: var(--badge-warning-fg);
}

.confidence-badge--off_track,
.objective-status--missed,
.status-rejected,
.status-failed,
.log-ERROR,
.strength-event,
.triage-decision-rejected {
  background: var(--badge-negative-bg);
  color: var(--badge-negative-fg);
}

.objective-status--dropped,
.idea-status--discarded,
.question-dropped,
.cib-state-removed,
.cib-state-extended,
.status-archived,
.status-cancelled,
.status-none,
.log-DEBUG,
.profile-quick,
.confidence-1,
.triage-decision-archived {
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-fg);
}

/* The one level loud enough to take a filled brand pill of its own. */
.log-CRITICAL { background: var(--brand-monarch); color: var(--on-brand); }

/* A triage decision keeps the pill shape but outlines itself in its own tone. */
.triage-decision-accepted,
.triage-decision-archived,
.triage-decision-rejected {
  border-color: color-mix(in srgb, currentcolor 30%, transparent);
}

.log-table td { vertical-align: top; }

/* Evidence chain: a topic/trend cell spans its leaf rows via rowspan, so anchor
   the grouped cells to the top and let a left border read the group boundaries. */
.provenance-table { margin: 0; }
.provenance-table th { white-space: nowrap; }
.provenance-table td { vertical-align: top; }
.provenance-table .provenance-topic { border-left: 3px solid var(--pico-primary); }
.provenance-table .provenance-trend { color: var(--ink); }
.log-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-logger { font-size: 0.85rem; color: var(--ink-muted); }
.log-message {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.error-page {
  max-width: 32rem;
  margin: 4rem auto;
  text-align: center;
}
.error-page .error-code {
  margin: 0;
  font-size: 3rem;
  font-weight: 700;
  color: var(--action);
  letter-spacing: 0.05em;
}

/* The "find it anyway" card under a not-found page, as wide as the message. */
.error-recover {
  max-width: 32rem;
  margin: 0 auto 4rem;
}

.avatar {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
}

.avatar-lg {
  width: 2.75rem;
  height: 2.75rem;
}

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-velvet);
  border-color: transparent;
  color: var(--on-brand);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.agent-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.row-actions form {
  margin: 0;
}

/* A session's own steps (reshuffle, next phase) on a row of their own under
   its header, clear of the description below. */
.session-actions {
  margin: 0 0 1rem;
}

/* One compact Export dropdown standing in for the row's separate export buttons.
   Pico's details.dropdown is block-width by default; size it to the button row.
   Pico's own `details.dropdown > summary` rule outweighs the shared compact button
   scale above, so restate that scale here (higher specificity) and flatten the
   tall default chevron — otherwise the summary renders larger than its neighbors. */
/* Action-row dropdowns (Export, More): a compact summary button whose menu
   holds the actions that do not earn a button of their own. */
.entry-export.dropdown,
.row-actions .dropdown {
  width: auto;
  margin: 0;
}
.entry-export.dropdown > summary,
.row-actions .dropdown > summary {
  height: auto;
  margin: 0;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
}
.entry-export.dropdown > summary::after,
.row-actions .dropdown > summary::after {
  height: 1rem;
  transition: transform 0.15s ease;
}
/* Pico never rotates its dropdown chevron; flip it while the menu is open. The
   translateX mirrors Pico's base offset so the flipped glyph keeps its spot. */
.entry-export.dropdown[open] > summary::after,
.row-actions .dropdown[open] > summary::after {
  transform: rotate(180deg) translateX(-0.2rem);
}
/* A form inside a menu item (a POST action) renders as the item's link would:
   the form takes the negative margin Pico gives the link, and the button drops
   the row's compact inline-flex scale, which would center its label. */
.row-actions .dropdown li form {
  margin: calc(var(--pico-form-element-spacing-vertical) * -0.5) calc(var(--pico-form-element-spacing-horizontal) * -1);
}
.row-actions .dropdown li form button {
  display: block;
  width: 100%;
  margin: 0;
  padding: calc(var(--pico-form-element-spacing-vertical) * 0.5) var(--pico-form-element-spacing-horizontal);
  border: none;
  border-radius: 0;
  background: none;
  color: var(--pico-dropdown-color);
  text-align: left;
  font-size: inherit;
  line-height: inherit;
}
.row-actions .dropdown li form button:hover,
.row-actions .dropdown li form button:focus {
  background: var(--pico-dropdown-hover-background-color);
  color: var(--pico-dropdown-color);
}

/* The Accept / Reject pair on a draft: one form, two submit buttons, tinted so
   the decision reads at a glance. */
.entry-review {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0;
}
.entry-review button {
  width: auto;
  margin: 0;
}
.entry-review__accept {
  --pico-color: var(--brand-moss-ink);
  color: var(--brand-moss-ink);
  border-color: var(--brand-moss-ink);
}
.entry-review__reject {
  --pico-color: var(--pico-del-color);
  color: var(--pico-del-color);
  border-color: var(--pico-del-color);
}

/* The projects an entry belongs to, as chips under the byline: the way back up
   to the project, on the entry itself instead of at the foot of the page. */
.entry-projects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.entry-projects__chip {
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface-muted);
}
.entry-projects__chip:hover {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

/* Destructive action: tint the outline delete button so it reads apart from the
   neutral secondary actions next to it. Set on the anchor directly since Pico
   does not rescope --pico-color on <a role=button> the way it does on buttons. */
.entry-delete {
  --pico-color: var(--pico-del-color);
  color: var(--pico-del-color);
  border-color: var(--pico-del-color);
}
.entry-delete:hover,
.entry-delete:focus {
  background: var(--pico-del-color);
  color: var(--pico-card-background-color);
  border-color: var(--pico-del-color);
}

/* On a table cell, keep .row-actions a table-cell: display:flex would drop it out
   of the column model and let two-button action cells overflow (and clip past) the
   card. Lay the buttons out inline so the column sizes normally and they wrap only
   when the cell is genuinely narrow. */
td.row-actions {
  display: table-cell;
}

td.row-actions > *,
td.row-actions form {
  display: inline-flex;
  vertical-align: middle;
  margin: 0.25rem 0.5rem 0.25rem 0;
}

/* Style the native file-picker button to match the app's secondary buttons
   instead of the browser/Pico default, so upload fields (signal images/documents,
   avatars, source file, import) read as part of the same design system. */
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--pico-form-element-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--pico-transition);
}

input[type="file"]::file-selector-button:hover {
  background: var(--surface);
}

/* Header action rows, table row actions and board composers share one compact
   button scale; Pico's full-size buttons stay reserved for form submits,
   empty-state CTAs and controls that sit next to full-size inputs. A container
   added here also joins the touch-size list in the (hover: none) block. The :not()
   list keeps self-styled icon buttons out and lifts the specificity above
   Pico's `button[type=submit] { width: 100% }`. */
:where(.page-header, .entry-header, .row-actions, .note-actions,
       .card-header-row, .section-heading, .flash, .user-actions, .public-nav,
       .public-footer, .cookie-banner__actions, .board-zone__add, .whiteboard__add,
       .board-note__actions, .stage-bar, .stage-qr, .news-card__actions, .cneeds-add,
       .cneeds-need__actions, .hmw-add, .hat-add, .bw-add, .opinion-add__actions,
       .opinion-moderation__item,
       .smx-signal__actions, .smx-quadrant__head, .kx-bulk-group, .kx-row-actions,
       .sv-manage__row, .sv-results__decide, .backcasting-list,
       .workshop-objective__edit, .workshop-objective__add, .workshop-feedback__head,
       .workshop-group__edit, .workshop-group__add, .workshop-group__assign,
       .comment-footer, .comment-thread__actions, .comment-form__actions, .draft-restore,
       .related-links__disclosure)
  :is(button, [role="button"]):not(.favorite-toggle, .qr-button, .stage-qr__code, .theme-toggle,
                                   .link-button, .flash-dismiss, .reaction-chip, .collab-chip) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.persona-generate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.persona-generate select,
.persona-generate input {
  width: auto;
  margin: 0;
}

.persona-generate label {
  margin: 0;
}

.share-link-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* The share URL is one unbreakable token; without a break opportunity its
   min-content width forces the table past the card and over the next column.
   The floor keeps it readable when the table is squeezed. */
.share-link-cell a {
  min-width: 14ch;
  overflow-wrap: anywhere;
}

/* The single guest link a page hands out: QR beside the copyable URL. */
.share-link-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.share-link-card__body {
  flex: 1;
  min-width: 0;
}

/* The native share button ships hidden and copy.js reveals it only where the
   platform has a share sheet, so its row claims space only once it shows. */
.share-link-card .row-actions:has(> :not([hidden])) {
  margin-top: 0.9rem;
}

@media (max-width: 480px) {
  .share-link-card {
    flex-direction: column;
  }
}

.qr-button {
  flex: none;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
  cursor: zoom-in;
}

/* CSS width/height beat both the intrinsic SVG size and Pico's
   `img { height: auto }`, which otherwise blows the QR out of its cell. Pico's
   percentage max-width would let a table column shrink below the QR. */
.share-qr {
  display: block;
  width: 96px;
  max-width: none;
  height: 96px;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  /* A scanner needs the quiet zone light whatever the theme is doing. */
  background: var(--paper);
}

/* Dialogs ease in on open. Pico only animates behind its .modal-is-opening /
   .modal-is-closing wrapper classes, which this app never sets. ui-behaviors.js
   adds .dialog-closing so the generic [data-dialog-close] controls get the
   mirrored ease-out before close(); it must come after the [open] rule so the
   equal-specificity tie resolves to closing. */
dialog[open] {
  animation: dialog-in 0.15s ease;
}
dialog[open]::backdrop {
  animation: backdrop-in 0.15s ease;
}
dialog.dialog-closing {
  animation: dialog-out 0.15s ease forwards;
}
dialog.dialog-closing::backdrop {
  animation: backdrop-out 0.15s ease forwards;
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96); }
}
@keyframes backdrop-in {
  from { opacity: 0; }
}
@keyframes dialog-out {
  to { opacity: 0; transform: scale(0.96); }
}
@keyframes backdrop-out {
  to { opacity: 0; }
}

/* The two question modals util.js builds — Dom.confirm's .confirm-dialog and
   Dom.prompt's .prompt-dialog — share this card.

   Pico makes the <dialog> element itself the full-screen dimmed overlay
   (min-width/min-height: 100%, its own translucent background) and expects the
   card to be a child, which is how .cmd-palette is built. Styling the dialog as
   the card instead loses to that min-width and paints the overlay opaque, so the
   modal fills the viewport with no visible edge and no dimming behind it. */
.modal-dialog__box {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1.25rem 3rem var(--shadow-strong);
}
.modal-dialog__message {
  display: block;
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.modal-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.modal-dialog__actions button {
  margin: 0;
  width: auto;
}
.modal-dialog__box form {
  margin: 0;
}
/* Confirmation is only ever asked for an action that cannot be clicked back, so
   the committing button carries the destructive tone. A prompt commits a name,
   not a deletion, and keeps the ordinary one. */
.confirm-dialog__ok {
  --pico-background-color: var(--pico-del-color);
  --pico-border-color: var(--pico-del-color);
  --pico-color: var(--on-brand);
}
.prompt-dialog__input {
  margin-bottom: 1.25rem;
}
@media (max-width: 480px) {
  .modal-dialog__actions {
    flex-direction: column-reverse;
  }
  .modal-dialog__actions button {
    width: 100%;
  }
}

/* Card inside Pico's overlay, as .modal-dialog__box above — see the note there
   for why the dialog element itself must not carry the card styling. */
.qr-dialog__box {
  padding: 1rem;
  border-radius: var(--pico-border-radius);
  /* Light in both themes, so the enlarged code keeps its quiet zone. */
  background: var(--paper);
}

/* The participant hints on a guest page, folded so the board leads. */
.guest-hints {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}
.guest-hints > summary {
  font-size: 0.9rem;
  color: var(--ink-muted);
  cursor: pointer;
}
.guest-hints ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

/* The session page's share dialog: a QR code big enough for a wall, the link
   to copy, and the way to the settings page for managing links. */
.share-dialog__box {
  width: min(30rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1.25rem 3rem var(--shadow-strong);
}
.share-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.share-dialog__head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.share-dialog__close {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.6rem;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}
.share-dialog__qr {
  display: block;
  width: min(60vw, 18rem);
  height: auto;
  margin: 0 auto 1rem;
  background: var(--surface);
}
/* The join code beside the running slot on the facilitator's run view. */
.workshop-run__join {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* A share link's full URL in a links table wraps rather than pushing the
   expiry and action columns out of view. */
.share-link-url {
  overflow-wrap: anywhere;
}

.share-dialog__actions {
  margin-top: 0.75rem;
}
.share-dialog .share-create select,
.share-dialog .share-create button {
  margin-bottom: 0.75rem;
}

.qr-dialog-image {
  display: block;
  width: min(80vw, 80vh, 480px);
  height: auto;
  cursor: zoom-out;
}

/* ---------- Activity tutorial ---------- */

.tutorial-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: var(--pico-border-radius);
  background: linear-gradient(
    120deg,
    var(--brand-cornflower-ink),
    var(--brand-velvet) 55%,
    var(--brand-monarch)
  );
  color: var(--on-brand);
  font-weight: 600;
}

.tutorial-button:is(:hover, :focus) {
  background: linear-gradient(
    120deg,
    var(--brand-monarch),
    var(--brand-velvet) 45%,
    var(--brand-cornflower-ink)
  );
  color: var(--on-brand);
}

.tutorial-button svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
}

/* Like .cmd-help__box: the card is a Pico <article> that Pico already styles
   as the modal, so only cap the width and tune the inner spacing. */
.tutorial-dialog__box {
  max-width: 30rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.tutorial-dialog__box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tutorial-dialog__box h2 {
  margin: 0;
  font-size: 1.15rem;
}

.tutorial-dialog__close {
  margin: 0;
  width: auto;
  padding: 0.1rem 0.6rem;
  line-height: 1;
}

.tutorial-section-heading {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

/* Pico resets list markers, so they are restored on the items. */
.tutorial-steps,
.tutorial-hints {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.tutorial-steps li {
  list-style: decimal;
}

.tutorial-hints li {
  list-style: disc;
}

.tutorial-steps li,
.tutorial-hints li {
  margin-bottom: 0.4rem;
}

.tutorial-dialog__box footer {
  margin-top: 1.25rem;
  padding: 0;
  background: none;
  border: none;
  text-align: right;
}

.tutorial-dialog__done {
  width: auto;
  margin: 0;
}

.tag {
  margin: 0.1rem 0.25rem 0.1rem 0;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--tag-ink);
}

a.tag {
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

/* "+3" standing in for the tags a list row has no width to show; it links to
   the entry, where all of them are. */
a.tag--more {
  background: transparent;
  border: 1px dashed var(--border-soft);
  color: var(--ink-muted);
}

a.tag:hover {
  background: var(--brand-velvet);
  color: var(--on-brand);
  text-decoration: none;
}

.filter-active {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* The clear link sits inside running text, where color alone would not mark it. */
.filter-active a {
  text-decoration: underline;
}

/* Why a page offers a viewer no way to act: the role, and whom to ask. */
.read-only-notice {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--pico-muted-border-color);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.9rem;
}

/* ---------- Forms & misc ---------- */

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Running total under a field: "used / allowed" beneath a length-capped one
   (field-counter.js), words and characters beneath a Markdown body
   (word-count.js). */
.field-counter {
  display: block;
  margin: -0.6rem 0 0.9rem;
  font-size: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
/* An author `display` outranks the UA's `[hidden] { display: none }`, so the
   hidden state has to be restated here. */
.field-counter[hidden] {
  display: none;
}
.field-counter.is-warning {
  color: var(--badge-warning-fg);
  font-weight: 600;
}

/* Action rows that close a submitting form (Save/Cancel after ``form.as_div``)
   need breathing room above them; toolbar/nav uses of ``.form-actions`` don't. */
form > .form-actions {
  margin-top: 1.5rem;
}

.form-actions form {
  margin: 0;
}

.form-actions button,
.form-actions [role="button"] {
  width: auto;
  margin-bottom: 0;
}

.note {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 1rem;
  margin-top: 1rem;
}

.note-header {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
}

.note-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.note-actions form {
  margin: 0;
}

.note-actions button,
.note-actions [role="button"] {
  width: auto;
  margin: 0;
}

/* Flex-wrap, not a fixed grid: a native <select> can't ellipsize, so a narrow
   fixed column clipped long option labels ("Beliebiges Schlagwort"). Here each
   control sizes to a sensible basis, grows to fill the row, and wraps when the
   row is full — so labels stay readable at every width. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  /* stretch, so the search field and the selects share one height and align —
     the grid layout this replaced got equal heights from grid's default. */
  align-items: stretch;
  margin-bottom: 1rem;
}

.filter-bar > *,
.filter-bar__more > * {
  flex: 1 1 12rem;
  min-width: 0;
  margin-bottom: 0;
}

/* The searchable-select wrapper (.ss) re-adds Pico's form-element bottom margin
   for stacked forms; in the row that margin would raise the flex line and every
   stretched neighbor with it. */
.filter-bar > .ss,
.filter-bar__more > .ss {
  margin-bottom: 0;
}

/* A native <select> renders taller than an <input> in Pico and won't stretch, so
   pin every control to the input's natural height (one line + form padding +
   border) — otherwise the search field and the selects don't line up. Direct
   children only: a searchable-select's chip removal <button> is a nested control
   that manages its own size and must not be stretched to full field height. The
   "Clear filters" link is a [role="button"] and sits beside the submit button. */
.filter-bar > input,
.filter-bar > select,
.filter-bar > button,
.filter-bar > [role="button"],
.filter-bar__more > select,
.filter-bar__more > button,
.filter-bar__more > [role="button"] {
  height: calc(1lh + (var(--pico-form-element-spacing-vertical) + var(--pico-border-width)) * 2);
}

/* The free-text search field earns more room than the select filters. Direct
   children only: the text box inside a searchable-select's combobox shares its
   line with the chips and keeps its own, smaller basis. */
.filter-bar > input[type="search"],
.filter-bar > input[type="text"] {
  flex: 2 1 16rem;
}

/* The review-status select's empty choice is the longest label a list's
   selects open with; its basis fits that whole. :where() keeps the phone's
   stacked panel below free to override it. */
.filter-bar__more > :where(select[name="status"]) {
  flex-basis: 16rem;
}

/* width:auto lifts these above Pico's `button[type=submit] { width: 100% }`, so
   the button sizes to its label instead of filling the row and crushing the
   adjacent input (visible in the nowrap `.filter-bar-query`). */
.filter-bar > button,
.filter-bar > [role="button"],
.filter-bar__more > button,
.filter-bar__more > [role="button"] {
  flex: 0 0 auto;
  width: auto;
}

/* One input plus a button — stays side by side down to the smallest screens. */
.filter-bar-query {
  flex-wrap: nowrap;
}

/* One control per line, for a filter bar inside a narrow pane. */
.filter-bar-stacked > * {
  flex-basis: 100%;
}

/* A board's how-to: open on a desktop (summary hidden), folded on a phone so
   the board itself lands on the first screen. */
.board-intro {
  margin-bottom: 1rem;
}
.board-intro > summary {
  display: none;
}
.board-intro > p {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .board-intro > summary {
    display: list-item;
    font-size: 0.9rem;
    color: var(--ink-muted);
    cursor: pointer;
  }
  .board-intro[open] > summary {
    margin-bottom: 0.5rem;
  }
}

/* The selects, sort and buttons sit in a group the desktop row does not show
   as such (display: contents lets its children join the flex row); a phone
   folds the group behind a "Filter" toggle so the first rows of data stay on
   the first screen. ui-behaviors.js folds it on a phone when no filter is set. */
.filter-bar__more {
  display: contents;
}
.filter-bar__more[hidden] {
  display: none;
}
.filter-bar__toggle {
  display: none;
}

@media (max-width: 768px) {
  .filter-bar:not(.filter-bar-query) > * {
    flex-basis: 100%;
  }
  .filter-bar__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: none;
    border: 1px solid var(--border-soft);
    color: var(--ink);
    font-size: 0.9rem;
  }
  .filter-bar__toggle::after {
    content: "▾";
    color: var(--ink-muted);
  }
  .filter-bar__toggle[aria-expanded="true"]::after {
    content: "▴";
  }
  .filter-bar__more {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-basis: 100%;
  }
  /* Column items size to their content: a percentage basis would resolve
     against the stretched panel's height, not its width. */
  .filter-bar__more > * {
    flex: none;
    width: 100%;
    margin-bottom: 0;
  }
  .filter-bar__more > select,
  .filter-bar__more > button,
  .filter-bar__more > [role="button"] {
    height: calc(1lh + (var(--pico-form-element-spacing-vertical) + var(--pico-border-width)) * 2);
  }
  .filter-bar__more > button,
  .filter-bar__more > [role="button"] {
    width: 100%;
  }
}

/* Active filters as removable chips above a list. */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.filter-chips li {
  margin: 0;
  padding: 0;
}
.filter-chips__chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
}
.filter-chips__chip:hover {
  border-color: var(--pico-del-color);
  color: var(--pico-del-color);
}

/* The "only mine" toggle sits in the filter row like a select does. */
.filter-bar__mine {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}
.filter-bar__mine input {
  margin: 0;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-sectioning-background-color);
}

.bulk-bar select,
.bulk-bar input,
.bulk-bar button {
  width: auto;
  margin-bottom: 0;
}

/* The bar answers "what do I do with these", so it arrives with the first tick
   instead of standing over an untouched list. The collapsible class is set by
   signal-bulk.js, so without it the bar simply stays where it always was.
   visibility, not just height: a collapsed bar must leave the tab order too. */
.bulk-bar--collapsible {
  overflow: hidden;
  transition:
    max-height 0.18s ease,
    opacity 0.18s ease;
}
.bulk-bar--collapsible:not(.is-active) {
  max-height: 0;
  padding-block: 0;
  margin-bottom: 0;
  border-color: transparent;
  opacity: 0;
  visibility: hidden;
}

.bulk-count {
  color: var(--pico-muted-color);
}

.dedup-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.dedup-action select {
  width: auto;
  margin: 0;
}

.col-select {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

.col-select input {
  margin: 0;
}

.language-switcher {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0;
}

.language-switcher .lang {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--pico-muted-color);
}

.language-switcher .lang.current {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-border);
  color: var(--pico-primary-inverse);
}

/* The top bar's icon-only theme toggle: one outlined square. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0.3rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--pico-muted-color);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
}

/* The favorite star sits beside the page title (entry and session headers), a
   bare icon rather than one more button in the action row. Only the star
   animates its color change; the theme swap redraws the page. */
.favorite-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0.3rem;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--pico-muted-color);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--pico-primary);
  border-color: var(--pico-primary);
}

.favorite-toggle:hover {
  background: var(--surface-muted);
  color: var(--pico-primary);
}

.theme-icon {
  width: 1rem;
  height: 1rem;
}

.favorite-icon {
  width: 1.35rem;
  height: 1.35rem;
}

/* Offer the theme you'd switch to: moon in light mode, sun in dark mode. */
:root[data-theme="light"] .theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* favorites.js adds the class while a toggle-on lands, so the star pops once
   on the user's action, not on every page load of an already-favorited entry. */
.favorite-toggle.favorite-pop .favorite-icon {
  animation: favorite-pop 0.3s ease;
}
@keyframes favorite-pop {
  40% { transform: scale(1.35); }
}

.favorite-toggle[aria-pressed="false"] .favorite-icon-on {
  display: none;
}

.favorite-toggle[aria-pressed="true"] .favorite-icon-off {
  display: none;
}

.favorite-toggle[aria-pressed="true"] {
  color: var(--pico-primary);
}

/* Django's ``form.as_div`` emits ``div.helptext`` per field; Pico leaves it at
   body size, so it competes with the input. Make it read as a quiet hint. */
.helptext {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* ``form.as_div`` renders a boolean field as a block label above a bare
   checkbox. On its own line the box reads as a heading for the *next* field
   rather than a caption for its own — so lay the box and its label out as one
   inline row (checkbox first, then label), the conventional checkbox pairing.
   Pico also omits the bottom margin it gives text inputs, so add that back. */
form div:has(> input[type="checkbox"]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  margin-bottom: var(--pico-spacing, 1rem);
}

form div:has(> input[type="checkbox"]) > input[type="checkbox"] {
  order: -1;
  margin: 0;
}

form div:has(> input[type="checkbox"]) > label {
  margin: 0;
}

/* A checkbox's help text and errors wrap to their own full-width line below. */
form div:has(> input[type="checkbox"]) > .helptext,
form div:has(> input[type="checkbox"]) > .errorlist {
  flex-basis: 100%;
}

/* The focused-project opt-out list (profile settings) has many checkboxes; the
   class is on the CheckboxSelectMultiple container, so lay its options out as a
   responsive grid rather than one tall column. ``div`` scopes it to the
   container — the same class also lands on each <input>, which we leave alone. */
div.focus-filter,
div.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  margin-top: 0.5rem;
}

/* Options with long labels (trend titles) get columns wide enough to read. */
div.checkbox-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
}

/* What a delete takes with it, listed on the shared confirm page. */
.delete-cascade {
  margin-bottom: 1rem;
}

/* An optional field folded into a <details> so it does not dominate a form until
   the user opens it (e.g. the notification content-type filter). */
.form-disclosure {
  margin-bottom: var(--pico-spacing, 1rem);
}

.form-disclosure > summary {
  cursor: pointer;
  color: var(--pico-primary);
}

div.focus-filter > div,
div.checkbox-grid > div {
  margin: 0;
}

div.focus-filter label,
div.checkbox-grid label {
  display: flex;
  align-items: flex-start;
  column-gap: 0.5rem;
  margin: 0;
}

/* A label that wraps keeps its box at full size, level with the first line. */
div.focus-filter label input,
div.checkbox-grid label input {
  flex-shrink: 0;
  margin-top: 0.2em;
}

/* ---------- Form sections (``core.forms.Fieldset``) ---------- */

/* A titled group of fields. Pico gives <fieldset> no border, so the divider is
   the legend's underline: enough to read as a group without boxing the form in. */
.form-section {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}

.form-section > legend {
  width: 100%;
  margin-bottom: 0.9rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* The collapsed variant is a <details>, so its title is a summary rather than a
   legend — style it as the same band, with the disclosure triangle Pico draws. */
.form-section--collapsible > summary {
  margin-bottom: 0.9rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-transform: uppercase;
  cursor: pointer;
}

.form-section__help {
  margin: -0.4rem 0 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Console style page: the preset radios carry their swatches, and the preview
   box repaints from the same custom properties the generated stylesheet emits
   (the console renders the same emitter scoped to .style-preview). */
.style-preset-option {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
}
.style-preset-option:has(input:checked) {
  border-color: var(--action);
  background: var(--nav-active-bg);
}
.style-preset-option:has(input:checked) .muted {
  color: var(--ink);
}
.style-preset-option input[type="radio"] {
  margin: 0;
}
.style-preset-option__swatches {
  display: inline-flex;
  gap: 0.25rem;
}
.style-preset-option__swatches i {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
}
.style-preset-option__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.3;
}
.style-preset-option__name {
  font-weight: 600;
}
.style-preview {
  padding: 1.25rem;
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  color: var(--ink);
  font-family: var(--font-body);
}
.style-preview__card {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  box-shadow: none;
}
.style-preview__heading {
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  color: var(--heading-ink);
}
.style-preview__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.style-preview__actions button {
  width: auto;
  margin: 0;
}
.style-preview__modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.style-preview__modules li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--module-ink);
}
.style-preview__modules li::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--module-hue);
}

/* ``display: contents`` keeps the one-column case identical to ``form.as_div``
   — no wrapper box, no extra spacing — while the multi-column variants below
   become real grids. */
.form-grid {
  display: contents;
}

.form-grid--2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.form-grid--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.5rem;
}

/* Tall widgets read badly in a half-width column, so they span the whole row
   whatever the group's column count. Descendant, not child: searchable-select.js
   wraps its <select> in a .ss div. */
.form-grid > div:has(textarea),
.form-grid > div:has(.checkbox-grid),
.form-grid > div:has(select[multiple]) {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid--2,
  .form-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* ``required_css_class`` on the form marks required fields' wrapping div. */
form .required > label::after {
  content: " *";
  color: var(--action-ink);
}

.form-required-note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.form-required-note .req-mark {
  color: var(--action-ink);
  font-weight: 700;
}

.entry-editors {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
  font-size: 0.85rem;
}

/* Django renders per-field errors as ``ul.errorlist`` and sets ``aria-invalid``
   on the widget; ``error_css_class`` marks the field's wrapping div. */
.errorlist {
  margin: 0.15rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--action-ink);
}

/* A failure reported in running text rather than under a form field. */
.error-text {
  color: var(--action-ink);
}

form .has-error > label {
  color: var(--action-ink);
}

form .has-error input,
form .has-error select,
form .has-error textarea {
  border-color: var(--brand-monarch);
}

/* Accessible validation summary (partials/form_errors.html). */
.form-errors {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--brand-monarch);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--tint-negative);
}

.form-errors:focus-visible {
  outline: 2px solid var(--brand-monarch);
  outline-offset: 2px;
}

.form-errors__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---------- Flash messages ---------- */

/* Every notice floats in one fixed stack at the top center, so a flash raised
   from a focused activity stage ([data-stage].is-focused covers the viewport
   at z-index 80) or the realtime connection banner stays in view. The stack
   itself lets clicks through; only the notices inside it take the pointer. */
.notice-stack {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  inset-inline: 0.75rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: auto;
  max-width: 36rem;
  margin-inline: auto;
  pointer-events: none;
}

.notice-stack .flash {
  pointer-events: auto;
  box-shadow: 0 6px 20px var(--shadow-medium);
}

.notice-stack .flash-messages {
  margin-bottom: 0;
}

/* Inside the member shell the stack starts below the topbar; on phones the
   topbar is hidden, so the stack returns to the viewport edge. */
.app-shell .notice-stack {
  top: calc(var(--topbar-height) + 0.75rem + env(safe-area-inset-top, 0px));
  /* Centered over the content column, not the whole viewport. */
  inset-inline: calc(var(--sidebar-width) + 0.75rem) 0.75rem;
}

@media (max-width: 768px) {
  .app-shell .notice-stack {
    top: calc(0.5rem + env(safe-area-inset-top, 0px));
    inset-inline: 0.5rem;
  }
}

@media (max-width: 640px) {
  .notice-stack {
    top: calc(0.5rem + env(safe-area-inset-top, 0px));
    inset-inline: 0.5rem;
  }
}

.flash-messages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border-soft);
  border-left-width: 4px;
  background: var(--surface);
  box-shadow: 0 2px 6px var(--shadow-weak);
  animation: flash-in 0.25s ease;
}

.flash-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-brand);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.flash-icon::before { content: "•"; }

.flash [role="button"] {
  flex: 0 0 auto;
  align-self: center;
}

.flash-text {
  flex: 1 1 auto;
  align-self: center;
  color: var(--ink);
}

.flash-dismiss {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.flash-dismiss:hover {
  background: var(--shadow-weak);
  color: var(--ink);
}

.flash-success { border-left-color: var(--brand-olive); background: var(--tint-positive); }
.flash-success .flash-icon { background: var(--brand-olive); }
.flash-success .flash-icon::before { content: "✓"; }

.flash-error { border-left-color: var(--brand-monarch); background: var(--tint-negative); }
.flash-error .flash-icon { background: var(--brand-monarch); }
.flash-error .flash-icon::before { content: "!"; }

.flash-warning { border-left-color: var(--state-warning); background: var(--tint-warning); }
.flash-warning .flash-icon { background: var(--state-warning); }
.flash-warning .flash-icon::before { content: "!"; }

.flash-info { border-left-color: var(--brand-cornflower); background: var(--tint-info); }
.flash-info .flash-icon { background: var(--brand-cornflower); }
.flash-info .flash-icon::before { content: "i"; }

.flash-leaving { animation: flash-out 0.3s ease forwards; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flash-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-0.4rem); }
}

/* ---------- Achievements ---------- */

/* Unlock celebration: a badge toast (bottom-right) plus a one-off confetti burst,
   both created from achievements.js. The global reduced-motion block below already
   neutralizes these animations; the script additionally skips confetti. */
.achievement-toasts {
  position: fixed;
  right: 1.25rem;
  /* Clears the back-to-top button, which owns the same corner. */
  bottom: 4.75rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(23rem, calc(100vw - 2.5rem));
  pointer-events: none;
}

.achievement-toast {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-olive);
  background: var(--surface);
  box-shadow: 0 10px 28px var(--shadow-medium);
  pointer-events: auto;
  animation: achievement-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.achievement-toast--leaving { animation: flash-out 0.35s ease forwards; }

.achievement-toast__icon {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 50%;
  background: var(--tint-positive);
  border: 1px solid var(--brand-olive);
  animation: achievement-glow 1.6s ease-out;
}

.achievement-toast__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.achievement-toast__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--brand-olive-ink);
}

.achievement-toast__name { font-weight: 700; color: var(--ink); }
.achievement-toast__desc { font-size: 0.85rem; color: var(--ink-muted); }

@keyframes achievement-pop {
  0% { opacity: 0; transform: translateY(0.6rem) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes achievement-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-moss) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

.confetti-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 999;
}

.confetti-piece {
  position: absolute;
  top: -4vh;
  left: var(--x);
  width: 0.55rem;
  height: 0.9rem;
  border-radius: 1px;
  opacity: 0.9;
  animation: confetti-fall 2.4s var(--delay) linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-4vh) rotate(var(--rotate)); opacity: 1; }
  100% { transform: translateY(105vh) rotate(calc(var(--rotate) + 420deg)); opacity: 0.85; }
}

/* ---------- Weather effect ---------- */

/* The console's weather effect, filled by weather.js: a fixed layer of falling
   pieces that never takes a pointer event. It sits under the flash messages and
   under a board in full screen (z-index 80), so neither is fallen on. A piece is
   two spans — the outer one falls, the inner one sways, tumbles, swings or
   spins — timed by the random custom properties the script sets on each. */
.weather {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.weather__piece {
  position: absolute;
  top: 0;
  left: var(--x);
  opacity: var(--opacity);
  animation: weather-fall var(--fall) linear var(--delay) infinite;
  will-change: transform;
}

.weather__body {
  display: block;
  animation: weather-sway var(--cycle) ease-in-out var(--delay) infinite alternate;
}

.weather__shape {
  display: block;
  width: var(--size);
  height: auto;
  overflow: visible;
}

@keyframes weather-fall {
  from { transform: translate3d(0, -10vh, 0); }
  to { transform: translate3d(var(--drift), 110vh, 0); }
}

@keyframes weather-sway {
  from { transform: translateX(calc(var(--sway) * -1)); }
  to { transform: translateX(var(--sway)); }
}

/* The soft ink edge is what lifts a flake off a light page; on dark it vanishes. */
.weather--snow .weather__body {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--weather-snow);
  box-shadow: 0 0 3px var(--shadow-strong);
}

.weather--rain .weather__body {
  width: 2px;
  height: var(--size);
  border-radius: 1px;
  background: linear-gradient(to bottom, transparent, var(--weather-rain) 40%);
  transform: rotate(var(--slant));
  animation: none;
}

/* Fog banks lie low and drift to and fro instead of falling. */
.weather__fog {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  width: var(--width);
  height: var(--height);
  background: radial-gradient(closest-side, var(--weather-fog), transparent);
  opacity: var(--opacity);
  animation: weather-drift var(--cycle) ease-in-out var(--delay) infinite alternate;
}

@keyframes weather-drift {
  from { transform: translateX(-12vw); }
  to { transform: translateX(12vw); }
}

/* Leaves tip toward and away from the viewer as they flutter; tulips swing like
   a pendulum. The pieces take turns through each palette in the order the
   script appends them. */
.weather--leaves .weather__body { animation-name: weather-flutter; }
.weather--tulips .weather__body,
.weather--emoji .weather__body { animation-name: weather-swing; }

@keyframes weather-flutter {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(calc(var(--spin) - 40deg)) rotateX(0deg); }
  to { transform: translateX(var(--sway)) rotate(calc(var(--spin) + 40deg)) rotateX(55deg); }
}

@keyframes weather-swing {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(-20deg); }
  to { transform: translateX(var(--sway)) rotate(20deg); }
}

.weather--leaves .weather__piece:nth-child(4n + 1) { --tone: var(--weather-leaf-red); }
.weather--leaves .weather__piece:nth-child(4n + 2) { --tone: var(--weather-leaf-orange); }
.weather--leaves .weather__piece:nth-child(4n + 3) { --tone: var(--weather-leaf-gold); }
.weather--leaves .weather__piece:nth-child(4n) { --tone: var(--weather-leaf-brown); }
.weather--tulips .weather__piece:nth-child(3n + 1) { --tone: var(--weather-tulip-red); }
.weather--tulips .weather__piece:nth-child(3n + 2) { --tone: var(--weather-tulip-pink); }
.weather--tulips .weather__piece:nth-child(3n) { --tone: var(--weather-tulip-yellow); }
.weather--suns .weather__piece { --tone: var(--weather-sun); }

/* An emoji brings its own colors; it is sized like a shape. */
.weather--emoji .weather__body {
  font-size: var(--size);
  line-height: 1;
}

.weather__fill { fill: var(--tone); }

.weather__vein {
  fill: none;
  stroke: var(--shadow-strong);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.weather__stem { fill: var(--weather-tulip-stem); }

.weather__stem-line {
  fill: none;
  stroke: var(--weather-tulip-stem);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.weather__rays {
  fill: none;
  stroke: var(--tone);
  stroke-width: 2;
  stroke-linecap: round;
}

.weather--suns .weather__body { animation: weather-spin var(--cycle) linear var(--delay) infinite; }

.weather--suns .weather__shape {
  filter: drop-shadow(0 0 3px var(--weather-sun-glow)) drop-shadow(0 0 8px var(--weather-sun-glow));
}

@keyframes weather-spin {
  from { transform: rotate(var(--spin)); }
  to { transform: rotate(calc(var(--spin) + 360deg)); }
}

/* The script already draws nothing here; this also covers a visitor who turns
   the setting on while the page is open. */
@media (prefers-reduced-motion: reduce) {
  .weather { display: none; }
}

/* Profile / console badge cards */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.9rem;
}

.achievement-card {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.7rem;
  background: var(--surface);
}

/* A locked card is set back by its surface, not by fading it: dimming the whole
   card takes its muted description text below the contrast floor. */
.achievement-card--locked {
  background: var(--surface-muted);
}

.achievement-card__icon {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 50%;
  background: var(--surface-muted);
}

.achievement-card--unlocked .achievement-card__icon {
  background: var(--tint-positive);
  border: 1px solid var(--brand-olive);
}

.achievement-card--locked .achievement-card__icon { filter: grayscale(1); }

.achievement-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.achievement-card__name { font-weight: 700; color: var(--ink); }
.achievement-card__desc { font-size: 0.85rem; color: var(--ink-muted); }
.achievement-card__meta { font-size: 0.78rem; color: var(--ink-muted); }

.achievement-progress {
  height: 0.4rem;
  border-radius: 0.3rem;
  background: var(--border-soft);
  overflow: hidden;
  margin-top: 0.35rem;
}

.achievement-progress__bar {
  height: 100%;
  background: var(--brand-cornflower);
}

.achievement-badges {
  font-size: 1.05rem;
  letter-spacing: 0.08rem;
  margin-right: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
  .flash { animation: none; }
  .flash-leaving { animation-duration: 0.01s; }

  /* Honor the OS "reduce motion" setting everywhere: near-instant transitions
     and animations, and no smooth scroll from scrollIntoView (palette, etc.). */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    /* Also the delay: a staggered entrance fills backwards while it waits, so
       a zero duration alone would still hold the element invisible. */
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Brainstorming ideas ---------- */

.idea-list-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* The count in a cluster/kanban column head: same pill, sitting in a flex row
   next to the heading rather than inline in it. */
.idea-count,
.kanban-count {
  flex: none;
  min-width: 1.6rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--pico-muted-color);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

/* A kanban column is itself muted, so its count needs the lighter fill to read
   as a pill rather than dissolving into the column head. */
.kanban-count {
  background: var(--surface);
}

.idea-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

/* A bare heading brings its own bottom margin; .card-header-row drops it, so the
   list stands in for it there. */
.card-header-row + .idea-list,
.card-header-row + .comment-list {
  margin-top: var(--pico-typography-spacing-vertical);
}

/* One bordered content-block look, shared by ideas and comments (the same card
   visually); the comment variant only adds margin: 0. */
.idea-card,
.comment {
  padding: 0.85rem 1rem 0.7rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--brand-velvet);
  border-radius: var(--pico-border-radius);
}

.idea-text {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
}

.idea-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.idea-promote {
  display: inline-flex;
  margin: 0;
}
.idea-promote .link-button,
.idea-kept {
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
.promote-control--kept,
.idea-kept {
  text-decoration: none;
}

.idea-author {
  font-weight: 600;
  color: var(--ink);
}

/* Up/down vote controls on an idea card (partials/idea_card.html). */
.idea-votes {
  display: flex;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
}
/* The `button` prefix outranks Pico's `button[type=submit] { width: 100% }`. */
button.vote-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
  margin: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.vote-button:not(:disabled) {
  cursor: pointer;
}
.vote-button[data-vote="up"][aria-pressed="true"] {
  color: var(--brand-olive-ink);
  border-color: var(--brand-olive);
}
.vote-button[data-vote="down"][aria-pressed="true"] {
  color: var(--brand-monarch-ink);
  border-color: var(--brand-monarch-ink);
}
.vote-button:disabled {
  opacity: 0.7;
}
.vote-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* idea-votes.js adds the class when the number actually changes. */
.vote-count-bump {
  animation: vote-count-bump 0.25s ease;
}
@keyframes vote-count-bump {
  40% { transform: scale(1.25); }
}

.idea-form,
.comment-form {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.25rem;
  margin: 0;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.comment {
  margin: 0;
}

.comment header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-byline {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.comment-byline strong {
  color: var(--ink);
}

.comment-byline small,
.comment-permalink {
  font-size: 0.78rem;
}

.comment-permalink {
  align-self: flex-start;
  color: var(--ink-muted);
  text-decoration: none;
}

.comment-permalink:hover {
  color: var(--pico-primary);
}

/* The sticky mobile sidebar would otherwise cover a comment jumped to by anchor. */
.comment:target {
  scroll-margin-top: 4rem;
}

.comment p {
  margin: 0;
}

.comment-form label {
  font-weight: 600;
}

/* Threaded comments: a thread is one top-level comment, its indented replies
   and a fold-out reply form; edit forms fold out the same way. */
.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0 1.1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--border-soft);
}

@media (max-width: 480px) {
  .comment-replies {
    margin-left: 0.35rem;
    padding-left: 0.6rem;
  }
}

/* Reply and the resolve toggle are the thread's own actions, below its replies. */
.comment-thread__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
}

/* A fold-out's form lives outside its <details> so it can claim a full-width
   row of the action bar it belongs to: opening one then neither squeezes the
   textarea into the leftover space nor moves the buttons beside the summary. */
.comment-reply-form,
.comment-edit-form {
  display: none;
  flex: 1 1 100%;
  border-top: 0;
  padding-top: 0.35rem;
}

.comment-thread__actions:has(> .comment-reply[open]) > .comment-reply-form,
.comment-footer:has(> .comment-edit[open]) > .comment-edit-form {
  display: block;
}

/* A settled thread keeps its place in the conversation but folds to one line,
   so what is still open is what the page shows at full size. */
.comment-resolved {
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
}

.comment-resolved > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.comment-resolved__badge {
  flex: none;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  font-size: 0.75rem;
  font-weight: 600;
}

.comment-resolved__excerpt {
  overflow: hidden;
  color: var(--pico-muted-color);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-resolved__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}

/* Pico's accordion makes a bare <details> block-wide; size the summary as one
   compact action instead. The [role="button"] is load-bearing: Pico's
   `details summary[role=button] { width: 100% }` is (0,1,2), so the selector
   needs a second class/attribute to win — same story as .entry-export.dropdown. */
.comment-tool {
  margin: 0;
}

.comment-tool > summary[role="button"] {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.comment-tool > summary[role="button"]::after {
  height: 1rem;
}

/* The edit fold-out sits in the footer so its summary lines up with Quote. */
.comment-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.reaction-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-right: auto;
}

/* The `button` prefix outranks Pico's `button[type=submit] { width: 100% }`. */
button.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
  margin: 0;
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.reaction-chip:not(:disabled) {
  cursor: pointer;
}

.reaction-chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--pico-primary);
}

.reaction-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.comment-tombstone {
  margin: 0;
  font-style: italic;
}

.comment-collapse {
  margin: 0;
}

.comment-collapse > summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--pico-primary);
}

.comment-collapse > .comment-list {
  margin: 0.75rem 0 0;
}

.comments .card-header-row form {
  margin: 0;
}

.change-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.change-log-entry {
  margin: 0;
}

.change-log-byline {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.change-log-byline strong {
  color: var(--ink);
}

.change-log-byline small {
  font-size: 0.78rem;
}

.change-log-action,
.change-log-changes {
  margin: 0 0 0 2.6rem;
}

.change-log-changes {
  padding-left: 1rem;
}

/* Anchor for the absolutely positioned @mention dropdown. */
.mention-field {
  position: relative;
}

.mention-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.4rem;
  box-shadow: 0 8px 24px var(--shadow-medium);
  max-height: 18rem;
  overflow-y: auto;
}

.mention-suggestions li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.3rem;
  cursor: pointer;
}

.mention-suggestions li.is-active,
.mention-suggestions li:hover {
  background: var(--surface-muted);
}

.mention-suggestions .mention-handle {
  font-weight: 600;
  color: var(--ink);
}

.mention-suggestions .muted {
  font-size: 0.8rem;
}

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.5rem;
}

.meta-list dt {
  font-weight: 600;
}

.meta-list dd {
  margin: 0;
}

/* The mobile single-column override lives here, after the base rule, so source
   order lets it win — the earlier phone @media block would otherwise be defeated
   by the two-column base above and long values could overflow the viewport. */
@media (max-width: 768px) {
  .meta-list {
    grid-template-columns: 1fr;
  }
  .meta-list dt {
    margin-top: 0.5rem;
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination__pages li {
  margin: 0;
  padding: 0;
}

.pagination__pages a {
  display: inline-block;
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--pico-border-radius);
  text-align: center;
  text-decoration: none;
}

.pagination__pages a[aria-current="page"] {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}

.pagination__gap {
  padding: 0.15rem 0.2rem;
  color: var(--ink-muted);
}

.pagination__size label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.85rem;
}

.pagination__size select {
  width: auto;
  margin: 0;
  padding: 0.2rem 1.8rem 0.2rem 0.5rem;
  font-size: 0.85rem;
}

/* Page number and row range read as one label, stacked so the range stays a
   secondary detail. */
.pagination > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

textarea.markdown-editor {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Live co-writing (collab-editor.js). The layer is laid over the textarea with
   its text metrics copied by Dom.textMirror; its own text is transparent, so
   only the other writers' selection tints and carets show. */
.collab-editor {
  position: relative;
}

.collab-layer {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: transparent;
  pointer-events: none;
}

.collab-c1 { --who: var(--chart-1); }
.collab-c2 { --who: var(--chart-2); }
.collab-c3 { --who: var(--chart-3); }
.collab-c4 { --who: var(--chart-4); }
.collab-c5 { --who: var(--chart-5); }
.collab-c6 { --who: var(--chart-6); }
.collab-c7 { --who: var(--chart-7); }
.collab-c8 { --who: var(--chart-8); }

.collab-sel {
  padding: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--who) 28%, transparent);
  color: transparent;
}

/* Two pixels of border offset by the margins, so a caret adds no width and the
   layer's text keeps wrapping exactly like the textarea's. */
.collab-caret {
  position: relative;
  margin: 0 -1px;
  border-left: 2px solid var(--who);
}

.collab-flag {
  position: absolute;
  bottom: 100%;
  left: -2px;
  padding: 0 0.3rem;
  border-left: 3px solid var(--who);
  border-radius: 0 0.25rem 0.25rem 0;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px var(--shadow-medium);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: nowrap;
}

.collab-flag[hidden] {
  display: none;
}

.collab-roster {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collab-roster li {
  margin: 0;
  list-style: none;
}

.collab-chip {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--who);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.collab-chip:disabled {
  opacity: 1;
  cursor: default;
}

.collab-status[data-state="offline"] {
  color: var(--badge-warning-fg);
}

.collab-lost {
  margin-top: 1rem;
}

/* The offer to bring back a locally kept draft, sitting directly above the
   editor it belongs to (draft-recovery.js inserts it). */
.draft-restore {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  font-size: 0.9rem;
}

.draft-restore > span {
  flex: 1 1 12rem;
}

@media (max-width: 480px) {
  .draft-restore > span {
    flex-basis: 100%;
  }
}

/* Report detail splits into a narrow metadata rail and a wide reading column so
   the report body reads as the page's centrepiece rather than one card of many. */
.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

/* A report without abstract, project or links has nothing for the rail; the body
   then takes the full width instead of sitting beside an empty column. */
.report-layout:not(:has(.report-meta > *)) {
  grid-template-columns: minmax(0, 1fr);
}

.report-layout:not(:has(.report-meta > *)) .report-meta {
  display: none;
}

.report-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meta-card {
  margin-bottom: 0;
  padding: 1rem 1.15rem;
}

.meta-card h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  /* Full ink, not --ink-muted: as a small uppercase eyebrow the muted tone fell
     short of a readable heading contrast, and neutral ink keeps it distinct from
     the velvet item links below it. */
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.meta-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.meta-card li {
  display: list-item;
  list-style: disc;
}

.meta-card li + li {
  margin-top: 0.3rem;
}

.report-main .report-body {
  margin-bottom: 0;
  padding: 2rem 2.25rem;
}

@media (max-width: 960px) {
  .report-layout {
    grid-template-columns: 1fr;
  }
}

.report-body {
  line-height: 1.7;
}

.report-abstract {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
}

.report-card {
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--brand-velvet);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-sectioning-background-color);
  padding: 0.6rem 0.85rem;
  margin: 1rem 0;
}

.report-card__badge {
  display: inline-block;
  color: var(--brand-velvet-ink);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-card__badge--missing {
  color: var(--action-ink);
}

.report-card__title {
  display: block;
  font-size: 1.05rem;
}

.report-card__meta {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

.report-card__excerpt {
  display: block;
  margin-top: 0.3rem;
}

/* A [[kpi:…]] card's live figures: progress beside the sparkline. */
.report-card__kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.4rem;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.wizard-steps__step {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.wizard-steps__step a {
  color: inherit;
  text-decoration: none;
}

.wizard-steps__step a:hover {
  text-decoration: underline;
}

.wizard-steps__step + .wizard-steps__step::before {
  content: "→";
  margin-right: 0.5rem;
  color: var(--ink-muted);
}

.wizard-steps__step--current {
  color: var(--ink);
  font-weight: 600;
}

.wizard-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.25rem;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.wizard-steps__step--current .wizard-steps__num {
  background: var(--brand-velvet);
  color: var(--on-brand);
}

.placeholder-autocomplete {
  position: absolute;
  z-index: 50;
  min-width: 16rem;
  max-width: 28rem;
  max-height: 15rem;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  background: var(--pico-background-color);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  box-shadow: 0 6px 20px var(--shadow-medium);
}

.placeholder-autocomplete__item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.placeholder-autocomplete__item[aria-selected="true"] {
  background: var(--pico-primary-focus, var(--shadow-weak));
}

.placeholder-autocomplete__kind {
  flex: none;
  color: var(--brand-velvet-ink);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The grid keeps Pico's chevron level with the title instead of floating it
   below the hint line. */
.placeholder-picker summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

.placeholder-picker summary::after {
  grid-row: 1;
  grid-column: 2;
}

/* What the closed picker holds, so it reads as something to open. */
.placeholder-picker__hint {
  grid-row: 2;
  grid-column: 1;
  margin-top: 0.35rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
}

.placeholder-picker[open] .placeholder-picker__hint {
  display: none;
}

.placeholder-picker h2 {
  font-size: 0.9rem;
  margin: 0.75rem 0 0.35rem;
}

/* The token users can type in the editor to filter the type-ahead to this group. */
.placeholder-picker__prefix {
  margin-left: 0.4rem;
  padding: 0.05rem 0.3rem;
  color: var(--pico-muted-color);
  font-size: 0.75rem;
  font-weight: 400;
}

.placeholder-picker__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.placeholder-picker__group [role],
.placeholder-picker__group button {
  width: auto;
  margin-bottom: 0;
}

/* ---------- Analyzing network ---------- */
.network-focus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.network-focus {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0;
  font-size: 0.9rem;
}

.network-focus-select {
  width: auto;
  min-width: min(12rem, 100%);
  max-width: min(24rem, 100%);
  margin: 0;
}

.network-focus-hint {
  font-size: 0.85rem;
}

.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.network-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

/* No width override: Pico sizes a checkbox itself, and `width: auto` collapses
   it to its 4px border. */
.network-legend-item input {
  margin: 0;
}

.network-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
}

.network-swatch-signal { background: var(--node-signal); }
.network-swatch-event { background: var(--node-event); }
.network-swatch-driver { background: var(--node-driver); }
.network-swatch-trend { background: var(--node-trend); }
.network-swatch-megatrend { background: var(--node-megatrend); }
.network-swatch-topic { background: var(--node-topic); }
.network-swatch-focustopic { background: var(--node-focustopic); }
.network-swatch-organisation { background: var(--node-organisation); }
.network-swatch-place { background: var(--node-place); }
.network-swatch-person { background: var(--node-person); }
.network-swatch-competency { background: var(--node-competency); }
.network-swatch-field { background: var(--node-field); }
.network-swatch-project { background: var(--node-project); }
.network-swatch-scenario { background: var(--node-scenario); }
.network-swatch-report { background: var(--node-report); }
.network-swatch-vision { background: var(--node-vision); }
.network-swatch-measure { background: var(--node-measure); }
.network-swatch-theory { background: var(--node-theory); }
.network-swatch-crossimpact { background: var(--node-crossimpact); }

.network-canvas {
  height: var(--canvas-height, 70vh);
  min-height: 420px;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
}

.network-canvas--compact {
  height: 24rem;
  min-height: 0;
}

/* ---------- Analyzing radar & timeline ---------- */

.radar-figure {
  margin: 0;
}

.radar-svg {
  display: block;
  width: 100%;
  max-width: 58rem;
  height: auto;
  margin: 0 auto;
}

.radar-ring {
  fill: none;
  stroke: var(--border-soft);
  stroke-width: 1;
}

.radar-ring-label {
  font-size: 13px;
  fill: var(--ink-muted);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
}

.radar-sector-label {
  font-size: 15px;
  font-weight: 600;
  fill: var(--ink);
}

.radar-dot circle {
  stroke: var(--surface);
  stroke-width: 2;
}

.radar-dot:hover circle,
.radar-dot:focus circle {
  r: 10;
}

/* Scaled to a phone's width the labels would shrink to a few pixels; the radar
   keeps a readable size and scrolls sideways instead. */
@media (max-width: 600px) {
  .radar-figure {
    overflow-x: auto;
  }
  .radar-svg {
    min-width: 40rem;
  }
  .radar-ring-label,
  .radar-sector-label {
    font-size: 17px;
  }
}

/* Impact / uncertainty matrix — a Cartesian cousin of the radar. */
.matrix-figure {
  margin: 0;
}
.matrix-svg {
  display: block;
  width: 100%;
  max-width: 46rem;
  height: auto;
  margin: 0 auto;
}
.matrix-grid {
  stroke: var(--border-soft);
  stroke-width: 1;
}
.matrix-axis-tick {
  font-size: 13px;
  fill: var(--ink-muted);
}
.matrix-axis-title {
  font-size: 14px;
  font-weight: 600;
  fill: var(--ink);
}
.matrix-quadrant {
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink-muted);
  opacity: 0.75;
}
.matrix-dot circle,
.matrix-dot path {
  stroke: var(--surface);
  stroke-width: 2;
}
.matrix-dot:hover circle,
.matrix-dot:focus circle {
  r: 10;
}
.matrix-dot--diamond path {
  transform-box: fill-box;
  transform-origin: center;
}
.matrix-dot--diamond:hover path,
.matrix-dot--diamond:focus path {
  transform: scale(1.25);
}
.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.matrix-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  white-space: nowrap;
  cursor: pointer;
}
.matrix-legend__item input {
  margin: 0;
}
.matrix-legend__glyph {
  width: 14px;
  height: 14px;
  fill: var(--ink-muted);
}
.matrix-hidden {
  display: none;
}

/* Keep each category's dot and label on one line so a long label (e.g.
   "Technologisch") wraps as a unit to the next row instead of detaching from
   its swatch. */
.radar-cat {
  display: inline-block;
  white-space: nowrap;
}

.radar-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  vertical-align: baseline;
}

.stimeline-figure {
  margin: 0.5rem 0 0;
}

.stimeline-svg {
  display: block;
  width: 100%;
  height: auto;
}

.stimeline-gridline {
  stroke: var(--border-soft);
  stroke-width: 1;
}

.stimeline-baseline {
  stroke: var(--chart-baseline);
  stroke-width: 1;
}

.stimeline-tick {
  font-size: 12px;
  fill: var(--ink-muted);
}

.stimeline-bar path {
  fill: var(--chart-1);
}

.stimeline-bar:hover path,
.stimeline-bar:focus path {
  fill: color-mix(in srgb, var(--chart-1) 78%, var(--ink));
}

.stimeline-event path {
  fill: var(--brand-monarch);
}

.stimeline-event:hover path,
.stimeline-event:focus path {
  fill: color-mix(in srgb, var(--brand-monarch) 79%, var(--ink));
}

/* Like the radar: a readable chart that scrolls on its own, not a shrunken one. */
@media (max-width: 600px) {
  .stimeline-figure {
    overflow-x: auto;
  }
  .stimeline-svg {
    min-width: 40rem;
  }
  .stimeline-tick {
    font-size: 15px;
  }
}

.momentum-svg {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.momentum-baseline {
  stroke: var(--border-soft);
  stroke-width: 1;
}

.momentum-line {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.momentum-dot {
  fill: var(--chart-1);
}

.momentum-caption {
  margin-top: 0.25rem;
}

/* KPI and key-result value series (acting.charts.series_chart): a sparkline in
   lists and cards, the full chart with labels on a KPI's page. */
.kpi-chart {
  display: block;
  height: auto;
  overflow: visible;
}

.kpi-chart--spark {
  width: 120px;
  max-width: 100%;
}

.kpi-chart--detail {
  width: 100%;
  max-width: 48rem;
}

.kpi-chart__line {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.kpi-chart--spark .kpi-chart__line {
  stroke-width: 1.5;
}

.kpi-chart__dot {
  fill: var(--chart-1);
}

.kpi-chart--good .kpi-chart__dot--last {
  fill: var(--chart-pos-ink);
}

.kpi-chart--bad .kpi-chart__dot--last {
  fill: var(--chart-neg-ink);
}

.kpi-chart__baseline,
.kpi-chart__axis {
  stroke: var(--chart-baseline);
  stroke-width: 1;
}

.kpi-chart__baseline {
  stroke-dasharray: 2 3;
}

.kpi-chart__target {
  stroke: var(--chart-pos-ink);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.kpi-chart__tick {
  font-size: 12px;
  fill: var(--ink-muted);
}

.kpi-chart__tick--target {
  fill: var(--chart-pos-ink);
}

.kpi-chart-figure {
  margin: 0 0 1rem;
}

.kpi-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

.kpi-chart-legend > span::before {
  content: "";
  display: inline-block;
  width: 1.2rem;
  margin-right: 0.4rem;
  vertical-align: middle;
  border-top: 2px solid var(--chart-1);
}

.kpi-chart-legend > .kpi-chart-legend__target::before {
  border-top: 2px dashed var(--chart-pos-ink);
}

.kpi-chart-legend > .kpi-chart-legend__baseline::before {
  border-top: 1px dotted var(--chart-baseline);
}

@media (max-width: 600px) {
  .kpi-chart__tick {
    font-size: 15px;
  }
}

.momentum-rising {
  color: var(--chart-pos-ink);
}

.momentum-falling {
  color: var(--chart-neg-ink);
}

.stimeline-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.stimeline-legend-bar,
.stimeline-legend-event {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.75rem;
}

.stimeline-legend-bar {
  background: var(--chart-1);
}

.stimeline-legend-event {
  background: var(--brand-monarch);
  transform: rotate(45deg);
}

/* ---------- Analyzing competency map ---------- */

.cmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cmap-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 12rem;
}

.cmap-search {
  margin: 0;
  max-width: 24rem;
}

.cmap-search-status {
  white-space: nowrap;
  font-size: 0.85rem;
}

.cmap-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  /* Pico presents `[role=group]` as a joined input group: full width, a bottom
     margin and squared inner corners. This is a compact cluster beside the
     search field, so it opts out. */
  width: auto;
  margin-bottom: 0;
}

/* Two class selectors, to outweigh Pico's `[role=group] > :not(:first-child)`,
   which would square the cluster's inner corners. */
.cmap-zoom > .cmap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto; /* Pico makes bare buttons full-width; the toolbar wants them compact */
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.7rem;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.cmap-btn:hover {
  background: var(--surface-muted);
}

.cmap-zoom > .cmap-btn-text {
  font-size: 0.9rem;
}

.cmap-zoom-label {
  min-width: 3.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.cmap-stage {
  position: relative;
  height: var(--canvas-height, clamp(24rem, 68vh, 52rem));
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  /* Faint dot grid gives depth cues while panning; sits under the SVG. */
  background:
    radial-gradient(circle at 1px 1px, var(--border-soft) 1px, transparent 0) 0 0 / 26px 26px,
    var(--surface-muted);
  cursor: grab;
  /* pan-y keeps vertical swipes scrolling the page; the stage fills most of a
     phone screen, so claiming every gesture would trap the scroll. */
  touch-action: pan-y;
}

.cmap-stage.is-panning {
  cursor: grabbing;
}

.cmap-stage:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cmap-hint {
  margin-top: 0.6rem;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.competency-map-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Each field is its own translucent layer, so where two blobs cover the same
   spot their colors blend — that shared area is a competency in both fields. */
.cmap-blob {
  opacity: 0.5;
}

.cmap-comp {
  transition: opacity 0.15s ease;
}

.cmap-comp circle {
  fill: var(--surface);
  stroke: var(--ink-muted);
  stroke-width: 2;
}

.cmap-comp:hover circle,
.cmap-comp:focus circle {
  fill: var(--ink);
  stroke: var(--ink);
}

.cmap-comp.is-dim {
  opacity: 0.12;
}

.cmap-comp.is-hit circle {
  fill: var(--pico-primary);
  stroke: var(--pico-primary);
}

.cmap-comp.is-hit text {
  font-weight: 700;
}

.cmap-comp text {
  font-size: 13px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  pointer-events: none;
}

.cmap-field-label {
  font-size: 20px;
  font-weight: 700;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 5px;
  pointer-events: none;
}

.cmap-field-list > li + li {
  margin-top: 0.75rem;
}

.cmap-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.4rem;
  border-radius: 3px;
  vertical-align: baseline;
}

/* ---------- Analyzing world map ---------- */

.world-map {
  height: var(--canvas-height, 30rem);
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  z-index: 0;
}

/* A place page's map: the place and the signals placed around it. */
.world-map--compact {
  height: 18rem;
}

/* Leaflet's zoom links carry role="button", so Pico's button padding, border
   and radius land on them. The extra class/attribute selectors outrank both
   Pico and leaflet.css, which loads after this sheet. */
.world-map .leaflet-bar.leaflet-control {
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  overflow: hidden;
}

.world-map .leaflet-bar a[role="button"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  text-indent: 0;
}

.world-map .leaflet-bar a[role="button"] + a[role="button"] {
  border-top: 1px solid var(--border-soft);
}

.world-map .leaflet-bar a[role="button"]:hover {
  background-color: var(--surface-muted);
}

.world-map .leaflet-bar a.leaflet-disabled[role="button"] {
  color: var(--ink-muted);
  background-color: var(--surface-muted);
}

.world-map-popup a {
  font-weight: 600;
}

.world-map-popup .strength-badge {
  margin-top: 0.35rem;
}

/* Leaflet's popup stays white in both schemes, like the basemap under it. */
.world-map-popup .muted {
  color: var(--map-ink-muted);
}

/* Brand-tinted marker clusters, darker as they grow. The .world-map prefix
   outranks markercluster.default.css, which loads after this sheet. Leaflet
   gives each cluster role="button", so Pico's button padding and border are
   reset or they push the badge off its position. */
.world-map .marker-cluster {
  padding: 0;
  border: 0;
  background: transparent;
}

.world-map .marker-cluster div {
  color: var(--on-brand);
  font-weight: 600;
  background: var(--map-cluster-small);
  border: 2px solid var(--on-brand);
}

.world-map .marker-cluster-medium div {
  background: var(--map-cluster-medium);
}

.world-map .marker-cluster-large div {
  background: var(--map-cluster-large);
}

/* ---------- Radial boards (futures wheel, mindmap) ----------
   One geometry (static/js/radial-board.js), two color schemes: the wheel
   colors by depth, the mindmap by branch. Shared rules pair each .wheel-*
   selector with its .mm-* twin; the scheme-specific rules follow. */

.wheel-header h1,
.mm-header h1 {
  margin-bottom: 0.5rem;
}

/* The wheel title links to its subject entry; render it as heading text (not an
   underlined link) so the header matches the other activities' plain H1. */
.wheel-header h1 a {
  color: inherit;
  text-decoration: none;
}

.wheel-header h1 a:hover {
  text-decoration: underline;
}

.wheel-layout,
.mm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* The side panel stays hidden until a node is selected; only reserve its
   column while it is open, so the canvas otherwise spans the full width. */
.wheel-layout:has(.wheel-panel:not([hidden])),
.mm-layout:has(.mm-panel:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) 18rem;
}

/* Which ring takes new consequences: the facilitator's control, or everyone
   else's status line. It spans the panel's column too, so opening the panel
   does not reflow it. */
.wheel-ring-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0;
  font-size: 0.9rem;
}

.wheel-ring-bar label {
  margin: 0;
}

.wheel-ring-bar select {
  width: auto;
  margin: 0;
  padding-block: 0.3rem;
  font-size: 0.9rem;
}

.wheel-canvas,
.mm-canvas {
  min-width: 0;
  position: relative;
  padding: 0;
  overflow: hidden;
}

/* The floating pill of controls over a pan/zoom canvas: same chrome on the
   futures wheel, the mindmap and the whiteboard. */
.wheel-toolbar,
.mm-toolbar,
.whiteboard__toolbar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: 0 1px 4px var(--shadow-weak);
}

/* A dragged or open note stacks at 10, and the toolbar has to clear it. */
.whiteboard__toolbar {
  z-index: 11;
}

.wheel-toolbar .wheel-tool,
.mm-toolbar .mm-tool,
.whiteboard__toolbar .whiteboard__tool {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.1;
  background: transparent;
  color: var(--ink);
  border: none;
  border-radius: 999px;
}

.wheel-toolbar .wheel-tool:hover,
.mm-toolbar .mm-tool:hover,
.whiteboard__toolbar .whiteboard__tool:hover {
  background: var(--surface-muted);
  color: var(--brand-velvet-ink);
}

.wheel-toolbar-divider,
.mm-toolbar-divider,
.whiteboard__toolbar-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.15rem 0.1rem;
  background: var(--border-soft);
}

.wheel-viewport,
.mm-viewport {
  position: relative;
  height: var(--canvas-height, 65vh);
  min-height: 420px;
  overflow: hidden;
  /* pan-y keeps vertical swipes scrolling the page; the board fills most of a
     phone screen, so claiming every gesture would trap the scroll. */
  touch-action: pan-y;
  cursor: grab;
}

.wheel-viewport.is-panning,
.mm-viewport.is-panning {
  cursor: grabbing;
}

/* A card that can be dragged around its ring takes the touch gesture itself,
   or the page would scroll instead. */
.wheel-viewport.is-arrangeable .wheel-node:not(.wheel-center) {
  cursor: grab;
  touch-action: none;
}

.wheel-viewport.is-arranging,
.wheel-viewport.is-arranging .wheel-node {
  cursor: grabbing;
}

.wheel-svg,
.mm-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center center;
}

/* The viewBox spans the whole board, so it is scaled far down to fit; a
   scaling stroke would fall below one device pixel and vanish. The zoom on top
   is a CSS transform that scales even a non-scaling stroke, so each width is
   divided by it (--board-zoom, set by radial-board.js). */
.wheel-ring,
.mm-ring {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: calc(1.75px / var(--board-zoom, 1));
  stroke-dasharray: calc(5px / var(--board-zoom, 1)) calc(7px / var(--board-zoom, 1));
  opacity: 0.5;
  vector-effect: non-scaling-stroke;
}

/* The one ring open for new consequences stands out from the guides. */
.wheel-ring.is-open {
  stroke: var(--action);
  stroke-width: calc(3px / var(--board-zoom, 1));
  stroke-dasharray: none;
  opacity: 0.85;
}

.wheel-edge,
.mm-edge {
  stroke: var(--border-soft);
  vector-effect: non-scaling-stroke;
}

.wheel-edge {
  stroke-width: calc(1.5px / var(--board-zoom, 1));
}

.mm-edge {
  stroke-width: calc(1.75px / var(--board-zoom, 1));
}

.wheel-arrowhead {
  fill: var(--border-soft);
}

.wheel-node,
.mm-node {
  cursor: pointer;
}

.wheel-node rect,
.mm-node rect {
  stroke: var(--surface);
  stroke-width: 2;
}

.wheel-node text,
.mm-node text {
  font-size: 13px;
  pointer-events: none;
}

.wheel-node text { fill: var(--on-brand); }
.mm-node text { fill: var(--ink); }

.wheel-depth-0 rect { fill: var(--brand-velvet); }
.wheel-depth-1 rect { fill: var(--brand-monarch); }
.wheel-depth-2 rect { fill: var(--brand-olive); }
.wheel-depth-3 rect { fill: var(--brand-cornflower); }
.wheel-depth-2 text,
.wheel-depth-3 text { fill: var(--ink); }

/* A cluster color replaces the ring's color, so similar consequences read
   as one group wherever they sit. */
.wheel-node.wheel-color-yellow rect { fill: var(--note-yellow); stroke: var(--note-yellow-edge); }
.wheel-node.wheel-color-pink rect { fill: var(--note-pink); stroke: var(--note-pink-edge); }
.wheel-node.wheel-color-blue rect { fill: var(--note-blue); stroke: var(--note-blue-edge); }
.wheel-node.wheel-color-green rect { fill: var(--note-green); stroke: var(--note-green-edge); }
.wheel-node.wheel-color-orange rect { fill: var(--note-orange); stroke: var(--note-orange-edge); }
.wheel-node.wheel-color-purple rect { fill: var(--note-purple); stroke: var(--note-purple-edge); }
.wheel-node[class*="wheel-color-"] text { fill: var(--ink); }

/* While one ring is open, the cards its consequences can follow from. */
.wheel-node.wheel-target rect {
  stroke: var(--action);
  stroke-width: 3;
  stroke-dasharray: 7 4;
}

.mm-center rect { fill: var(--brand-velvet); }
.mm-center text { fill: var(--on-brand); }

/* A main branch keeps its color all the way out, so a branch reads as one
   thought rather than as a depth. Six colors, cycled. */
.mm-node.mm-branch-0 rect, .mm-node.mm-branch-4 rect { fill: var(--brand-monarch); }
.mm-node.mm-branch-1 rect, .mm-node.mm-branch-5 rect { fill: var(--brand-olive); }
.mm-node.mm-branch-2 rect { fill: var(--brand-cornflower); }
.mm-node.mm-branch-3 rect { fill: var(--brand-velvet); }
.mm-node.mm-branch-0 text, .mm-node.mm-branch-4 text,
.mm-node.mm-branch-3 text { fill: var(--on-brand); }

.mm-edge.mm-branch-0, .mm-edge.mm-branch-4 { stroke: var(--brand-monarch); }
.mm-edge.mm-branch-1, .mm-edge.mm-branch-5 { stroke: var(--brand-olive); }
.mm-edge.mm-branch-2 { stroke: var(--brand-cornflower); }
.mm-edge.mm-branch-3 { stroke: var(--brand-velvet); }

.wheel-node:hover rect,
.wheel-node:focus rect,
.mm-node:hover rect,
.mm-node:focus rect {
  stroke: var(--brand-velvet);
}

.wheel-node.selected rect,
.mm-node.selected rect {
  stroke: var(--ink);
  stroke-width: 4;
}

.wheel-panel-title,
.mm-panel-title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.wheel-panel-section,
.mm-panel-section {
  margin-top: 1rem;
}

.wheel-panel-section textarea,
.mm-panel-section textarea {
  width: 100%;
}

.wheel-panel-note,
.mm-panel-note {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
}

.wheel-panel-label {
  display: block;
  margin-bottom: 0.4rem;
}

.wheel-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  /* Pico presents `[role=group]` as a joined input group: full width, a bottom
     margin and children that grow to fill it. These are separate swatches. */
  width: auto;
  margin-bottom: 0.3rem;
}

.wheel-swatches .wheel-swatch {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: var(--surface);
}

/* "No color": an empty swatch struck through. */
.wheel-swatches .wheel-swatch--none {
  background: linear-gradient(
    to top right,
    transparent calc(50% - 1px),
    var(--ink-muted) calc(50% - 1px) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
}

.wheel-swatches .wheel-swatch--yellow { background: var(--note-yellow); border-color: var(--note-yellow-edge); }
.wheel-swatches .wheel-swatch--pink { background: var(--note-pink); border-color: var(--note-pink-edge); }
.wheel-swatches .wheel-swatch--blue { background: var(--note-blue); border-color: var(--note-blue-edge); }
.wheel-swatches .wheel-swatch--green { background: var(--note-green); border-color: var(--note-green-edge); }
.wheel-swatches .wheel-swatch--orange { background: var(--note-orange); border-color: var(--note-orange-edge); }
.wheel-swatches .wheel-swatch--purple { background: var(--note-purple); border-color: var(--note-purple-edge); }

.wheel-swatches .wheel-swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: none) {
  .wheel-swatches .wheel-swatch {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.wheel-panel-actions,
.mm-panel-actions {
  display: flex;
  gap: 0.5rem;
}

.wheel-panel-actions button,
.mm-panel-actions button {
  width: auto;
}

.wheel-participants,
.mm-participants {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .wheel-layout,
  .wheel-layout:has(.wheel-panel:not([hidden])),
  .mm-layout,
  .mm-layout:has(.mm-panel:not([hidden])) {
    grid-template-columns: 1fr;
  }
}

.template-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.template-picker [role="button"] {
  width: auto;
  margin-bottom: 0;
}

/* ---------- Trend board ---------- */

.kanban-board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  overflow-x: auto;
  /* overflow-x:auto alone makes overflow-y compute to auto, so the whole board
     becomes one vertical scroll block. hidden stops that; each column scrolls its
     own cards instead (below), which keeps the board's horizontal scrollbar in view
     rather than buried at the foot of a page-tall board. */
  overflow-y: hidden;
  padding-bottom: 1rem;
}

.kanban-column {
  flex: 0 0 17rem;
  display: flex;
  flex-direction: column;
  /* Cap a column near the viewport so a long stack scrolls inside it (see
     .kanban-list) rather than running the page down; the offset is the chrome
     above the board. Short columns stay their natural height. */
  max-height: calc(100dvh - 20rem);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-top: 4px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
}

.kanban-column[class*="module-"] {
  border-top-color: var(--module-hue);
}

.kanban-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
}

.kanban-column-head h2 {
  font-size: 1rem;
  margin: 0;
}

.kanban-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  min-height: 4rem;
  flex: 1;
  /* Fills the space under the column head and scrolls when the column is capped. */
  overflow-y: auto;
}

.kanban-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  cursor: grab;
  box-shadow: 0 1px 2px var(--shadow-weak);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card-title {
  font-weight: 500;
  text-decoration: none;
  color: var(--pico-color);
}

.kanban-card-title:hover {
  text-decoration: underline;
}

.sortable-ghost {
  opacity: 0.4;
}

.sortable-drag {
  box-shadow: 0 6px 16px var(--shadow-medium);
}


/* ---------- Kompetenz-Explorer ---------- */

/* Learning outcomes placed per level, shown under an internal model on the
   competency detail — full-width so it stacks below the row's link + controls. */
.kx-placement-summary {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.kx-category {
  margin-block: 1.5rem 0.5rem;
}

/* Level count columns in the model overview: narrow and centered. */
.kx-level-col {
  width: 6rem;
  text-align: center;
}

.kx-row-title {
  margin: 0;
}

.kx-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kx-row-actions form {
  margin: 0;
}

/* Compact, inline category picker in each competency's header. */
.kx-cat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.kx-cat-label select {
  width: auto;
  min-width: 8rem;
  margin: 0;
  padding-block: 0.3rem;
}



.kx-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kx-bulk-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}

.kx-bulk-group select {
  width: auto;
  min-width: 11rem;
  max-width: 100%;
  margin: 0;
}

.kx-bulk-group button {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .kx-row-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------- Trend Viewer ---------- */

/* Two columns of paired panes: each browser on the left beside the trend's own
   list of the same kind on the right, signals above drivers. Each pane's list
   scrolls on its own, so every pane's heading and filters stay in view while
   entries move between them. */
.trend-viewer {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* With no trend chosen there is nothing to pair the browsers with, so they
   share the width instead of leaving the target column empty. */
.trend-viewer--browse {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trend-viewer__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trend-viewer__pane-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.trend-viewer__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.85rem;
}

/* No width override: Pico sizes a checkbox itself, and `width: auto` collapses
   it to its 4px border. */
.trend-viewer__toggle input {
  margin: 0;
}

.trend-viewer__meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.trend-viewer__meta dt {
  color: var(--ink-muted);
}

.trend-viewer__meta dd {
  margin: 0;
}

.trend-viewer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 22rem;
  overflow-y: auto;
}

.trend-viewer__cutoff {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.tv-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
}

.tv-row[data-linked="1"] {
  border-color: var(--pico-primary);
}

.tv-row__title {
  flex: 1 1 8rem;
  min-width: 0;
  font-size: 0.9rem;
}

/* Badges and the toggle travel as one right-aligned cluster, so a long title
   wraps above them instead of splitting them across two lines. */
.tv-row__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  margin-left: auto;
}

/* .strength-badge pins itself to the start of its flex line for the column-laid
   signal card; in this row it lines up with its neighbors instead. */
.tv-row__meta .strength-badge {
  align-self: center;
}

/* A one-character +/− button: a square target sized to the row rather than to
   Pico's default form-element padding. */
.tv-row__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1;
}

@media (max-width: 1024px) {
  .trend-viewer {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Triage ---------- */

.triage-card {
  max-width: 46rem;
  padding: 2rem;
}

@media (max-width: 768px) {
  .triage-card {
    padding: 1.25rem;
  }
}

/* Widen the card so the source preview can sit beside the triage menu. */
.triage-card--with-source {
  max-width: 90rem;
}

.triage-progress {
  margin: 0 0 1rem;
}

.triage-progress progress {
  margin: 0;
}

.triage-progress .filter-active {
  margin: 0.35rem 0 0;
}

.triage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* The menu keeps its readable width; the source preview takes the extra room,
   down to a floor below which the embedded page is unreadable — narrower than
   that, the menu gives way instead. */
.triage-card--with-source .triage-layout {
  grid-template-columns: minmax(0, 34rem) minmax(20rem, 1fr);
  gap: 2.5rem;
  align-items: stretch;
}

/* Long source URLs break instead of squeezing the metadata labels. */
.triage-main .meta-list {
  margin: 1.5rem 0;
  gap: 0.4rem 1.5rem;
}

.triage-main .meta-list dd {
  overflow-wrap: anywhere;
}

/* Narrower than this the two columns cannot both hold their floor, so the
   source stacks under the menu and each gets the full width. */
@media (max-width: 1200px) {
  .triage-card--with-source .triage-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.triage-source {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.triage-source__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.triage-source__frame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 32rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  /* The embedded page brings its own colors and assumes a light page. */
  background: var(--paper);
}

.triage-source__image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.triage-source__note {
  margin: 0.5rem 0 0;
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.triage-source__link {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.triage-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.triage-heading h2 {
  margin: 0;
}

.triage-strength {
  margin: 1.75rem 0 0;
  padding: 0;
  border: none;
}

.triage-strength legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 0.6rem;
}

.triage-strength label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 1.5rem 0 0;
}

.triage-decisions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

/* The `button` prefix outranks Pico's `button[type=submit] { width: 100% }`. */
button.triage-decision {
  width: auto;
  margin: 0;
  padding: 0.6rem 1.25rem;
  border: 1px solid transparent;
  font-weight: 600;
}


.triage-links {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
}

.derive-suggestions {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.derive-suggestion {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.derive-suggestion:last-child {
  border-bottom: none;
}

.derive-suggestion-title {
  font-weight: 600;
}

.derive-suggestion-signals {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

/* Generated scenario artifacts, folded away so a review list of four scenarios
   stays scannable. */
.derive-suggestion-artifacts {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pico-muted-color);
}

.derive-suggestion-artifact {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

/* ---------- Scenario generator ---------- */

.gen-heading {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.05rem;
}

/* The four input pickers pair up on a wide screen so the archetype choices and
   the submit button stay above the fold. */
.gen-inputs {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.5rem 0;
}

.gen-input > label {
  font-weight: 600;
}

@media (max-width: 768px) {
  .gen-inputs {
    grid-template-columns: 1fr;
  }
}

.gen-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}

/* No width override: Pico sizes a checkbox itself, and `width: auto` collapses
   it to its 4px border. */
.gen-option input {
  flex: none;
  margin: 0;
}

.gen-artifacts {
  margin: 1rem 0;
}

/* Grouped archetype checkbox picker (partials/archetype_checkboxes.html), shared
   by the scenario generator and the scenario form: one titled block per framework
   so the short names need no framework prefix. */
.archetype-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.archetype-group {
  margin: 0;
  padding: 0.6rem 0.75rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.archetype-group__title {
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.archetype-group__subtitle {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
}

.archetype-group__options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* The label wraps the checkbox; an option may carry a gloss under its name, so
   the checkbox aligns to the first line rather than the middle of the block. */
.archetype-option {
  display: flex;
  gap: 0.45rem;
  align-items: start;
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.3;
}

.archetype-option input {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
}

.archetype-option__text {
  display: flex;
  flex-direction: column;
}

.archetype-option__hint {
  font-size: 0.82rem;
}

.image-preview,
.signal-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.signal-documents {
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.signal-documents__item {
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.signal-documents__title {
  font-weight: 600;
}

.doc-summary {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.doc-summary > :first-child {
  margin-top: 0;
}

.doc-summary > :last-child {
  margin-bottom: 0;
}

/* Collapsible "retrieved content" of a source (source/signal detail). */
.source-content--inset {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.25rem;
}

.source-content__summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.1rem;
}

.source-content__summary::-webkit-details-marker {
  display: none;
}

.source-content__summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: translateY(-0.15em) rotate(-45deg);
  transition: transform 0.15s ease;
}

.source-content[open] .source-content__summary::before {
  transform: translateY(0.05em) rotate(45deg);
}

.source-content__hint {
  font-size: 0.85rem;
  font-weight: 400;
}

.source-content__body {
  margin-top: 1rem;
  max-height: 32rem;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.6rem;
  background: var(--surface-muted);
}

.source-content__body > :first-child {
  margin-top: 0;
}

.source-content__body > :last-child {
  margin-bottom: 0;
}

.geocode {
  margin: 0.75rem 0;
}

.geocode__status {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.geocode__results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.geocode__results button {
  width: 100%;
  text-align: left;
}

.image-preview:empty { margin: 0; }

.image-preview__item,
.signal-images__item,
.existing-images__item {
  position: relative;
  margin: 0;
}

.image-preview__item img,
.existing-images__item img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 6px;
  display: block;
}

.signal-images__item img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 6px;
  display: block;
}

.image-preview__remove {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
  background: var(--brand-moss);
  color: var(--on-brand);
  border: none;
  cursor: pointer;
}

.existing-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.existing-images__remove {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
}

form.is-dragover {
  outline: 2px dashed var(--brand-moss);
  outline-offset: 4px;
}

/* ---------- Signal capture help ---------- */

.capture-help > summary {
  cursor: pointer;
  color: var(--pico-primary);
}
.capture-help > :last-child {
  margin-bottom: 0;
}
/* The bookmarklet is meant to be dragged to the bookmarks bar, not clicked. */
.capture-bookmarklet {
  cursor: grab;
}

/* ---------- Empty states ---------- */

/* Three intentional shapes, and every `{% empty %}` branch picks one of them
   rather than a bare `.muted` paragraph:
     `.empty-state`    the rich centered placeholder with icon/heading/action, for
                       a whole page or list that has nothing in it yet;
     `.empty-centered` a plain centered note standing in for the missing content —
                       an `<li>` in a list, a `<p>` in a figure or section, or the
                       colspanned `<td>` of an empty table's one row. On a cell the
                       table's own `padding-inline` wins, which is what keeps the
                       row's horizontal padding in step with the rows above it;
     `.empty-note`     a small sub-note under a section heading or inline beside a
                       row of chips (add `--indented` where it aligns beneath a
                       labeled row).
   A "—" standing for one missing *value* in a table cell is not an empty state and
   stays a plain `.muted` span. */
.empty-centered {
  padding: 1.75rem 0;
  text-align: center;
}

.empty-note {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.empty-note--indented {
  margin-left: 2.1rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2.5rem 1.5rem;
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  color: var(--ink-muted);
}

.empty-state__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.empty-state h2,
.empty-state h3 {
  margin: 0;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  max-width: 44ch;
  color: var(--ink-muted);
}

.empty-state [role="button"],
.empty-state button {
  width: auto;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ---------- Breadcrumbs ---------- */

.breadcrumb {
  justify-content: flex-start; /* Pico's nav default is space-between */
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.breadcrumb ol {
  display: flex; /* Pico flexes nav ul but not nav ol */
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb li {
  padding: 0; /* Pico pads nav li for nav bars; a trail sets its own rhythm */
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 0.4rem;
  color: var(--ink-muted);
}

.breadcrumb a {
  color: var(--brand-velvet-ink);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink-muted);
}

/* ---------- Copy-to-clipboard field ---------- */

.copy-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

/* "Compact submit beside an input": the input takes the row, the control keeps
   its own width and stays on one line. One selector list rather than the same
   four declarations restated per composer. */
.copy-field input,
.cluster-new input,
.scenario-matrix__add input,
.smx-quadrant__name-add input,
.workshop-parking__add input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.copy-field button,
.cluster-toolbar [data-auto-cluster],
.cluster-new button,
.scenario-matrix__add button,
.smx-quadrant__name-add button,
.workshop-parking__add button {
  flex: none;
  width: auto;
  margin: 0;
  white-space: nowrap;
}

/* Success tint while a copy button's label reads "Copied!" (copy.js). */
[data-copy].is-copied,
[data-copy-text].is-copied {
  color: var(--brand-olive-ink);
  border-color: var(--brand-olive);
}

/* ---------- Dashboard workflow ---------- */

/* What is waiting for you, at the top of the first screen after login. A card,
   not a flash: the shared flash container auto-clears its own contents after a
   few seconds, which is right for a confirmation and wrong for a to-do list. */
.attention-card {
  border-left: 4px solid var(--brand-monarch);
}

/* The guided start: a numbered checklist whose done steps show a tick. */
.first-steps {
  border-left: 4px solid var(--pico-primary);
}
.first-steps__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.first-steps__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.first-steps__item.is-done {
  color: var(--ink-muted);
}
.first-steps__mark {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pico-primary-background);
  color: var(--on-brand);
  font-size: 0.85rem;
  font-weight: 700;
}
.first-steps__item.is-done .first-steps__mark {
  background: var(--tint-positive);
  color: var(--ink);
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* The recently-visited list, filled from localStorage by recent.js. */
/* A grid of equal chips that fills its card's width — as many per row as fit,
   none left short beside a stretch of empty card. */
.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-list li {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.recent-list a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  font-size: 0.85rem;
  line-height: 1.4;
  text-decoration: none;
  color: inherit;
}

.recent-list a:hover {
  border-color: var(--pico-primary);
}

/* Both labels stay on one line: a wrapping type turned the row into chips of
   unequal height. */
.recent-list__title,
.recent-list__type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list__title {
  min-width: 0;
}

/* The type is the short, repeated label: it keeps its width and the title
   absorbs the truncation. */
.recent-list__type {
  flex: 0 0 auto;
  max-width: 50%;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

@media (max-width: 480px) {
  .recent-list {
    grid-template-columns: 1fr;
  }
}

/* The inventory, compacted: 18 counts read as a wall of tiles, and as a row of
   chips per module they read as one line each. */
.count-group {
  margin-bottom: 1rem;
}

.count-group__label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.count-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.count-chip:hover {
  border-color: var(--pico-primary);
}

.count-chip__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.count-chip__label {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.recent-block {
  margin-bottom: 1.5rem;
}

.counts {
  margin-bottom: 1.5rem;
}

.count-chip[class*="module-"] { border-left-color: var(--module-ink); }

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  counter-reset: workflow;
}

.workflow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.25rem 1.1rem;
  margin: 0;
  border-top: 4px solid var(--module-hue, var(--border-soft));
  text-decoration: none;
  color: inherit;
  /* The five steps arrive left to right, which is the order they are meant to
     be read in. The global reduced-motion block cuts this to nothing. */
  animation: workflow-step-in 0.35s ease both;
}
.workflow-step:nth-child(2) { animation-delay: 0.05s; }
.workflow-step:nth-child(3) { animation-delay: 0.1s; }
.workflow-step:nth-child(4) { animation-delay: 0.15s; }
.workflow-step:nth-child(5) { animation-delay: 0.2s; }
@keyframes workflow-step-in {
  from { opacity: 0; translate: 0 0.5rem; }
}

.workflow-step::before {
  counter-increment: workflow;
  content: counter(workflow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--on-brand);
  background: var(--ink-muted);
}

.workflow-step h3 {
  margin: 0;
  font-size: 1.1rem;
}

.workflow-step p {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.workflow-step__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--module-ink);
}

/* The step badge carries its number in the surface color on the ink: the ink
   clears AA against the surface by construction, in either scheme. */
.workflow-step[class*="module-"]::before {
  background: var(--module-ink);
  color: var(--surface);
}

.section-heading {
  align-items: baseline;
  margin-bottom: 0.75rem;
}

/* The heading block takes the row's slack, and the actions keep each label on
   one line: once the row runs out they wrap below the heading whole. */
.section-heading > :first-child {
  flex: 1 1 12rem;
  min-width: 0;
}

.section-heading :is(button, [role="button"]) {
  white-space: nowrap;
}

.section-heading h2 {
  margin: 0;
}

/* The focused project's name reads as a label above its stat tiles, not as a
   full-size heading. */
.focus-block__title {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Scenario comparison and cross-entry linking */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
  margin-bottom: 0;
}

/* Scrollable data tables (feeds, users, tags, …) often carry many columns; a
   tighter horizontal cell padding keeps them within the card instead of forcing
   a horizontal scroll on desktop. */
.table-scroll th,
.table-scroll td {
  padding-inline: 0.5rem;
}

/* Row-under-the-pointer feedback on list tables; the highlight sits on the td
   because Pico paints cell backgrounds (a tr background would hide beneath). */
.table-scroll tbody tr:hover > td {
  background-color: var(--surface-muted);
}

/* On a narrow phone the generic entry list stacks each row into a card: the
   title leads, the other cells follow labeled by their column header
   (data-label), so nothing is clipped past the right edge. Tables that opt in
   carry data-stacked; the wide bespoke tables keep scrolling. */
@media (max-width: 600px) {
  .table-scroll table[data-stacked] thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .table-scroll table[data-stacked],
  .table-scroll table[data-stacked] tbody {
    display: block;
    width: 100%;
  }
  .table-scroll table[data-stacked] tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .table-scroll table[data-stacked] td {
    display: block;
    padding: 0;
    border: none;
    grid-column: 2;
  }
  .table-scroll table[data-stacked] td.col-select {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: start;
  }
  .table-scroll table[data-stacked] td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--ink-muted);
    font-size: 0.8rem;
  }
  .table-scroll table[data-stacked] td.col-title {
    font-weight: 600;
  }
  .table-scroll table[data-stacked] td.col-title::before {
    content: none;
  }
}

/* A sortable column header: the whole label is the link, and the caret reads
   the th's own aria-sort, so the visible direction and the announced one
   cannot drift apart. */
.col-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}
.col-sort:hover {
  color: var(--pico-primary);
}
/* The glyphs carry an empty alternative text: the direction is already on the
   header's aria-sort, so a screen reader must not read "up-down arrow" too. */
.col-sort::after {
  content: "↕" / "";
  font-size: 0.75em;
  opacity: 0.35;
}
th[aria-sort="ascending"] .col-sort::after {
  content: "↑" / "";
  opacity: 1;
}
th[aria-sort="descending"] .col-sort::after {
  content: "↓" / "";
  opacity: 1;
}

.compare-table th[scope="row"] {
  white-space: nowrap;
  vertical-align: top;
}

.compare-table td {
  vertical-align: top;
}

.compare-cell {
  text-align: center;
}

.checkbox-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.35rem;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

/* Divider above an entry's editable link panels, inside its description card. */
.entry-relations {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.25rem;
}

.related-links {
  margin-bottom: 1.5rem;
}

.related-links:last-child {
  margin-bottom: 0;
}

/* An extra action for the links block above it, kept with that block rather than
   with the next one. */
.related-links + .related-links__more {
  margin: -0.75rem 0 1.5rem;
}

/* A panel grouped under a section's own heading steps down a level but keeps
   the weight of a card heading; Pico's h3 would outsize the section's h2. */
.related-links h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.related-links__list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  overflow: hidden;
}

.related-links__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
}

.related-links__list li + li {
  border-top: 1px solid var(--border-soft);
}

.related-links__list li:hover {
  background: var(--surface-muted);
}

/* The link takes the row so the unlink control settles against the far edge. */
.related-links__list li > a {
  flex: 1;
}

/* A question row stacks its chip, text, answer and answering documents. */
.related-links__list .question-body {
  flex: 1;
}

.question-answer {
  display: block;
  margin-top: 0.25rem;
}

/* Rows whose label is plain text (not a link) still push their row-level edit/
   delete controls to the far edge, matching the linked rows above. */
.related-links__list li > .row-actions {
  margin-left: auto;
}

.related-links__remove {
  display: flex;
  margin: 0;
}

/* A link's origin badge (e.g. found by AI) sits between the name and the ×. */
.related-links__marker {
  flex: none;
}

/* The coverage card's sub-lists (signals, named alongside, trends) sit under
   its 1.2rem h2; Pico's default h3 would outweigh it. */
.coverage h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

/* A signal's mention panel: organizations, places and people side by side on a
   wide screen, stacked on a narrow one. */
.signal-mentions .card-header-row {
  margin-bottom: 0.75rem;
}

.signal-mentions__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 1.5rem;
  margin-top: 1rem;
}

/* A suggested person name keeps its actions on the row; a narrow screen wraps
   them under the name. */
.name-suggestions li {
  flex-wrap: wrap;
}

.name-suggestions__name {
  flex: 1 1 12rem;
}

.name-suggestions__name .muted {
  display: block;
  font-size: 0.85rem;
}

/* The add form folds behind a "+ Link" button: a detail page with three
   relations no longer opens with three search fields standing empty. */
.related-links__disclosure {
  margin: 0.5rem 0 0;
  padding: 0;
  border: none;
}
.related-links__disclosure > summary {
  width: auto;
  list-style: none;
}
.related-links__disclosure > summary::-webkit-details-marker {
  display: none;
}
.related-links__disclosure > summary::after {
  content: none;
}
.related-links__disclosure[open] > summary {
  margin-bottom: 0.5rem;
}

.related-links__add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

/* The picker fills the row; the submit stays compact beside it instead of
   taking Pico's default full width and wrapping onto its own line. */
.related-links__add .ss,
.related-links__add > select {
  flex: 1;
  min-width: 12rem;
  margin: 0;
}

.related-links__add > button {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* A badge with an inline caption beside it (e.g. kind pill + scheme name). */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Competency-model proficiency scheme rendered as numbered steps so the
   progression (position 1 → n) reads at a glance instead of as a bare list. */
.proficiency-ladder {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.proficiency-ladder__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.25rem 0.85rem 0.25rem 0.3rem;
  background: var(--badge-neutral-bg);
  border-radius: 999px;
  font-size: 0.9rem;
}

.proficiency-ladder__step:last-child {
  background: var(--badge-info-bg);
}

.proficiency-ladder__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--pico-primary);
  color: var(--on-brand);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Numeric schemes drop the redundant text label, so the badge carries the
   step on its own — pad it back to a comfortable pill. */
.proficiency-ladder__step:not(:has(.proficiency-ladder__label)) {
  padding-right: 0.3rem;
}

.link-button {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  width: auto;
  line-height: 1;
}

/* Searchable select: a combobox rendered over a native <select.searchable-select>
   by searchable-select.js. The <select> stays in the DOM as the submitted value. */
.ss {
  position: relative;
  /* The hidden native <select> no longer contributes Pico's form-element bottom
     margin, so restore it on the wrapper to keep spacing to the next field. */
  margin-bottom: var(--pico-spacing, 1rem);
}

.ss__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ss__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  /* Match a native Pico form control's height so the picker sits flush with the
     text inputs around it: line box + vertical padding + borders. */
  min-height: calc(
    (1rem * var(--pico-line-height, 1.5)) + (2 * var(--pico-form-element-spacing-vertical, 0.75rem)) +
      (2 * var(--pico-border-width, 1px))
  );
  padding: 0.2rem var(--pico-form-element-spacing-horizontal, 0.75rem);
  background: var(--pico-form-element-background-color);
  border: var(--pico-border-width, 1px) solid var(--pico-form-element-border-color);
  border-radius: var(--pico-border-radius);
  cursor: text;
}

/* The search field inside carries no outline of its own, so the control shows
   the focus for it. */
.ss__control:focus-within,
.ss__control[aria-expanded="true"] {
  border-color: var(--brand-velvet-ink);
  box-shadow: 0 0 0 0.125rem var(--pico-primary-focus);
}

.ss__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.2rem 0.1rem 0.5rem;
  color: var(--on-brand);
  font-size: 0.8rem;
  background: var(--brand-velvet);
  border-radius: 4px;
}

.ss__chip-remove {
  width: 1.1rem;
  height: 1.1rem;
  /* Pico gives buttons a bottom margin; on a flex item that margin expands the
     chip's cross-size, so reset it to keep the chip hugging its text. */
  margin: 0;
  padding: 0;
  color: var(--on-brand);
  font-size: 0.9rem;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.ss__chip-remove:hover {
  background: color-mix(in srgb, var(--on-brand) 25%, transparent);
}

/* Reset Pico's input padding/margin/height, which would otherwise inflate the
   control; the selector is scoped so it outranks Pico's element rules. The short
   basis lets a chip and the caret share one line in a narrow filter row; with
   room to spare the box grows to the rest of the line anyway. */
.ss__control .ss__input {
  flex: 1 1 4rem;
  width: auto;
  min-width: 4rem;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: var(--pico-line-height, 1.5);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ss__control .ss__input:focus {
  outline: none;
}

.ss__menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  max-height: 15rem;
  margin: 0.2rem 0 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  background: var(--pico-background-color);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  box-shadow: 0 6px 20px var(--shadow-medium);
}

.ss__option {
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.ss__option.is-active {
  background: var(--pico-primary-focus, var(--shadow-weak));
}

.ss__option[aria-selected="true"] {
  font-weight: 600;
  color: var(--brand-velvet-ink);
}

.ss__option[aria-selected="true"]::after {
  content: " ✓";
}

/* The "add what you typed" row, on a picker that may grow its own vocabulary. */
.ss__option--create {
  color: var(--pico-primary);
  font-style: italic;
}

.ss__empty {
  padding: 0.35rem 0.5rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

/* ---------- Command palette & shortcuts ---------- */

/* Pico renders <dialog> as a full-screen flex overlay (min-width:100%), so the
   visible card is the inner box, not the dialog element. Here we only nudge the
   overlay to align the card near the top instead of dead-center. */
.cmd-palette {
  align-items: flex-start;
  padding: 12vh 1rem 1rem;
}

.cmd-palette__box {
  display: flex;
  flex-direction: column;
  width: min(90vw, 34rem);
  max-height: 76vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  box-shadow: 0 1.25rem 3rem var(--shadow-strong);
}

/* The phone navigation dialog: the sidebar tree, every module expanded. The
   box is the dialog's child (Pico paints the dialog itself as the overlay). */
.nav-dialog {
  align-items: flex-start;
  padding: 0;
}

.nav-dialog__box {
  display: flex;
  flex-direction: column;
  width: min(100vw, 22rem);
  max-height: 100vh;
  margin-inline-end: auto;
  overflow-y: auto;
  background: var(--surface);
  border-inline-end: 1px solid var(--border-soft);
  box-shadow: 0 1.25rem 3rem var(--shadow-strong);
}

.nav-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.25rem 1.5rem;
}

.nav-dialog__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
}

.nav-dialog__close {
  width: auto;
  margin: 0;
  padding: 0.25rem 0.6rem;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.nav-dialog__nav {
  padding: 0 0.75rem 1rem;
}

/* Inside the dialog the tree keeps its desktop shape at every viewport, so the
   strip rules of the shell block must not reach it. */
.nav-dialog__nav,
.nav-dialog__nav ul {
  flex-direction: column;
  align-items: stretch;
}

.nav-dialog__nav li .sidebar-subnav {
  display: block;
}

/* The tree keeps its desktop row height inside the dialog: the shell block's
   strip sizing is for a horizontal bar, and a finger needs the taller row. */
.nav-dialog__nav li a {
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  white-space: normal;
}
.nav-dialog__nav .sidebar-subnav li a {
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}

.cmd-palette__input {
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0.9rem 0.9rem 0 0;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  background: var(--surface);
}

.cmd-palette__input:focus {
  box-shadow: none;
}

.cmd-palette__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: 50vh;
  overflow-y: auto;
}

.cmd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

.cmd-option[aria-selected="true"] {
  background: var(--surface-muted);
}

.cmd-option__label {
  font-weight: 500;
  color: var(--ink);
}

.cmd-option__group {
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Module heading inside the palette's option list. Seventy destinations read as
   one undifferentiated wall without them; sticky, so the heading of whatever
   you have scrolled into stays overhead. */
.cmd-group-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.35rem 0.9rem 0.2rem;
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.cmd-option--search .cmd-option__label::before {
  content: "\201c";
}

.cmd-option--search .cmd-option__label::after {
  content: "\201d";
}

.cmd-palette__empty {
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--ink-muted);
}

.cmd-palette__hint {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.cmd-palette kbd,
.cmd-help kbd {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--ink-muted);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8em;
  font-weight: 600;
}

.cmd-palette kbd + kbd,
.cmd-help kbd + kbd {
  margin-inline-start: 0.25rem;
}

/* The help card is a Pico <article>, which Pico already styles as the modal
   card; we only cap its width and set the inner padding. */
.cmd-help__box {
  max-width: 26rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.cmd-help__box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cmd-help__box h2 {
  margin: 0;
  font-size: 1.15rem;
}

.cmd-help__close {
  margin: 0;
  width: auto;
  padding: 0.1rem 0.6rem;
  line-height: 1;
}

.cmd-help__group {
  margin: 1.1rem 0 0.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.cmd-help__group:first-of-type {
  margin-top: 0;
}

.cmd-help__list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1rem;
  margin: 0;
  align-items: center;
}

.cmd-help__list dt {
  margin: 0;
  white-space: nowrap;
}

.cmd-help__list dd {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- Analyzing research activity ---------- */

.research-activity-chart {
  position: relative;
  height: 16rem;
  margin-top: 0.5rem;
}

.research-activity-query {
  margin-bottom: 1rem;
}

.research-activity-query > summary {
  font-size: 0.9rem;
  color: var(--pico-primary);
}

.research-activity-query > p {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
}

/* Futures cone — bands widen center-outward to echo the cone silhouette. */
.cone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.cone-legend {
  margin: 0.5rem 0 1rem;
}
.cone-preferable-key {
  color: var(--brand-olive-ink);
  font-weight: 600;
}
.cone-band {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.cone-band--projected { max-width: 46%; border-left-color: var(--brand-moss); }
.cone-band--probable { max-width: 62%; border-left-color: var(--brand-cornflower); }
.cone-band--plausible { max-width: 78%; border-left-color: var(--brand-olive); }
.cone-band--possible { max-width: 90%; border-left-color: var(--brand-monarch); }
.cone-band--preposterous { max-width: 100%; border-left-color: var(--brand-velvet); }
.cone-band__title {
  margin: 0;
  font-size: 1rem;
}
/* The tally beside a band/layer/zone/column heading. The two JS-filled ones
   render empty until their board scripts write a number, so the shared rule
   hides an empty pill rather than painting a bare circle. */
.cone-band__count,
.cla-layer__count,
.board-zone__count,
.board-column__count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.4em;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  text-align: center;
}

.cone-band__count:empty,
.cla-layer__count:empty,
.board-zone__count:empty,
.board-column__count:empty {
  display: none;
}
.cone-band__hint {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}
.cone-projections {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cone-projection {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}
.cone-projection--preferable {
  border-color: var(--brand-olive);
}
.cone-star {
  color: var(--brand-olive-ink);
  line-height: 1.4;
}
.cone-projection__body {
  flex: 1;
  min-width: 0;
}
.cone-projection__body .prose p {
  margin: 0;
}
.cone-rationale {
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}
.cone-projection__meta {
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
}
.cone-projection__delete {
  margin-left: auto;
}
/* The one separator dot for meta rows (entry-meta, idea-meta, …): a subtle
   glyph whose spacing comes from the row's flex gap. */
.meta-dot {
  color: var(--border-soft);
}
/* A session's live participants fill their span over the realtime channel;
   while it is empty their separator would dangle at the end of the row. */
.meta-dot--participants:has(+ :empty) {
  display: none;
}
@media (max-width: 640px) {
  .cone-band {
    max-width: 100%;
  }
}

/* Causal layered analysis — four layers stacked surface→deep. The numbered
   depth marker and per-layer accent read as strata, from the visible litany
   down to the root myth. */
.cla {
  counter-reset: cla-depth;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.cla-layer {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--cla-accent);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}
.cla-layer--litany { --cla-accent: var(--brand-monarch); }
.cla-layer--systemic { --cla-accent: var(--brand-olive); }
.cla-layer--worldview { --cla-accent: var(--brand-cornflower); }
.cla-layer--myth { --cla-accent: var(--brand-velvet); }
.cla-layer__head {
  margin-bottom: 0.6rem;
}
.cla-layer__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.05rem;
}
.cla-layer__title::before {
  counter-increment: cla-depth;
  content: counter(cla-depth);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1.5px solid var(--cla-accent);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}
.cla-layer__hint {
  margin: 0.2rem 0 0 2.1rem;
  font-size: 0.85rem;
}
.cla-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cla-entry {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.cla-entry__body {
  flex: 1;
  min-width: 0;
}
.cla-entry__body .prose p {
  margin: 0;
}
.cla-note {
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border-soft);
}
.cla-entry__meta {
  font-size: 0.8rem;
  margin: 0.3rem 0 0;
}
.cla-entry__delete {
  margin-left: auto;
}
.cla-form {
  margin-top: 0.5rem;
}

/* Saved signal-explorer views. */
.saved-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}
.saved-views__label {
  font-weight: 600;
  font-size: 0.85rem;
}
.saved-view {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.1rem 0.35rem 0.1rem 0.7rem;
}
.saved-view__link {
  font-size: 0.85rem;
  text-decoration: none;
}
.saved-view-save {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  max-width: 100%;
  margin-left: auto;
}
.saved-view-save input[type="text"] {
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
  width: auto;
}
.saved-view-save button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

/* Weekly digest comments. */
.digest-comments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.digest-comment__body {
  margin: 0 0 0.2rem;
}
.digest-comment__meta {
  font-size: 0.8rem;
  margin: 0;
}

/* Scenario Chat — persona picker and interview thread */
.chat-detail-header h1 a {
  text-decoration: none;
}

.chat-scenario-summary {
  margin-bottom: 2rem;
}

.persona-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.persona-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 0.6rem;
}

.persona-card form {
  margin-top: auto;
}

.persona-name {
  margin: 0;
  font-size: 1.1rem;
}

.persona-role {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-velvet-ink);
}

.persona-intro {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chat-message {
  max-width: 80%;
  padding: 0.6rem 0.85rem;
  border-radius: 0.8rem;
}

.chat-message-body {
  margin: 0;
  line-height: 1.5;
}

.chat-message-user {
  align-self: flex-end;
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
  border-bottom-right-radius: 0.2rem;
}

.chat-message-persona,
.chat-message-assistant {
  align-self: flex-start;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 0.2rem;
}

/* An assistant turn carries a step trace and sign-off cards besides its answer,
   so it needs the room a one-line persona reply does not. */
.chat-message-assistant {
  max-width: 92%;
}

.chat-message-ai {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.chat-form button {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* Beside the button a phone leaves the textarea too narrow for the prompt, which
   then overflows its two rows, so the button moves underneath it. */
@media (max-width: 600px) {
  .chat-form {
    flex-wrap: wrap;
  }

  .chat-form textarea {
    flex-basis: 100%;
  }

  .chat-form button {
    margin-left: auto;
  }
}

.chat-pending,
.chat-message-working {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
}

.chat-pending {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* An entry the assistant suggests creating. It exists only in the conversation
   until someone approves it, so it reads as a quotation of a future entry
   rather than as the entry itself. */
.proposal-card {
  margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--border-soft);
  border-left: 3px solid var(--brand-moss-ink);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
}

/* Settled, so it recedes onto the muted surface — fading the card instead would
   take its labels below the contrast floor. */
.proposal-card--discarded {
  border-left-color: var(--border-soft);
  background: var(--surface-muted);
}

.proposal-card__kind {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.proposal-card__fields {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.5rem;
}

.proposal-card__fields dt {
  font-weight: 600;
  color: var(--ink-muted);
}

.proposal-card__fields dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .proposal-card__fields {
    grid-template-columns: 1fr;
  }

  .proposal-card__fields dd {
    margin-bottom: 0.3rem;
  }
}

.proposal-card__outcome {
  margin: 0;
  font-size: 0.9rem;
}

/* ---------- Activity focus mode ---------- */
/* Full-viewport working surface for an activity board or an analysis canvas,
   toggled by static/js/stage-focus.js. The stage is whatever element the page
   marked [data-stage]; while focused it covers everything and only the stage
   bar sits above it. The pan/zoom canvases (.wheel-viewport, .mm-viewport,
   .whiteboard__canvas, .network-canvas, .cmap-stage, .world-map) stand
   var(--canvas-height, <their own default>) tall. Only the focused stage sets
   the token, so outside focus mode each keeps its default and one variable
   grows every one of them at once. */

.stage-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 81;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.stage-bar__title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-bar__exit {
  flex: none;
  margin: 0;
}

body.stage-focused {
  overflow: hidden;
}

[data-stage].is-focused {
  position: fixed;
  inset: 0;
  z-index: 80;
  /* Clear of the stage bar (stage-focus.js measures it), plus breathing room
     around the surface. */
  padding: calc(var(--stage-bar-height, 2.75rem) + 0.5rem) 0.75rem 0.75rem;
  margin: 0;
  overflow: auto;
  background: var(--surface-muted);
  /* The chrome that normally sits above and below the board is hidden, so the
     board may claim nearly the whole viewport. stage-focus.js narrows this to
     what is actually left below the board's own composer. */
  --canvas-height: calc(100dvh - 7rem);
}

/* A board that lays its columns out as a grid keeps doing so; only the pan/zoom
   canvases read --canvas-height, and those already fill their own box. */
[data-stage].is-focused .card {
  margin-bottom: 0.75rem;
}

.stage-bar__actions {
  display: flex;
  flex: none;
  gap: 0.5rem;
}

/* The QR toggle reads as switched on while the code is pinned. */
.stage-bar .stage-bar__qr[aria-pressed="true"] {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-border);
  color: var(--pico-primary-inverse);
}

/* A share link's QR code pinned over the focused stage, so a room keeps
   joining while the board fills the wall. It sits in a corner of the
   facilitator's choosing and grows for scanning from the back of the room. */
.stage-qr {
  position: fixed;
  z-index: 82;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  box-shadow: 0 2px 10px var(--shadow-medium);
  font-size: 0.85rem;
}

.stage-qr[data-corner="bottom-right"] { right: 1rem; bottom: 1rem; }
.stage-qr[data-corner="bottom-left"] { left: 1rem; bottom: 1rem; }
.stage-qr[data-corner="top-left"] { left: 1rem; top: calc(var(--stage-bar-height, 2.75rem) + 0.75rem); }
.stage-qr[data-corner="top-right"] { right: 1rem; top: calc(var(--stage-bar-height, 2.75rem) + 0.75rem); }

.stage-qr .stage-qr__code {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  line-height: 0;
  cursor: zoom-in;
}

.stage-qr .stage-qr__code[aria-pressed="true"] {
  cursor: zoom-out;
}

.stage-qr__code img {
  display: block;
  width: 9.5rem;
  max-width: none;
  height: 9.5rem;
  /* A scanner needs the quiet zone light whatever the theme is doing. */
  background: var(--paper);
}

.stage-qr.is-large .stage-qr__code img {
  width: min(24rem, 44vh, 70vw);
  height: min(24rem, 44vh, 70vw);
}

.stage-qr__caption {
  max-width: 100%;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 640px) {
  [data-stage].is-focused {
    padding-inline: 0.4rem;
    padding-bottom: 0.4rem;
    --canvas-height: calc(100dvh - 5.5rem);
  }
}

/* ---------- Three horizons board ---------- */
/* Generic sticky-note board (futuring.board): zone columns accented by index,
   notes styled as sticky paper; --note-paper carries the theme switch. */

.three-horizons-figure {
  margin: 0.5rem 0 1rem;
}
.three-horizons-figure svg {
  display: block;
  width: 100%;
  height: 110px;
}
.three-horizons-curve {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.85;
}
.three-horizons-curve--1 { stroke: var(--brand-velvet-ink); }
.three-horizons-curve--2 { stroke: var(--brand-monarch-ink); }
.three-horizons-curve--3 { stroke: var(--brand-olive); }
.three-horizons-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.sticky-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
/* A four-zone framework whose two rows carry meaning (SWOT: internal above
   external), so it wraps at two columns rather than running out in one row.
   The cells stretch to their row instead of shrinking to their notes: a matrix
   whose quadrants are different sizes stops reading as a matrix. */
.sticky-board--quadrants {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
/* With the cell stretched, the note list takes the slack so the composer stays
   on the bottom edge rather than floating mid-card. */
.sticky-board--quadrants .board-zone {
  display: flex;
  flex-direction: column;
}
.sticky-board--quadrants .board-zone__notes {
  flex: 1;
}
.swot-axes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}
.board-zone {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top-width: 4px;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.board-zone--1 { border-top-color: var(--brand-velvet-ink); }
.board-zone--2 { border-top-color: var(--brand-monarch-ink); }
.board-zone--3 { border-top-color: var(--brand-olive); }
.board-zone--4 { border-top-color: var(--brand-cornflower-ink); }
.board-zone__title {
  margin: 0;
  font-size: 1rem;
}
.board-zone__hint {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}
.board-zone__notes {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 3rem;
}
.board-note {
  background: var(--note-paper);
  border: 1px solid var(--note-paper-edge);
  border-radius: 2px;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 2px 4px var(--shadow-medium);
  rotate: -0.5deg;
}
.board-note:nth-child(2n) {
  rotate: 0.6deg;
}
.sticky-board:not(.sticky-board--closed) .board-note {
  cursor: grab;
}
.board-note--editing,
.sortable-ghost.board-note {
  rotate: none;
}
.sortable-ghost.board-note {
  opacity: 0.5;
  border-style: dashed;
}
.board-note__text {
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}
.board-note__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}
.board-note__actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.5rem;
}
.board-note--editing textarea,
.board-note--editing select {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.board-note__zone-label {
  font-size: 0.8rem;
}
.board-zone__add textarea {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
/* The name a guest takes part under, folded under the session header with the
   rename form inside; the summary reads as one line of meta text. */
.guest-identity {
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.guest-identity summary {
  cursor: pointer;
}

.guest-identity__change {
  margin-left: 0.4rem;
  color: var(--pico-primary);
  text-decoration: underline;
}

.guest-identity__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.guest-identity__form input {
  width: auto;
  flex: 1 1 12rem;
  margin: 0;
}

.guest-identity__form button {
  width: auto;
  margin: 0;
}

@media (max-width: 900px) {
  .sticky-board {
    grid-template-columns: 1fr;
  }
}

/* ---------- Idea clustering board ---------- */
/* Dynamic columns (Unclustered + one per cluster) that ideas are dragged
   between; rendered by idea-cluster-board.js. */
.cluster-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
  margin: 0 0 1rem;
}
.cluster-new {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  flex: 1 1 24rem;
  margin: 0;
}
/* Wide enough to type a cluster name before the row wraps. */
.cluster-new input {
  flex-basis: 16rem;
}
.idea-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
.board-column {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: 4px solid var(--brand-velvet);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.board-column[data-unclustered] {
  border-top-color: var(--border-soft);
}
.board-column__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.board-column__title {
  margin: 0;
  font-size: 1rem;
}
.board-column__actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.4rem;
}
.board-column__ideas {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 3rem;
}
.board-idea {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--brand-velvet);
  border-radius: var(--pico-border-radius);
  padding: 0.5rem 0.6rem;
}
.idea-board:not(.idea-board--closed) .board-idea {
  cursor: grab;
}
.sortable-ghost.board-idea {
  opacity: 0.5;
  border-style: dashed;
}
.board-idea__text {
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}
.board-idea__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}
.board-idea__votes {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .idea-board {
    grid-template-columns: 1fr;
  }
}

/* ---------- Whiteboard ---------- */
/* Free-placement sticky notes on a dot-grid canvas; positions are percentages
   of the canvas, set per note by whiteboard.js. */

/* The template library: a grid of the canvases a new board can be built on. */
.whiteboard-template__image {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.whiteboard__add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.whiteboard__add textarea {
  /* A compact one-line composer; wraps the swatches and button onto their own
     row once the viewport gets too narrow for all three. */
  flex: 0 1 24rem;
  min-width: 0;
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  resize: none;
}
.whiteboard__add button {
  flex: 0 0 auto;
}
.whiteboard__colors {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
}
.whiteboard-color {
  position: relative;
  display: block;
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  cursor: pointer;
}
.whiteboard-color input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.whiteboard-color:has(input:checked) {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.whiteboard-color:has(input:focus-visible) {
  outline: 2px solid var(--pico-primary);
  outline-offset: 1px;
}
.whiteboard-color--yellow { background: var(--note-yellow); border-color: var(--note-yellow-edge); }
.whiteboard-color--pink { background: var(--note-pink); border-color: var(--note-pink-edge); }
.whiteboard-color--blue { background: var(--note-blue); border-color: var(--note-blue-edge); }
.whiteboard-color--green { background: var(--note-green); border-color: var(--note-green-edge); }

.whiteboard__canvas {
  position: relative;
  /* Keeps the toolbar and a lifted note stacking inside the board, below the
     sticky phone navigation bar. */
  isolation: isolate;
  height: var(--canvas-height, 65vh);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  /* The dot grid lives on the viewport; whiteboard.js moves and scales it in
     lockstep with the pan/zoom, so the board reads as unbounded. */
  background-color: var(--surface);
  background-image: radial-gradient(var(--border-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  /* `clip`, not `hidden`: both clip the board, but `hidden` leaves a scroll
     container the browser is free to scroll when something inside it takes
     focus — which moves the whole board under the pointer. `clip` cannot
     scroll, so pan and zoom stay the only things that move it. */
  overflow: clip;
  margin-bottom: 1.5rem;
  touch-action: none;
  cursor: grab;
  /* No text selection or touch callout — a long-press lifts a note instead. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.whiteboard__canvas.is-panning {
  cursor: grabbing;
}
/* A size-less anchor for the notes; the view transform lives here and note
   coordinates are logical board units relative to its origin. */
.whiteboard__surface {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.whiteboard-note {
  position: absolute;
  width: 180px;
  transform: translate(-50%, -50%);
  padding: 0.55rem 0.65rem;
  border-radius: 2px;
  border: 1px solid;
  box-shadow: 0 2px 4px var(--shadow-medium);
  touch-action: none;
  /* An editable note carries role="button"; Pico rescopes --pico-color to a light
     inverse inside it, and its bare-element rule (p { color: var(--pico-color) })
     re-resolves that on the note's <p> children — so repin the custom property
     itself, not just the note's own color, or the text goes near-white on pastel. */
  --pico-color: var(--ink);
  color: var(--ink);
  /* left/top deliberately have no transition, so a dragged note follows the
     pointer instantly; only the lift pop and shadow animate. */
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
/* Pico rescopes --pico-color again on a [role=button]'s hover/active/focus, at a
   specificity the pin above cannot reach; match it here or the note's text goes
   white the moment the pointer touches it. */
.whiteboard-note:is(:hover, :active, :focus, :focus-within) {
  --pico-color: var(--ink);
  color: var(--ink);
}
.whiteboard:not(.whiteboard--closed) .whiteboard-note {
  cursor: grab;
}
.whiteboard-note--dragging {
  cursor: grabbing;
  z-index: 10;
  box-shadow: 0 6px 14px var(--shadow-medium);
  /* Pressing a card focuses it (it is keyboard-focusable); the focus ring is
     for keyboard travel, not for a card in flight under the pointer. */
  outline: none;
}
/* The touch "lift": pressing and holding a note pops it up so it is visibly
   picked up before the finger starts moving it. */
.whiteboard-note--lifted {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 10px 22px var(--shadow-strong);
}
.whiteboard-touch-hint {
  display: none;
}
.whiteboard-note--editing {
  z-index: 10;
  /* Wide enough for the two labeled buttons side by side. Content that does
     not fit still wraps rather than overflowing — an overflowing card scrolls
     itself when a control inside it takes focus, which reads as the card
     jumping away from the pointer. */
  width: 300px;
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
}
.whiteboard-note--editing textarea {
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  border-radius: 4px;
  resize: none;
}
/* Pico already marks the focused field with its own border and shadow; the
   global focus ring on top reads as a heavy double border inside the small
   card. */
.whiteboard-note--editing textarea:focus-visible {
  outline: none;
}
/* The card's properties share one row — swatches on the left, delete opposite
   them, clear of the actions it must not be mistaken for. */
.whiteboard-note__editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.whiteboard-note__editor-row .link-button {
  padding: 0.1rem 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
}
/* Save and cancel split the card's width as an even pair that cannot wrap into
   a ragged stack when a translation runs long. */
.whiteboard-note--editing .board-note__actions {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
}
.whiteboard-note--editing .board-note__actions button {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
/* The open editor is not a link source: the drag handle would sit over the card's
   corner competing with the controls, and you cannot aim a connection at another
   note while typing into this one. */
.whiteboard-note--editing .whiteboard-note__link {
  display: none;
}
.whiteboard-note--yellow { background: var(--note-yellow); border-color: var(--note-yellow-edge); }
.whiteboard-note--pink { background: var(--note-pink); border-color: var(--note-pink-edge); }
.whiteboard-note--blue { background: var(--note-blue); border-color: var(--note-blue-edge); }
.whiteboard-note--green { background: var(--note-green); border-color: var(--note-green-edge); }
.whiteboard-note__text {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: break-word;
  hyphens: auto;
}
.whiteboard-note__meta {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
}
.whiteboard-note__delete {
  position: absolute;
  top: 0.1rem;
  right: 0.3rem;
  line-height: 1;
  opacity: 0;
  /* Invisible must also mean unclickable, or the hidden × swallows clicks
     meant to open the note's editor. */
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.whiteboard-note:hover .whiteboard-note__delete,
.whiteboard-note:focus-within .whiteboard-note__delete {
  opacity: 1;
  pointer-events: auto;
}
/* The keep-as-idea star mirrors the × in the opposite corner: revealed on
   hover until the note is kept, then always shown as the link to its idea. */
.whiteboard-note__keep {
  position: absolute;
  top: 0.1rem;
  left: 0.3rem;
  line-height: 1;
  text-decoration: none;
}
button.whiteboard-note__keep {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.whiteboard-note:hover button.whiteboard-note__keep,
.whiteboard-note:focus-within button.whiteboard-note__keep {
  opacity: 1;
  pointer-events: auto;
}
/* Connections: an SVG layer under the notes (which live in their own layer so
   the lines paint beneath them). The layer is empty area to the pointer — only
   the fat transparent hit path over each line is clickable — so panning the
   board still works everywhere between lines. */
.whiteboard__links {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.whiteboard__notes {
  position: absolute;
  top: 0;
  left: 0;
}
/* Uploaded images live in their own layer beneath the lines and notes. A
   locked image is click-through — only its unlock badge stays interactive —
   so it reads as part of the background: notes sit on top and the board pans
   right over it. */
.whiteboard__images {
  position: absolute;
  top: 0;
  left: 0;
}
.whiteboard-image {
  position: absolute;
  transform: translate(-50%, -50%);
  touch-action: none;
  border-radius: 2px;
  box-shadow: 0 2px 6px var(--shadow-medium);
}
.whiteboard-image img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  user-select: none;
  -webkit-user-drag: none;
}
.whiteboard--images:not(.whiteboard--closed)
  .whiteboard-image:not(.whiteboard-image--locked) {
  cursor: grab;
}
.whiteboard-image--dragging {
  cursor: grabbing;
  z-index: 9;
}
.whiteboard-image--lifted {
  transform: translate(-50%, -50%) scale(1.02);
  box-shadow: 0 10px 22px var(--shadow-strong);
}
.whiteboard-image--locked {
  pointer-events: none;
  box-shadow: none;
}
.whiteboard-image__lock {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  width: auto;
  margin: 0;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  line-height: 1.2;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
/* The unlock badge is the locked image's one interactive spot; keep it
   faintly visible so a locked background stays escapable. */
.whiteboard-image--locked .whiteboard-image__lock {
  opacity: 0.55;
  pointer-events: auto;
}
.whiteboard-image--locked .whiteboard-image__lock:hover,
.whiteboard-image--locked .whiteboard-image__lock:focus-visible,
.whiteboard-image:hover .whiteboard-image__lock,
.whiteboard-image:focus-within .whiteboard-image__lock {
  opacity: 1;
  pointer-events: auto;
}
.whiteboard-image__delete {
  position: absolute;
  top: 0.1rem;
  right: 0.3rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.whiteboard-image:hover .whiteboard-image__delete,
.whiteboard-image:focus-within .whiteboard-image__delete {
  opacity: 1;
  pointer-events: auto;
}
.whiteboard-image__resize {
  position: absolute;
  right: -0.5rem;
  bottom: -0.5rem;
  width: 1rem;
  height: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  box-shadow: 0 1px 3px var(--shadow-medium);
  cursor: nwse-resize;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.whiteboard-image:hover .whiteboard-image__resize,
.whiteboard-image:focus-within .whiteboard-image__resize {
  opacity: 1;
  pointer-events: auto;
}
/* The upload control is a file input dressed as a button inside the add form;
   the label carries the button look, the input stays visually hidden. */
.whiteboard__image-upload {
  position: relative;
}
.whiteboard__link {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.45;
  pointer-events: none;
}
.whiteboard__link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}
.whiteboard__link-hit:hover + .whiteboard__link {
  stroke: var(--brand-monarch);
  opacity: 1;
}
.whiteboard__link-temp {
  fill: none;
  stroke: var(--brand-monarch);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 7 6;
  opacity: 0.8;
  pointer-events: none;
}
/* The small handle you drag from one note onto another to link them. */
.whiteboard-note__link {
  position: absolute;
  right: -0.5rem;
  bottom: -0.5rem;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand-monarch);
  cursor: crosshair;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  touch-action: none;
}
.whiteboard-note:hover .whiteboard-note__link,
.whiteboard-note:focus-within .whiteboard-note__link {
  opacity: 1;
  pointer-events: auto;
}
/* The note the cursor is over while a link is being drawn. */
.whiteboard-note--link-target {
  outline: 2px solid var(--brand-monarch);
  outline-offset: 2px;
}
@media (hover: none) {
  .whiteboard-touch-hint {
    display: inline;
  }
  /* Fingers can't hit the tiny × on a note's face — on touch the note
     itself opens the editor, which carries the delete. */
  .whiteboard-note__delete {
    display: none;
  }
  /* No hover on touch: keep an unlocked image's controls visible outright. */
  .whiteboard-image:not(.whiteboard-image--locked) .whiteboard-image__lock,
  .whiteboard-image__delete,
  .whiteboard-image__resize {
    opacity: 1;
    pointer-events: auto;
  }
  /* No hover on touch: the keep-as-idea control stays visible, since tapping a
     note opens its editor instead of revealing the corner controls. */
  button.whiteboard-note__keep {
    opacity: 0.9;
    pointer-events: auto;
  }
  /* No hover on touch — keep the handle reachable so a finger can drag a link. */
  .whiteboard-note__link {
    opacity: 0.9;
    pointer-events: auto;
  }
  /* The board's controls are compact for a mouse; on touch they are the only
     way to zoom, color, connect and add, so grow them toward a finger-sized
     target. Kept after the base rules so this wins the desktop-first cascade. */
  .whiteboard__toolbar .whiteboard__tool {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.95rem;
  }
  .whiteboard-note__link {
    width: 1.6rem;
    height: 1.6rem;
    right: -0.7rem;
    bottom: -0.7rem;
  }
  .whiteboard-color {
    flex-basis: 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
  }
  /* The compact action-row scale is mouse-sized; grow those buttons toward a
     finger-sized target. Keep this list in step with the compact rule's list
     near the top of the file. The topbar's .user-actions, the public header and
     footer and the flash stay compact — growing them wraps the mobile header. */
  :where(.page-header, .entry-header, .row-actions, .note-actions,
         .card-header-row, .section-heading, .board-zone__add, .whiteboard__add,
         .board-note__actions, .stage-bar, .stage-qr, .news-card__actions, .cneeds-add,
         .cneeds-need__actions, .hmw-add, .hat-add, .bw-add, .opinion-add__actions,
         .opinion-moderation__item, .cookie-banner__actions,
         .smx-signal__actions, .smx-quadrant__head, .kx-bulk-group, .kx-row-actions,
         .sv-manage__row, .sv-results__decide, .backcasting-list,
         .workshop-objective__edit, .workshop-objective__add, .workshop-feedback__head,
         .workshop-group__edit, .workshop-group__add, .workshop-group__assign,
         .comment-footer, .comment-thread__actions, .comment-form__actions, .draft-restore,
         .related-links__disclosure)
    :is(button, [role="button"]):not(.favorite-toggle, .qr-button, .stage-qr__code, .link-button,
                                     .collab-chip) {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
  }
  /* The × buttons (unlink, remove) are a glyph on a mouse; a finger needs the
     44px box behind it. */
  .link-button,
  .board-note__actions .link-button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  /* The row checkbox stays small; its cell grows so the tap lands somewhere. */
  .col-select {
    min-width: 2.75rem;
    padding-block: 0.6rem;
  }
}

/* News feed — a responsive grid of article cards fed by the subscribed RSS
   feeds, with the item's feed-supplied image as a full-bleed header. The
   summary shows three clamped lines; on hover-capable devices hovering (or
   focusing) a card unclamps them in place, so the full preview reads where
   the teaser sits and never covers the card's actions. */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
}
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.5rem;
  transition: box-shadow 0.15s ease;
}
.news-card:hover,
.news-card:focus-within {
  box-shadow: 0 4px 14px var(--shadow-weak);
}
.news-card__image {
  /* Full-bleed across the card: outgrow the 1rem padding on each side, and
     lift Pico's global img max-width cap that would clamp it back. */
  width: calc(100% + 2rem);
  max-width: calc(100% + 2rem);
  margin: -1rem -1rem 0;
  height: 9rem;
  object-fit: cover;
  border-radius: 0.5rem 0.5rem 0 0;
}
.news-card__title {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
}
.news-card__title a {
  color: inherit;
  text-decoration: none;
}
.news-card__title a:hover {
  color: var(--pico-primary);
}
.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}
.news-card__meta .tag {
  margin: 0;
}
.news-card__actions {
  margin-top: auto;
  display: flex;
}
.news-card__actions form {
  margin: 0;
}
.news-card__summary {
  font-size: 0.875rem;
  line-height: 1.5;
}
.news-card__summary p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
/* The preview expands in place: unclamping grows the card downward, pushing
   its own actions along instead of overlaying them or the cards beneath. */
@media (hover: hover) {
  .news-card:hover .news-card__summary p,
  .news-card:focus-within .news-card__summary p {
    -webkit-line-clamp: unset;
  }
}
.news-feed-error {
  color: var(--badge-negative-fg);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Let a long feed URL wrap instead of forcing the Feed column (and the whole
   table) wider than the card. */
.news-feed-url {
  overflow-wrap: anywhere;
}

/* --- Deep research agents ------------------------------------------------- */


/* The agent's configuration summary: a compact two-column key/value grid that
   stacks to one column on narrow screens so a value (e.g. a profile pill) is
   never crushed into a cramped cell. */
.agent-config__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  align-items: baseline;
  margin: 0;
}
.agent-config__grid dt { font-weight: 600; color: var(--ink-muted); }
.agent-config__grid dd { margin: 0; min-width: 0; }

@media (max-width: 480px) {
  .agent-config__grid {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .agent-config__grid dt { margin-top: 0.6rem; }
}

/* Orientation blurbs explaining a page's sections to the user. */
.run-intro,
.agent-intro {
  max-width: 70ch;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* Collapsible research map / log on the run page, so the deep detail folds away
   and the page stays compact by default. */
.research-details > summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.research-details__title {
  font-size: 1.1rem;
  font-weight: 600;
}
.research-details[open] > summary {
  margin-bottom: 0.5rem;
}

/* A soft "running" pulse next to the live research map. */
.research-map__live {
  color: var(--badge-warning-fg);
  font-weight: 600;
}

/* Notice above a report a live run is still deepening — so a shown interim
   report is not mistaken for a finished-but-stuck one. */
.report-interim {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--badge-warning-fg);
  background: var(--badge-warning-bg);
  color: var(--badge-warning-fg);
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
}

/* Color each trace row's left border by the kind of step it records. */
.research-step--search,
.research-step--news { border-left-color: var(--brand-cornflower-ink); }
.research-step--fetch,
.research-step--browse,
.research-step--links { border-left-color: var(--brand-monarch-ink); }
.research-step--document { border-left-color: var(--brand-monarch-ink); }
.research-step--academic { border-left-color: var(--brand-velvet-ink); }
.research-step--signal { border-left-color: var(--brand-moss-ink); }
.research-step--review { border-left-color: var(--brand-cornflower-ink); }
.research-step--verify { border-left-color: var(--brand-velvet-ink); }
.research-step--thought,
.research-step--plan { border-left-color: var(--border-soft); }
.research-step--source,
.research-step--sources { border-left-color: var(--brand-moss-ink); }
.research-step--workspace { border-left-color: var(--brand-cornflower-ink); }
.research-step--docs { border-left-color: var(--brand-monarch-ink); }
.research-step--propose { border-left-color: var(--brand-moss-ink); }
.research-step--answer { border-left-color: var(--border-soft); }

/* Evidence & assessment card on an agent-drafted signal. */
.research-origin {
  display: flex;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--brand-velvet-ink);
  background: var(--surface-muted);
  border-radius: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.research-origin__icon { flex: none; }
.research-origin__text strong { color: var(--ink); }
.research-origin__links {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
}
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.evidence-item {
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--border-soft);
  background: var(--surface-muted);
  border-radius: 0.4rem;
}
.evidence-item--corroborates { border-left-color: var(--brand-moss-ink); }
.evidence-item--contradicts { border-left-color: var(--badge-negative-fg); }
.evidence-item--context { border-left-color: var(--brand-cornflower-ink); }
.evidence-item__note { margin-left: 0.4rem; }
.evidence-item__quote {
  margin: 0.4rem 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border-soft);
  color: var(--ink-muted);
  font-style: italic;
}
.evidence-item__source {
  font-size: 0.8rem;
  word-break: break-all;
}

/* Real-Time Delphi — one card per statement; the group feedback (median, spread,
   histogram, reasons) only appears once the state carries it, i.e. after the
   viewer has rated. */
.delphi-manage {
  margin-block: 1rem;
}
.delphi-manage__add {
  margin-bottom: 1rem;
}
.delphi-manage__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.delphi-manage__list > li {
  display: flex;
  align-items: start;
  gap: 0.5rem;
}
.delphi-manage__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.4rem;
  flex: 1;
  margin: 0;
}
.delphi-manage__row > * {
  margin: 0;
}
.delphi-manage__delete {
  padding-inline: 0.7rem;
}
.delphi-board__statements {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.delphi-statement {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1rem;
}
.delphi-statement.is-answered {
  border-color: var(--pico-primary-border, var(--pico-primary));
}
.delphi-statement__text {
  margin: 0;
  font-size: 1.05rem;
}
/* Each statement splits into two panels — the viewer's own rating form and the
   group's answers — so the divide between input and feedback is unmistakable.
   The group panel sits on a tinted surface to read as a distinct block. */
.delphi-panel {
  margin: 0;
}
.delphi-panel__title {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.delphi-panel--group {
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
}
.delphi-board--closed .delphi-panel__input {
  display: none;
}
.delphi-panel__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.delphi-panel__choice {
  width: auto;
  min-width: 2.6rem;
  padding: 0.35rem 0.6rem;
  margin: 0;
  background: transparent;
  color: var(--pico-contrast);
  border: 1px solid var(--pico-muted-border-color);
}
.delphi-panel__choice.is-selected {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border-color: var(--pico-primary);
}
.delphi-panel__slider {
  width: 100%;
}
.delphi-panel__slider-out {
  font-variant-numeric: tabular-nums;
  font-weight: bold;
}
.delphi-panel__poles {
  display: flex;
  justify-content: space-between;
  margin: 0.25rem 0;
  font-size: 0.85rem;
}
.delphi-panel__reason {
  margin: 0.5rem 0;
}
.delphi-panel__deviates {
  margin: 0.5rem 0;
  color: var(--pico-del-color);
  font-size: 0.9rem;
}
.delphi-panel__submit {
  width: auto;
}
.delphi-panel__awaiting {
  margin: 0.5rem 0 0;
  font-style: italic;
}
.delphi-panel__stats {
  margin: 0 0 0.5rem;
}
.delphi-panel__badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  font-size: 0.75rem;
}
.delphi-panel__hist {
  display: flex;
  align-items: end;
  gap: 0.2rem;
  height: 3.75rem;
  margin-bottom: 0.5rem;
}
.delphi-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 100%;
}
/* The fill's height % resolves against this track, which flexes to fill the
   space left above the fixed label row — so a full-height bar can't spill over
   the top of the histogram into the stats line above it. */
.delphi-bar__track {
  display: flex;
  align-items: end;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.delphi-bar__fill {
  width: 60%;
  max-width: 2.75rem;
  min-height: 3px;
  background: var(--pico-primary-focus);
  border: 1px solid var(--pico-primary);
  border-radius: 3px 3px 0 0;
}
.delphi-bar__label {
  height: 0.9rem;
  line-height: 0.9rem;
  font-size: 0.7rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
}
.delphi-panel__reasons > h5 {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.95rem;
}
.delphi-panel__reasons ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.delphi-reason-item {
  border-left: 3px solid var(--pico-muted-border-color);
  padding-left: 0.6rem;
}
.delphi-reason-item.is-outlier {
  border-left-color: var(--pico-del-color);
}
.delphi-reason-item__value {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.delphi-reason-item > p {
  margin: 0.15rem 0 0;
}

/* Signal Voting — a ballot of real workspace signals. The voting board is one
   row per signal with whichever control the session's mode calls for (a pair of
   arrows or a 0-10 row of choices), rendered by signal-voting.js. The tally,
   the ranking and its review-status decisions are a screen of their own. Classes
   are prefixed sv-. */
.sv-selection {
  margin-block: 1rem;
}
.sv-manage {
  margin-block: 1rem;
}
.sv-manage__add {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-block: 0.75rem;
}
.sv-manage__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sv-manage__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.35rem;
  border-top: 1px solid var(--border-soft);
}
.sv-manage__remove {
  color: var(--ink);
}

.sv-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.sv-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
}
.sv-item.is-voted {
  border-color: var(--pico-primary);
}
@media (max-width: 640px) {
  .sv-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}
/* The 0-10 scale is a wide control; below this floor the title would wrap to a
   letter per line, so the row wraps and gives the control its own line. */
.sv-item__body {
  flex: 1;
  min-width: 12rem;
}
.sv-item__title {
  font-weight: bold;
}
.sv-item__meta {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
}

/* Pico presents `[role=group]` as a joined input group: full width, a bottom
   margin and squared inner corners. These are button clusters sitting beside
   the signal's title, so full width would squeeze that text to nothing. */
.sv-arrows,
.sv-choices {
  width: auto;
  margin-bottom: 0;
}
/* Two class selectors, to outweigh Pico's `[role=group] > :not(:first-child)`. */
.sv-arrows > .sv-arrow,
.sv-choices > .sv-choice {
  flex: none;
  border-radius: var(--pico-border-radius);
}
.sv-arrows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (max-width: 640px) {
  .sv-arrows {
    flex-direction: row;
    justify-content: flex-end;
  }
}
.sv-arrow {
  width: 2.5rem;
  padding: 0.15rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  color: var(--ink);
  line-height: 1.1;
}
.sv-arrow.is-selected {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
}

.sv-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
@media (max-width: 640px) {
  .sv-rating {
    align-items: stretch;
  }
}
.sv-rating__label {
  font-size: 0.8rem;
}
.sv-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}
.sv-choice {
  min-width: 2rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.sv-choice.is-selected {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  font-weight: bold;
}
.sv-board--closed .sv-arrows,
.sv-board--closed .sv-rating {
  opacity: 0.6;
}
.sv-empty {
  margin-block: 1rem;
}

.sv-results {
  margin-block: 1rem;
}
.sv-results__rank {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.sv-results__tally {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sv-results__personas {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}
.sv-results__decide {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Print — shared reports are an explicit print target. Strip interactive chrome,
   force a light surface so a dark-theme reader does not print an ink-heavy page,
   and keep cards from splitting across pages. */
@media print {
  .skip-link,
  .public-nav,
  .public-footer,
  .theme-toggle,
  .weather,
  .cmd-palette,
  .notice-stack,
  .flash-messages,
  .row-actions,
  .filter-bar,
  .bulk-bar,
  .comment-form,
  .related-links__add,
  .topbar,
  .module-nav,
  .breadcrumb,
  .workshop-print__actions,
  .sidebar {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  /* Outranks the generated stylesheet's :root[data-theme="…"] scheme blocks,
     which load after this sheet at equal specificity. */
  html:root[data-theme] {
    --surface: #ffffff;
    --surface-muted: #ffffff;
    --ink: #111111;
    --ink-muted: #444444;
  }
  body {
    background: #ffffff;
    color: #111111;
  }
  .card {
    box-shadow: none;
    border: 1px solid #dddddd;
    break-inside: avoid;
  }
  a {
    color: #111111;
    text-decoration: underline;
  }
}

/* ---------- Scenario matrix (2x2) ---------- */
/* A square plot with crossed axes on which scenario-matrix.js places draggable
   signal chips (left/top set per chip as percentages), plus a 2x2 grid of
   quadrant cards collecting up-voted scenario names. Classes are prefixed smx-
   to stay clear of the report matrix-* figure. */
.scenario-matrix__add {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.scenario-matrix__plot-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  /* The plot is a square as wide as the wrap (minus the slim y-title column),
     so cap the wrap near the viewport height to keep the whole square in view
     while letting it use the full content width on smaller screens. */
  max-width: min(64rem, 90vh);
  margin: 0 0 1.5rem;
}
.smx-axis-title {
  margin: 0;
  font-weight: 600;
  text-align: center;
}
.smx-axis-title--y {
  grid-column: 1;
  grid-row: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.smx-axis-title--x {
  grid-column: 2;
  grid-row: 2;
}
.scenario-matrix__plot {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  /* The signal layer captures the pointer for dragging; stop the browser from
     panning/zooming the page under a drag on a touch screen. */
  touch-action: none;
  /* Its own stacking context, so the axes can sit beneath the pole labels. */
  isolation: isolate;
}
.smx-axis {
  position: absolute;
  z-index: -1;
  background: var(--border-soft);
}
.smx-axis--x {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
}
.smx-axis--y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
}
.smx-pole {
  position: absolute;
  max-width: 46%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: center;
  /* Labels sit under the draggable chips so they never swallow a drag. */
  pointer-events: none;
}
/* The vertical axis runs behind the top and bottom poles, which cover it with
   the plot's own surface; the left and right poles sit just above the
   horizontal axis. Neither reads as struck through. */
.smx-pole--top,
.smx-pole--bottom {
  left: 50%;
  padding: 0 0.4rem;
  background: var(--surface);
  transform: translateX(-50%);
}
.smx-pole--top {
  top: 0.4rem;
}
.smx-pole--bottom {
  bottom: 0.4rem;
}
.smx-pole--left {
  left: 0.4rem;
  top: 50%;
  transform: translateY(-120%);
}
.smx-pole--right {
  right: 0.4rem;
  top: 50%;
  transform: translateY(-120%);
  text-align: right;
}
.scenario-matrix__signals {
  position: absolute;
  inset: 0;
}
.smx-signal {
  position: absolute;
  transform: translate(-50%, -50%);
  /* A definite width keeps the chip's wrapping independent of its x position:
     with width:auto, shrink-to-fit clamps against the plot's right edge, so a
     chip dragged right collapses into a one-word-wide, very tall column. */
  width: max-content;
  max-width: 42%;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.78rem;
  background: var(--note-paper);
  border: 1px solid var(--note-paper-edge);
  border-radius: 4px;
  box-shadow: 0 2px 4px var(--shadow-medium);
}
.scenario-matrix:not(.scenario-matrix--closed) .smx-signal {
  cursor: grab;
}
.smx-signal--dragging {
  z-index: 5;
  opacity: 0.9;
  cursor: grabbing;
}
.smx-signal__text {
  overflow-wrap: anywhere;
}
.smx-signal__author {
  font-size: 0.7rem;
  color: var(--ink-muted);
}
.smx-signal__actions {
  display: none;
  gap: 0.3rem;
  margin-top: 0.1rem;
}
.smx-signal:hover .smx-signal__actions,
.smx-signal:focus-within .smx-signal__actions {
  display: flex;
}
.smx-signal--editing {
  z-index: 6;
  width: 14rem;
  max-width: none;
  gap: 0.4rem;
}
.smx-signal--editing textarea {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.3;
  /* Drop Pico's :user-valid check icon — visual noise on a tiny inline editor. */
  background-image: none;
}
.smx-signal--editing .smx-signal__actions {
  display: flex;
  margin-top: 0;
}
/* Cards taken over from the workspace wait here, outside the four quadrants,
   until someone drags them onto the plot. A lifted card is positioned against
   the card row, so it can follow the pointer out over the plot. */
.smx-tray {
  max-width: min(64rem, 90vh);
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--border-soft);
  border-radius: 12px;
}
.smx-tray__title {
  margin: 0;
  font-weight: 600;
}
.smx-tray__hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.smx-tray__cards {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.smx-signal--tray {
  position: relative;
  transform: none;
  max-width: 16rem;
}
.scenario-matrix:not(.scenario-matrix--closed) .smx-signal--tray {
  touch-action: none;
}
/* In the flowing tray a chip keeps room for its actions, so hovering one does
   not grow the row and shift the plot below. */
.smx-signal--tray .smx-signal__actions {
  display: flex;
  visibility: hidden;
}
.smx-signal--tray:hover .smx-signal__actions,
.smx-signal--tray:focus-within .smx-signal__actions,
.smx-signal--tray.smx-signal--editing .smx-signal__actions {
  visibility: visible;
}
.smx-signal--lifted {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
}
.scenario-matrix__quadrants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.smx-quadrant {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.smx-quadrant__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.4rem;
}
.smx-quadrant__head form {
  margin: 0;
}
.smx-import {
  margin: 0 0 1rem;
}
.smx-import > summary {
  font-weight: 600;
}
.smx-import__pickers {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}
.smx-signal__open {
  margin-inline-start: 0.3rem;
  text-decoration: none;
}
.smx-quadrant__poles {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.smx-quadrant__names {
  list-style: none;
  margin: 0.4rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.smx-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.smx-name__text {
  overflow-wrap: anywhere;
}
.smx-name--leading .smx-name__text {
  font-weight: 700;
}
.smx-name__author {
  margin-left: auto;
  font-size: 0.75rem;
}
/* The `button` prefix outranks Pico's `button[type=submit] { width: 100% }`. */
button.smx-name__vote {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}
.smx-name__vote:not(:disabled) {
  cursor: pointer;
}
.smx-name__vote[aria-pressed="true"] {
  color: var(--brand-olive-ink);
  border-color: var(--brand-olive);
}
.smx-name__vote:disabled {
  opacity: 0.7;
}
.smx-name__votes {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.smx-name__delete {
  color: var(--ink-muted);
}
.smx-quadrant__name-add {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}
@media (max-width: 768px) {
  .scenario-matrix__quadrants {
    grid-template-columns: 1fr;
  }
}

/* ---------- Polak Game ---------- */
/* A square board with crossed axes on which polak-game.js places one dot per
   participant (left/top in percent), the previous round's dots as faint traces
   with arrows to where each person moved, and a count per quadrant. */
.polak-round {
  margin: 0 0 1rem;
}
.polak-status {
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.polak-plot-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.35rem;
  align-items: center;
  max-width: min(48rem, 85vh);
  margin: 0 0 1rem;
}
.polak-axis-title {
  margin: 0;
  font-weight: 600;
  text-align: center;
}
.polak-axis-title--y {
  grid-column: 1;
  grid-row: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.polak-axis-title--x {
  grid-column: 2;
  grid-row: 4;
}
.polak-plot {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  /* The board captures the pointer while a dot is dragged; stop the browser from
     panning the page under a drag on a touch screen. */
  touch-action: none;
}
.polak-game--placing .polak-plot {
  cursor: crosshair;
}
.polak-axis {
  position: absolute;
  background: var(--border-soft);
}
.polak-axis--x {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
}
.polak-axis--y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
}
.polak-pole,
.polak-quadrant {
  font-size: 0.78rem;
  color: var(--ink-muted);
  /* Labels sit under the dots and never swallow a click on the board. */
  pointer-events: none;
}
.polak-pole {
  margin: 0;
  font-weight: 600;
  text-align: center;
}
/* The influence poles sit outside the board, above and below it, so neither the
   vertical axis nor the quadrant labels in the corners run into them. */
.polak-pole--top {
  grid-column: 2;
  grid-row: 1;
}
.polak-pole--bottom {
  grid-column: 2;
  grid-row: 3;
}
.polak-pole--left,
.polak-pole--right,
.polak-quadrant {
  position: absolute;
}
.polak-pole--left {
  left: 0.4rem;
  top: 50%;
  transform: translateY(-120%);
}
.polak-pole--right {
  right: 0.4rem;
  top: 50%;
  transform: translateY(-120%);
}
.polak-quadrant {
  max-width: 40%;
}
.polak-quadrant strong {
  color: var(--ink);
}
.polak-quadrant--tl {
  top: 0.6rem;
  left: 0.6rem;
}
.polak-quadrant--tr {
  top: 0.6rem;
  right: 0.6rem;
  text-align: right;
}
.polak-quadrant--bl {
  bottom: 0.6rem;
  left: 0.6rem;
}
.polak-quadrant--br {
  bottom: 0.6rem;
  right: 0.6rem;
  text-align: right;
}
@media (max-width: 768px) {
  .polak-quadrant {
    font-size: 0.7rem;
  }
}
.polak-moves,
.polak-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.polak-move {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}
.polak-move--mine {
  stroke: var(--ink);
}
.polak-arrowhead {
  fill: var(--ink-muted);
}
.polak-dot {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--action);
  transform: translate(-50%, -50%);
}
.polak-dot--earlier {
  background: transparent;
  border: 2px solid var(--border-soft);
}
.polak-dot--mine {
  width: 1.25rem;
  height: 1.25rem;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}
.polak-dot--earlier.polak-dot--mine {
  box-shadow: none;
  border-color: var(--ink-muted);
}
.polak-game--closed .polak-plot {
  cursor: default;
}
.polak-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}
.polak-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.polak-dot--sample {
  position: static;
  transform: none;
}
/* The mine dot's ring is a 5px box-shadow outside its box; the margin keeps it
   clear of the label and of the row edge. */
.polak-dot--mine.polak-dot--sample {
  margin: 5px;
}

/* ---------- Opinion Map ---------- */
/* One statement card at a time with three equal vote buttons, the last vote's
   tally, the composer, the SVG map of opinion groups beside them (drawn by
   opinion-map.js on the board and by a partial on the results page) and the tally
   bars. Each group's color arrives as --opinion-group from its g0…g5 class; the
   series skips chart-2 and chart-6, which the positive and negative inks of the
   tally bars derive from. The agree and disagree buttons wear the positive and
   negative badge tones, the same pairing as the results page's stance pills. */
.opinion-board {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0 2rem;
  align-items: start;
}
.opinion-board > .opinion-votes,
.opinion-board > .opinion-moderation {
  grid-column: 1 / -1;
}
/* Below this the card's column grows too narrow for three buttons in a row. */
@media (max-width: 1200px) {
  .opinion-board {
    grid-template-columns: minmax(0, 1fr);
  }
}
[data-stage].is-focused .opinion-add,
[data-stage].is-focused .opinion-votes,
[data-stage].is-focused .opinion-moderation {
  display: none;
}
.opinion-progress {
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.opinion-card {
  margin: 0 0 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-weak);
}
@media (max-width: 480px) {
  .opinion-card {
    padding: 1rem;
  }
}
.opinion-card__badge {
  margin: 0 0 0.5rem;
}
.opinion-card__text {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink);
}
@media (max-width: 480px) {
  .opinion-card__text {
    font-size: 1.1rem;
  }
}
.opinion-card__text:focus:not(:focus-visible) {
  outline: none;
}
/* Not Pico's joined [role=group] bar: three separate, equally weighted buttons. */
.opinion-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: auto;
  margin-bottom: 0;
}
/* Two class selectors, to outweigh Pico's `[role=group] > :not(:first-child)`
   and its hover rule on the button's color variables. */
.opinion-card__actions > .opinion-vote {
  flex: 1 1 auto;
  margin: 0;
  padding-inline: 0.6rem;
  border-radius: var(--pico-border-radius);
  white-space: nowrap;
}
.opinion-card__actions > .opinion-vote--agree {
  --pico-background-color: var(--badge-positive-bg);
  --pico-border-color: var(--badge-positive-fg);
  --pico-color: var(--badge-positive-fg);
}
.opinion-card__actions > .opinion-vote--disagree {
  --pico-background-color: var(--badge-negative-bg);
  --pico-border-color: var(--badge-negative-fg);
  --pico-color: var(--badge-negative-fg);
}
.opinion-card__actions > .opinion-vote--unsure {
  --pico-background-color: transparent;
  --pico-border-color: var(--border-soft);
  --pico-color: var(--ink);
}
.opinion-card__actions > .opinion-vote:hover {
  box-shadow: inset 0 0 0 1px var(--pico-border-color);
}
@media (max-width: 480px) {
  .opinion-card__actions {
    flex-direction: column;
  }
  .opinion-card__actions > .opinion-vote {
    flex: none;
  }
}
.opinion-board--busy .opinion-card__actions button {
  cursor: progress;
  opacity: 0.7;
}
.opinion-deck__done,
.opinion-deck__empty {
  margin: 0 0 1rem;
}
.opinion-deck__done > p {
  margin-bottom: 0.5rem;
}
.opinion-last {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface-muted);
  border-radius: var(--pico-border-radius);
}
.opinion-last__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}
.opinion-last__text {
  margin: 0 0 0.5rem;
}
.opinion-add {
  margin: 0 0 1.5rem;
}
.opinion-add > summary {
  font-weight: 600;
}
.opinion-add form {
  margin-top: 0.75rem;
}
.opinion-add textarea {
  margin-bottom: 0.5rem;
}
.opinion-add__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.opinion-map {
  margin: 0 0 1.5rem;
}
.opinion-map__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.opinion-map__figure {
  margin: 0;
}
.opinion-map__svg {
  display: block;
  width: 100%;
  max-width: 28rem;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
/* The axes carry no quadrant meaning — only distance does — so they stay faint. */
.opinion-map__axis {
  stroke: var(--border-soft);
  stroke-width: 0.008;
  stroke-dasharray: 0.03 0.03;
}
.opinion-map__hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
.opinion-dot--g0,
.opinion-map__chip--g0,
.opinion-chip--g0 {
  --opinion-group: var(--chart-1);
}
.opinion-dot--g1,
.opinion-map__chip--g1,
.opinion-chip--g1 {
  --opinion-group: var(--chart-3);
}
.opinion-dot--g2,
.opinion-map__chip--g2,
.opinion-chip--g2 {
  --opinion-group: var(--chart-5);
}
.opinion-dot--g3,
.opinion-map__chip--g3,
.opinion-chip--g3 {
  --opinion-group: var(--chart-7);
}
.opinion-dot--g4,
.opinion-map__chip--g4,
.opinion-chip--g4 {
  --opinion-group: var(--chart-4);
}
.opinion-dot--g5,
.opinion-map__chip--g5,
.opinion-chip--g5 {
  --opinion-group: var(--chart-8);
}
.opinion-dot {
  fill: var(--opinion-group);
  stroke: var(--surface);
  stroke-width: 0.008;
}
.opinion-dot__ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.018;
}
.opinion-map__chip {
  fill: var(--surface);
  stroke: var(--opinion-group);
  stroke-width: 0.025;
}
.opinion-map__letter {
  fill: var(--ink);
  font-size: 0.12px;
  font-weight: 700;
}
.opinion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.opinion-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}
.opinion-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--surface);
  border: 3px solid var(--opinion-group);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}
.opinion-legend__mine {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.opinion-votes,
.opinion-moderation {
  margin: 0 0 1rem;
}
.opinion-votes__list,
.opinion-moderation__list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.opinion-vote-item {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-soft);
  list-style: none;
}
.opinion-vote-item__text {
  margin: 0 0 0.4rem;
}
.opinion-tally {
  display: flex;
  max-width: 24rem;
  height: 0.5rem;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 999px;
}
.opinion-tally__agree {
  background: var(--chart-pos-ink);
}
.opinion-tally__disagree {
  background: var(--chart-neg-ink);
}
.opinion-tally__unsure {
  background: var(--border-soft);
}
.opinion-tally__legend {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.8rem;
}
.opinion-vote-item__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.opinion-choice {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0.2rem 0.7rem;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.4;
}
@media (max-width: 480px) {
  button.opinion-choice {
    min-height: 2.5rem;
    padding: 0.4rem 0.9rem;
  }
  .opinion-votes > summary {
    padding-block: 0.5rem;
  }
}
.opinion-choice.is-selected {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}
.opinion-moderation__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-soft);
  list-style: none;
}
.opinion-moderation__item.is-hidden > span {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.opinion-seed {
  margin: 0 0 1rem;
}
.opinion-closed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.opinion-closed > p {
  margin: 0;
}
.opinion-table__statement {
  width: 45%;
}
.opinion-table__number {
  text-align: end;
  white-space: nowrap;
}
.opinion-results {
  display: grid;
  grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .opinion-results {
    grid-template-columns: minmax(0, 1fr);
  }
}
.opinion-results__about h2 {
  margin-top: 0;
}
.opinion-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
}
.opinion-groups > .card {
  margin: 0;
}
.opinion-group h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
}
.opinion-group h3 {
  font-size: 1rem;
}
.opinion-statement-list {
  padding: 0;
  list-style: none;
}
.opinion-statement-list li {
  margin: 0 0 0.6rem;
  list-style: none;
}
.opinion-stance {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.opinion-stance--agree {
  background: var(--badge-positive-bg);
  color: var(--badge-positive-fg);
}
.opinion-stance--disagree {
  background: var(--badge-negative-bg);
  color: var(--badge-negative-fg);
}
.opinion-divide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.3rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.opinion-divide__group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.opinion-summary__outdated {
  padding: 0.4rem 0.6rem;
  background: var(--badge-warning-bg);
  border-radius: var(--pico-border-radius);
  color: var(--badge-warning-fg);
}

/* ---------- Competency needs table ---------- */
/* One column per target group, each holding the rows competency-needs.js
   renders plus that column's add-form. The table scrolls sideways inside its
   own wrapper rather than widening the page. */
/* A .card like the activity brief below it, so the two headings match; pinned to
   the top of the viewport so the scenario stays readable while the table is
   filled in, which is also why it is padded tighter than a card in flow. */
.cneeds-scenario {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
}
/* A phone's navigation bar holds the top of the viewport. */
@media (max-width: 768px) {
  .cneeds-scenario {
    position: static;
  }
}

/* A reference strip, not a wall: pinned to the viewport it would otherwise sit
   on top of the very cells it is meant to support. */
.cneeds-scenario__body {
  max-height: 9rem;
  overflow-y: auto;
}
.cneeds-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
}
/* Auto layout, so the columns share a wide screen but never fall below a
   readable width — below that the wrapper scrolls instead of the cells
   squeezing to one character per line. `table-layout: fixed` would ignore the
   cell min-width and do exactly that. */
.cneeds-table {
  margin: 0;
}
.cneeds-table th,
.cneeds-table td {
  min-width: 18rem;
  vertical-align: top;
}
.cneeds-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cneeds-need {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
}
.cneeds-need--promoted {
  border-color: var(--brand-olive);
}
/* The fixed sentence frame runs inline with the fragment the participant typed,
   so a row reads as one sentence — the same shape the purpose line already has. */
.cneeds-need__ability {
  grid-column: 1;
  overflow-wrap: anywhere;
}
/* The purpose is the second half of the same sentence, so it keeps the row's
   own size; only the author credit below it is metadata and steps down. */
.cneeds-need__purpose {
  grid-column: 1;
  overflow-wrap: anywhere;
}
.cneeds-need__author {
  grid-column: 1;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.cneeds-need__actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: start;
  gap: 0.25rem;
}
.cneeds-need__promoted {
  color: var(--brand-olive-ink);
}
/* The editor replaces the row's contents, so its inputs claim the full width. */
.cneeds-need--editing {
  grid-template-columns: minmax(0, 1fr);
}
.cneeds-need--editing .cneeds-need__actions {
  grid-column: 1;
  grid-row: auto;
}
.cneeds-need--editing input {
  margin: 0 0 0.35rem;
}
/* The add-form sits in every column and is permanently open, so it is kept to
   the smallest thing that still reads as the sentence the rows follow: each
   frame word labels the field it precedes, on the same line where there is room. */
.cneeds-add {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.6rem;
  border: 1px dashed var(--border-soft);
  border-radius: var(--pico-border-radius);
}
.cneeds-add input {
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  height: auto;
}
.cneeds-add__frame {
  font-size: 0.8rem;
  white-space: nowrap;
}
.cneeds-add button {
  grid-column: 2;
  justify-self: start;
  align-self: start;
}

/* ---------- Workshop planner ---------- */
.workshop-toolbar {
  margin: 0 0 1rem;
  flex-wrap: wrap;
}
.workshop-objectives {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.workshop-objective {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.workshop-objective.is-achieved .workshop-objective__edit input {
  text-decoration: line-through;
  color: var(--ink-muted);
}
.workshop-objective__edit {
  display: flex;
  flex: 1;
  gap: 0.4rem;
  margin: 0;
}
.workshop-objective__edit input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.workshop-objective__edit button,
.workshop-objective__add button {
  flex: none;
  white-space: nowrap;
}
.workshop-objective__add {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}
.workshop-objective__add input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.workshop-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  /* Cards size to their own member list instead of stretching to the tallest. */
  align-items: start;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.workshop-group {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0.6rem 0.75rem;
}
.workshop-group--none {
  border-style: dashed;
}
.workshop-group form {
  margin: 0;
}
.workshop-group button {
  margin: 0;
  width: auto;
}
.workshop-group__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.workshop-group__name {
  margin: 0;
  font-size: 1rem;
}
.workshop-group__edit {
  display: flex;
  flex: 1;
  gap: 0.4rem;
  min-width: 0;
}
.workshop-group__edit input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.workshop-group__count {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
}
.workshop-group__members {
  list-style: none;
  padding: 0;
  margin: 0;
}
.workshop-group__members li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.15rem 0;
}
.workshop-group__member {
  min-width: 0;
  overflow-wrap: anywhere;
}
.workshop-group__members select {
  flex: 0 0 8rem;
  margin: 0;
  padding: 0.15rem 1.6rem 0.15rem 0.4rem;
  font-size: 0.8rem;
  background-position: center right 0.5rem;
}
.workshop-group__add,
.workshop-group__assign {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}
.workshop-group__add input,
.workshop-group__assign input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.workshop-group__assign input {
  flex: none;
  width: 9rem;
}
/* The rename and delete controls are icon-sized so the name itself keeps the
   width in a card column. */
.workshop-group__head button {
  padding-inline: 0.55rem;
}
.workshop-group__edit button,
.workshop-group__add button,
.workshop-group__assign button {
  flex: none;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .workshop-group__members li,
  .workshop-group__add,
  .workshop-group__assign {
    flex-wrap: wrap;
  }
}
.workshop-roster {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 0.75rem;
}
.workshop-roster li {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
}
.workshop-agenda td {
  vertical-align: top;
}
.workshop-agenda tr.is-pause td {
  background: var(--surface-muted);
}
.workshop-agenda tr.is-running td {
  background: color-mix(in srgb, var(--pico-primary) 12%, transparent);
}
.workshop-agenda tr.is-done td {
  color: var(--ink-muted);
}
.workshop-agenda__move {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.workshop-agenda__move form {
  margin: 0;
}
.workshop-run__timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.workshop-run__timer.is-over {
  color: var(--pico-del-color);
}
.workshop-now {
  border-left: 4px solid var(--pico-primary);
  text-align: center;
}
.workshop-now h2 {
  margin-bottom: 0.5rem;
}
.workshop-now [role="button"] {
  font-size: 1.15rem;
}
.workshop-now__timer {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0.25rem 0 0;
}
.workshop-now__timer.is-over {
  font-size: 1.5rem;
  color: var(--pico-del-color);
}
.workshop-agenda__join {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
}
.workshop-agenda__link {
  margin-left: 0.5rem;
  font-size: 0.9em;
}
.workshop-react__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.workshop-react__buttons button {
  flex: 1 1 auto;
  width: auto;
  transition: transform 0.1s ease;
}
.workshop-react__buttons button.is-sent {
  transform: scale(1.08);
}
/* Run view: the timetable and the live monitoring panels sit side by side on a
   wide screen so a facilitator sees everything at once. The timetable's basis is
   what it needs to show its action column, so the panels wrap below it as soon
   as both no longer fit on one line. */
.workshop-run-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}
.workshop-run-layout--split {
  display: flex;
  flex-wrap: wrap;
}
.workshop-run-layout--split > .workshop-run-layout__main {
  flex: 2.2 1 38rem;
}
.workshop-run-layout--split > .workshop-run-layout__side {
  flex: 1 1 300px;
}
.workshop-run-layout__main,
.workshop-run-layout__side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-content: start;
  min-width: 0;
}
.workshop-reactions__timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  align-items: flex-start;
}
.workshop-reaction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.workshop-reaction__emoji {
  font-size: 1.6rem;
}
/* A freshly arrived reaction pops in, and its card gives a brief accent flash so
   a facilitator glancing away still notices the incoming feedback. */
@keyframes workshop-reaction-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.workshop-reaction.is-new {
  animation: workshop-reaction-pop 0.5s ease;
}
@keyframes workshop-reaction-flash {
  0% {
    box-shadow: 0 0 0 0 var(--pico-primary);
  }
  30% {
    box-shadow: 0 0 0 3px var(--pico-primary);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.workshop-reactions.is-flashing {
  animation: workshop-reaction-flash 0.9s ease;
}
@media (prefers-reduced-motion: reduce) {
  .workshop-reaction.is-new,
  .workshop-reactions.is-flashing {
    animation: none;
  }
}
.workshop-reaction__count {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
}
.workshop-reaction__time {
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.workshop-recent-questions__qa {
  margin: 0;
}
.workshop-recent-questions__qa td {
  vertical-align: top;
}
.workshop-files__add {
  margin: 0.5rem 0 0;
}
.workshop-questions {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.workshop-questions li {
  border-top: 1px solid var(--surface-muted);
  padding: 0.6rem 0;
}
.workshop-questions li:first-child {
  border-top: 0;
}
.workshop-questions__answer {
  border-left: 3px solid var(--pico-primary);
  padding-left: 0.6rem;
  margin: 0.35rem 0;
}
.workshop-feedback {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.workshop-feedback li {
  padding: 0.4rem 0;
}
.workshop-feedback__remove {
  display: inline;
  margin: 0;
}
.workshop-feedback__scale {
  display: flex;
  gap: 1rem;
}
.workshop-feedback__scale label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
@media (max-width: 768px) {
  .workshop-feedback__scale {
    gap: 0.5rem;
  }
}
.workshop-objective form {
  margin: 0;
}
.workshop-objective button {
  margin: 0;
  width: auto;
}
.workshop-objective__toggle button {
  padding: 0 0.3rem;
  font-size: 1.1rem;
  line-height: 1;
}
.workshop-objective > form:last-child button {
  padding-inline: 0.7rem;
}
.workshop-agenda__duration {
  min-width: 9rem;
}
/* Objectives render as plain compact text — sentence-length pills wrap badly
   in the narrow column. */
.workshop-agenda__objective {
  display: block;
  font-size: 0.85em;
  color: var(--ink-muted);
}
.workshop-agenda__objective + .workshop-agenda__objective {
  margin-top: 0.25rem;
}
/* Calendar-like proportion: each row's height grows with its planned minutes
   (capped so a long lunch break cannot dwarf the table). Height on <tr> acts
   as min-height in table layout, so long notes can still stretch a row. */
.workshop-agenda--scaled tr {
  height: calc(min(var(--slot-minutes, 20), 140) * 2px + 0.6rem);
}
/* The run view's plan/actual position bars: each unskipped row's gutter cell
   holds its own slice of the two tracks; workshop-live.js sets the fills as
   percentages of the row, so a skipped row never reads as progress. */
.workshop-agenda__gutter {
  width: 1.2rem;
  min-width: 1.2rem;
  padding: 0.3rem 0.25rem;
  position: relative;
}
/* Keeps a running/pause row's wash off its gutter cell so the tracks stay
   readable. Selector must tie the wash rules' 0,2,2 specificity — this later
   rule then wins. */
.workshop-agenda tr td.workshop-agenda__gutter {
  background: transparent;
}
.workshop-progress {
  position: absolute;
  inset: 0.3rem 0.25rem;
  display: flex;
  gap: 0.2rem;
}
.workshop-progress__bar {
  flex: 1;
  border-radius: 999px;
  background: var(--surface-muted);
  position: relative;
  overflow: hidden;
}
.workshop-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  border-radius: inherit;
  transition: height 0.5s linear;
}
.workshop-progress__bar--plan .workshop-progress__fill {
  background: var(--ink-muted);
}
.workshop-progress__bar--actual .workshop-progress__fill {
  background: var(--pico-primary);
}
.workshop-run__clock {
  font-variant-numeric: tabular-nums;
}
.workshop-hub__personal {
  align-items: flex-start;
}
.workshop-hub__personal .row-actions {
  margin-top: 0.35rem;
}
.workshop-questions__answer-form textarea {
  width: 100%;
  margin: 0;
}
.workshop-questions .row-actions {
  margin-top: 0.75rem;
}
.workshop-questions__answer-form {
  margin: 0.5rem 0 0;
}
.workshop-feedback__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.workshop-feedback__head form {
  margin: 0 0 0 auto;
}
.workshop-hub__section {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}
/* Sub-headings inside workshop cards: Pico's default h3 (1.75rem) would
   outweigh the card's reduced 1.2rem h2, inverting the hierarchy. */
.workshop-hub__section h3,
.workshop-meta h3 {
  font-size: 1.05rem;
  margin: 0.9rem 0 0.4rem;
}
/* Prominent running/completed strip at the top of the workshop detail meta
   card; the badge is scaled up from the 0.75rem pill default so the state
   reads at a glance. */
.workshop-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.workshop-status .status-badge {
  font-size: 0.9rem;
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
}
.workshop-status__dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.4em;
  border-radius: 50%;
  background: currentColor;
}
.workshop-stats__cta {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pico-primary);
}
.workshop-stats .stat-tile {
  border: 1px solid transparent;
  transition: border-color 0.15s ease-in-out;
}
.workshop-stats .stat-tile:hover {
  border-color: var(--pico-primary);
}
.workshop-stats .stat-tile:hover .workshop-stats__cta {
  text-decoration: underline;
}
.workshop-agenda tr.is-skipped td {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.workshop-agenda tr.is-skipped td .status-badge,
.workshop-agenda tr.is-skipped td .row-actions {
  text-decoration: none;
}
.workshop-budget.is-over {
  color: var(--pico-del-color);
  font-weight: 600;
}
.workshop-parking {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.workshop-parking li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.workshop-parking li form {
  margin: 0;
}
.workshop-parking__add {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}

/* Timeline / Gantt — shared by project measures and the backcasting board.
   Each row is a [label | track | dates] grid; bars sit in the block-level track
   and are positioned by inline left/width percentages from core.timeline. */
.timeline {
  margin: 1rem 0;
  font-size: 0.85rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(6rem, 11rem) 1fr minmax(6rem, max-content);
  align-items: center;
  gap: 0.75rem;
}

.timeline-rows .timeline-row {
  padding: 0.3rem 0;
}

.timeline-rows .timeline-row + .timeline-row {
  border-top: 1px solid var(--pico-muted-border-color);
}

.timeline-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-axis {
  position: relative;
  height: 1.2rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.timeline-tick {
  position: absolute;
  transform: translateX(-50%);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 1.4rem;
}

.timeline-bar {
  position: absolute;
  top: 0.35rem;
  height: 0.7rem;
  min-width: 0.4rem;
  border-radius: 999px;
  background: var(--pico-primary);
}

.timeline-point {
  position: absolute;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  transform: translateX(-50%) rotate(45deg);
  background: var(--brand-monarch);
}

.timeline-dates {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.timeline-milestone { background: var(--brand-monarch); }
.timeline-measure { background: var(--brand-moss-ink); }
.timeline-proposed { background: var(--badge-info-fg); }
.timeline-in_progress { background: var(--badge-warning-fg); }
.timeline-done { background: var(--badge-positive-fg); }
.timeline-dropped { background: var(--badge-neutral-fg); }

/* Narrow screens can't show a horizontal Gantt; drop to label + dates only. */
@media (max-width: 768px) {
  .timeline-row { grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; }
  .timeline-scale,
  .timeline-track { display: none; }
  .timeline-dates { text-align: left; }
}

/* Backcasting milestone / measure lists: one flex row per entry, actions right. */
.backcasting-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.backcasting-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.backcasting-list li + li {
  border-top: 1px solid var(--pico-muted-border-color);
}

.backcasting-list form {
  margin: 0;
  display: inline-flex;
}

.backcasting-list li form:first-of-type {
  margin-left: auto;
}

.backcasting-list li form + form {
  margin-left: 0;
}

/* Theory of Change builder: causal stages read left-to-right on one canvas,
   with the connections drawn as an SVG overlay (toc-builder.js). The four
   stages fit side by side from a laptop width up; narrower, the canvas scrolls. */
.toc-builder {
  --toc-gap: 2rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(9rem, 1fr));
  gap: var(--toc-gap);
  margin-bottom: var(--pico-block-spacing-vertical);
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  overflow-x: auto;
}

/* The SVG sits under the cards so cards stay clickable; only the drawn paths
   opt back into pointer events (for click-to-delete). */
.toc-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.toc-line {
  fill: none;
  stroke-width: 2.5;
  opacity: 0.85;
}

.toc-line--editable {
  pointer-events: stroke;
  cursor: pointer;
}

.toc-line--editable:hover {
  stroke-width: 4;
  opacity: 1;
}

/* Each stage spans the builder's heading row and node row, so the headings'
   underlines line up however many lines a stage name wraps to. */
.toc-column {
  position: relative;
  z-index: 1;
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0;
}

/* The stage divider runs down the middle of the gap, scrolling with its column. */
.toc-column + .toc-column::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--toc-gap) / -2);
  width: 1px;
  background: var(--pico-muted-border-color);
}

.toc-column h2 {
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 0.18rem solid var(--brand-moss-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.toc-column--output h2 { border-bottom-color: var(--brand-monarch); }
.toc-column--outcome h2 { border-bottom-color: var(--badge-info-fg); }
.toc-column--impact h2 { border-bottom-color: var(--badge-positive-fg); }

.toc-column__nodes {
  display: grid;
  gap: 0.9rem;
}

.toc-node {
  position: relative;
  margin: 0;
  padding: 0.7rem 0.8rem 0.7rem 0.95rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--pico-card-box-shadow, 0 1px 2px var(--shadow-weak));
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* A left color rail keyed to the stage, so a node reads as its kind at a
   glance. Rounded on the left to sit flush inside the card's rounded corner. */
.toc-node__accent {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0.3rem;
  border-radius: var(--pico-border-radius) 0 0 var(--pico-border-radius);
  background: var(--brand-moss-ink);
}

.toc-column--output .toc-node__accent { background: var(--brand-monarch); }
.toc-column--outcome .toc-node__accent { background: var(--badge-info-fg); }
.toc-column--impact .toc-node__accent { background: var(--badge-positive-fg); }

.toc-node__title {
  font-size: 0.95rem;
  /* Reserve room so a long title never runs under the corner remove control. */
  padding-right: 1rem;
}
.toc-node__title a { text-decoration: none; }

.toc-node p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

/* Remove sits in the top-right corner, hover-revealed and confirm-gated, so it
   is out of the card's main click area and hard to hit by accident. The form is
   the positioned box; the button fills it (Pico forces submit buttons to full
   width, so constraining the wrapper keeps the hit area a small corner icon). */
.toc-node__delete {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
}

.toc-node__remove {
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--pico-muted-color);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.toc-node:hover .toc-node__remove,
.toc-node__remove:focus-visible {
  opacity: 1;
}

.toc-node__remove:hover,
.toc-node__remove:focus-visible {
  color: var(--badge-negative-fg);
  background: var(--pico-code-background-color);
}

/* Connector handle: click to start a connection from this stage. */
.toc-node__connect {
  position: absolute;
  top: 50%;
  right: -0.7rem;
  width: 1.4rem;
  height: 1.4rem;
  transform: translateY(-50%);
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 50%;
  background: var(--pico-card-background-color);
  color: var(--pico-primary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.toc-node:hover .toc-node__connect,
.toc-node__connect:focus-visible {
  opacity: 1;
}

.toc-node--linking {
  outline: 2px solid var(--pico-primary);
  outline-offset: 1px;
}

.toc-node--linking .toc-node__connect { opacity: 1; }

.toc-node--target {
  cursor: pointer;
  outline: 2px dashed var(--badge-positive-fg);
  outline-offset: 1px;
}

.toc-hint {
  margin: -0.4rem 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pico-border-radius);
  background: var(--badge-info-bg, var(--pico-code-background-color));
  color: var(--badge-info-fg, var(--ink));
  font-size: 0.88rem;
}

.toc-connections {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-connections li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
}

.toc-conn__end {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.toc-conn__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--brand-moss-ink);
  flex: none;
}

.toc-conn__end--output .toc-conn__dot { background: var(--brand-monarch); }
.toc-conn__end--outcome .toc-conn__dot { background: var(--badge-info-fg); }
.toc-conn__end--impact .toc-conn__dot { background: var(--badge-positive-fg); }

.toc-conn__kind {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pico-muted-color);
}

.toc-conn__arrow {
  color: var(--pico-muted-color);
  font-weight: 700;
}

.toc-conn__remove-form { margin: 0 0 0 auto; }
.toc-conn__remove { font-size: 0.78rem; }

/* The KPIs that show whether a stage comes about, or a measure's own KPIs. */
.toc-node__indicators {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.toc-indicator {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.4rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.toc-indicator__value {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.toc-indicator .inline-form {
  margin: 0 0 0 auto;
}

.toc-tools details > form { margin-top: 1rem; }

@media (max-width: 768px) {
  .toc-builder {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .toc-column + .toc-column::before { display: none; }
  /* Lines are meaningless once the columns stack vertically. */
  .toc-lines { display: none; }
  /* Hover reveal is unreachable on touch, so keep the controls visible. */
  .toc-node__connect,
  .toc-node__remove { opacity: 1; }
}

/* ---------- Objectives, key results & KPIs ---------- */

/* A native <progress> with its share beside it. */
.progress-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8rem;
  max-width: 16rem;
  width: 100%;
  vertical-align: middle;
}

.progress-meter progress {
  flex: 1;
  margin: 0;
}

.progress-meter__value {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The idea page's adopt form: a project picker and its button, not a full-width form. */
.idea-adopt {
  display: grid;
  gap: 0.35rem;
  max-width: 28rem;
}
.objective-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.okr-card {
  margin: 0 0 1.5rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.okr-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.okr-card__head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.okr-card__meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.key-result-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.key-result {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  list-style: none;
}

.key-result__head {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto minmax(8rem, 11rem) 120px minmax(5rem, auto);
  grid-template-areas: "title figures progress trend confidence";
  align-items: center;
  gap: 0.5rem 1rem;
}

/* Below the widest screens the five columns no longer fit beside the sidebar,
   so the progress bar and the trend move to a second row. */
@media (max-width: 1440px) {
  .key-result__head {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "title figures confidence"
      "progress progress trend";
  }
}

.key-result__title { grid-area: title; }
.key-result__figures { grid-area: figures; }
.key-result__progress { grid-area: progress; }
.key-result__trend { grid-area: trend; }
.key-result__confidence { grid-area: confidence; }

.key-result__title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-wrap: anywhere;
}

.key-result__kpi {
  font-size: 0.8rem;
}

.key-result__figures {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.key-result__note {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.key-result__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.key-result__check-in {
  flex: 1 1 18rem;
  margin: 0;
}

/* The fold-outs open as a compact outline button, like "+ Link": the shared
   :where scale would also shrink the submit beside the full-size inputs, and
   Pico's `details summary[role=button] { width: 100% }` needs the attribute. */
.key-result__check-in > summary[role="button"],
.key-result-add > summary[role="button"],
.kpi-record > summary[role="button"] {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
  list-style: none;
}

.key-result__check-in > summary::-webkit-details-marker,
.key-result-add > summary::-webkit-details-marker,
.kpi-record > summary::-webkit-details-marker {
  display: none;
}

.key-result__check-in > summary::after,
.key-result-add > summary::after,
.kpi-record > summary::after {
  content: none;
}

.key-result__check-in[open] > summary,
.key-result-add[open] > summary,
.kpi-record[open] > summary {
  margin-bottom: 0.5rem;
}

.key-result__check-in-fields,
.key-result-add__fields,
.kpi-record__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
  margin-top: 0.75rem;
}

.key-result-add {
  margin: 1rem 0 0;
}

@media (max-width: 768px) {
  .key-result__head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title title"
      "figures confidence"
      "progress progress"
      "trend trend";
  }

  .key-result__progress .progress-meter {
    max-width: none;
  }
}

.kpi-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  margin: 0 0 1rem;
}

.kpi-facts dt {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.kpi-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.kpi-record {
  margin: 0 0 1rem;
}

.kpi-summary__list,
.objective-summary__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kpi-summary__item,
.objective-summary__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0 0 0.6rem;
  list-style: none;
}

.kpi-summary__title {
  flex: 1 1 10rem;
}

.kpi-summary__figures {
  font-variant-numeric: tabular-nums;
}

.okr-draft__key-results {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}
/* Scenario detail: separate facts, description and relations into readable regions. */
.scenario-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin: 0;
}

.scenario-fact {
  min-width: 10rem;
}

.scenario-fact dt {
  margin-bottom: 0.25rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.scenario-fact dd {
  margin: 0;
  font-size: 1.05rem;
}

/* The archetypes leave the scalar facts row for their own block: one chip each,
   so which archetypes a scenario embodies reads at a glance. */
.scenario-archetypes {
  margin-top: 1.25rem;
}

.scenario-archetypes__title {
  margin: 0 0 0.5rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.archetype-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.archetype-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--badge-neutral-bg);
}

.archetype-chip__framework {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pico-muted-color);
}

.archetype-chip__name {
  font-weight: 600;
}

.scenario-description {
  margin-top: 1.75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--pico-muted-border-color);
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.matrix-provenance > :last-child {
  margin-bottom: 0;
}
/* Without facts or archetypes above it the description opens the card, so it
   needs no gap or rule to set it apart. */
.scenario-description:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.scenario-description h2 {
  margin: 0 0 0.75rem;
}

.scenario-description .prose > :last-child {
  margin-bottom: 0;
}

.scenario-links {
  padding-top: 1.5rem;
}

.scenario-links:not(:has(.related-links)) {
  padding-top: 0;
}

.scenario-personas .section-heading,
.scenario-artifacts .section-heading {
  margin-bottom: 1rem;
}

.scenario-personas .section-heading p,
.scenario-artifacts .section-heading p {
  max-width: 54rem;
  margin-bottom: 0;
}

.artifact-kind-description {
  margin: -0.5rem 0 1.25rem;
}

/* Scenario artifacts: image and text objects share a responsive card language. */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.artifact-card {
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.artifact-card__image {
  display: block;
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
}

.artifact-card__body {
  padding: 1rem;
}

.artifact-card__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.artifact-card__heading h3 {
  margin: 0.35rem 0 0.75rem;
}

.artifact-card__byline {
  margin: 1rem 0 0;
  font-size: 0.85rem;
}

/* ---------- Future personas ---------- */

/* The scenario's cast: one chip per persona, name over role. */
.fp-cast {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.fp-cast__person {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.6rem;
  background: var(--surface-muted);
  text-decoration: none;
}

.fp-cast__name {
  font-weight: 600;
}

.fp-cast__role {
  font-size: 0.85rem;
  color: var(--brand-velvet-ink);
}

/* Two actions sit beside the heading, so the heading claims a wider share
   before they wrap below it. */
.fp-lives-heading {
  margin-top: 2rem;
}

.fp-lives-heading > :first-child {
  flex: 1 1 20rem;
}

.fp-life__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.fp-life__scenario {
  margin: 0;
}

.fp-life__role {
  margin: 0.2rem 0 0;
  font-weight: 600;
  color: var(--brand-velvet-ink);
}

.fp-life__actions {
  margin-top: 1rem;
}

.fp-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin: 1.25rem 0 0;
}

@media (max-width: 768px) {
  .fp-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fp-fact--wide {
  grid-column: 1 / -1;
}

.fp-fact dt {
  margin-bottom: 0.25rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.fp-fact dd {
  margin: 0;
}

/* The latest consistency check. Once the life has changed, a dashed frame marks
   its findings as outdated without dimming text below its contrast floor. */
.fp-check {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.6rem;
}

.fp-check--stale {
  border-style: dashed;
}

.fp-check__meta {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.fp-finding {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  background: var(--badge-warning-bg);
  color: var(--badge-warning-fg);
  font-size: 0.9rem;
}

.fp-finding p {
  margin: 0;
}

.fp-finding__suggestion {
  margin-top: 0.25rem;
  font-style: italic;
}

.fp-day__title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
}

/* The storyboard: one card per moment, in the order of the day, filling the row. */
.fp-day {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
}

.fp-moment {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.6rem;
  background: var(--surface-muted);
}

.fp-moment p {
  margin: 0;
}

.fp-moment__when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.fp-moment__time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-velvet-ink);
}

.fp-moment__place {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

/* Each trend chip stays on one line, a long title ending in an ellipsis (the
   chip's title attribute holds all of it); the chips wrap between each other. */
.fp-moment__trends {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.fp-moment__trends .tag {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Edit and × gather at the moment's foot, like an agenda row's actions. */
.fp-moment__actions {
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.4rem;
}

.fp-interviews__list {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}

.fp-days td {
  vertical-align: top;
  min-width: 12rem;
}

.fp-days__role {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-weight: 400;
}

.fp-days__moment p {
  margin: 0;
}

.fp-days__moment + .fp-days__moment {
  margin-top: 0.75rem;
}

/* A phone stacks the comparison (data-stacked): the part of the day heads each
   row and every scenario's moments follow under the scenario's name. */
@media (max-width: 600px) {
  .table-scroll .fp-days[data-stacked] tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
  .table-scroll .fp-days[data-stacked] th[scope="row"] {
    padding: 0;
    border: none;
  }
  .table-scroll .fp-days[data-stacked] td {
    grid-column: 1;
    min-width: 0;
  }
  .table-scroll .fp-days[data-stacked] td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    color: var(--brand-velvet-ink);
    font-size: 0.85rem;
    font-weight: 600;
  }
}

/* ---------- Cross-impact balance ---------- */

/* Descriptors and scenarios name their variants as code-and-label chips. */
.cib-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cib-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.85rem;
}

/* A succession step marks the descriptors it moved by weight and outline,
   not by color alone. */
.cib-chip--changed {
  border: 2px solid var(--pico-primary-background);
  font-weight: 600;
}

.cib-code {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--heading-ink);
}

.cib-descriptors {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.cib-descriptor {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  display: grid;
  gap: 0.5rem;
}

.cib-descriptor__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

.cib-descriptor__source {
  font-size: 0.85rem;
}

.cib-descriptor__description {
  margin: 0;
}

.cib-add {
  margin-top: 0.5rem;
}

.cib-variant-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.cib-variant {
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.cib-variant > .cib-code {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.cib-bundles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cib-bundles li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

/* --- The matrix --- */

.cib-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.cib-progress label {
  margin: 0;
}

.cib-progress progress {
  flex: 1 1 8rem;
  max-width: 20rem;
  margin: 0;
}

.cib-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.cib-swatch {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.4rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* The grid scrolls inside its own box, so its header row and column can stay
   in view while the page around it does not scroll sideways. */
.cib-scroll {
  overflow: auto;
  max-height: 75vh;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
}

.cib-grid {
  width: auto;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

/* Zero specificity, so a cell's tone class below outranks the plain surface. */
:where(.cib-grid) th,
:where(.cib-grid) td {
  padding: 0.2rem 0.3rem;
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink);
}

.cib-grid thead th,
.cib-grid .cib-corner {
  position: sticky;
  z-index: 2;
  text-align: center;
  font-weight: 600;
}

.cib-grid thead tr:first-child th,
.cib-grid .cib-corner {
  top: 0;
  height: 2rem;
}

.cib-grid thead tr:nth-child(2) th {
  top: 2rem;
}

.cib-grid .cib-corner {
  left: 0;
  z-index: 3;
}

.cib-group-head {
  max-width: 1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cib-col-head {
  min-width: 2.75rem;
  vertical-align: bottom;
}

.cib-col-label {
  display: block;
  max-width: 5rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
  font-size: 0.7rem;
}

.cib-row-head {
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 14rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 400;
}

.cib-row-descriptor {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Descriptor blocks are set off by a heavier rule, across and down. */
.cib-grid .cib-group-start {
  border-left: 2px solid var(--ink-muted);
}

.cib-grid .cib-row-start > * {
  border-top: 2px solid var(--ink-muted);
}

.cib-cell {
  min-width: 2.75rem;
  height: 2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cib-grid .cib-cell:has(.cib-input) {
  padding: 0;
}

.cib-grid .cib-input {
  width: 2.75rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  text-align: center;
}

.cib-grid .cib-input:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: -2px;
}

/* Pico marks an invalid input with an icon and extra padding; a two-digit cell
   has no room for either, so the dashed outline carries it. */
.cib-grid .cib-input[aria-invalid="true"] {
  padding: 0;
  background-image: none;
  outline: 2px dashed var(--badge-negative-fg);
  outline-offset: -2px;
}

/* The tone deepens with the strength of the judgment; the signed number is
   always printed too, so color is never the only cue. */
.cib-cell--pos-1 { background: color-mix(in srgb, var(--chart-pos-ink) 10%, var(--surface)); }
.cib-cell--pos-2 { background: color-mix(in srgb, var(--chart-pos-ink) 20%, var(--surface)); }
.cib-cell--pos-3 { background: color-mix(in srgb, var(--chart-pos-ink) 32%, var(--surface)); }
.cib-cell--neg-1 { background: color-mix(in srgb, var(--chart-neg-ink) 10%, var(--surface)); }
.cib-cell--neg-2 { background: color-mix(in srgb, var(--chart-neg-ink) 20%, var(--surface)); }
.cib-cell--neg-3 { background: color-mix(in srgb, var(--chart-neg-ink) 32%, var(--surface)); }
.cib-cell--zero { color: var(--ink-muted); }

.cib-cell--blocked {
  background: repeating-linear-gradient(
    135deg,
    var(--border-soft) 0 1px,
    var(--surface-muted) 1px 6px
  );
}

.cib-next {
  margin-top: 1rem;
}

/* --- Results --- */

.cib-tolerance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cib-tolerance label,
.cib-tolerance select,
.cib-tolerance button {
  width: auto;
  margin: 0;
}

.cib-succession-form button {
  width: auto;
}

.cib-mode {
  padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--badge-positive-fg);
  background: var(--tint-positive);
}

.cib-mode--sampled,
.cib-mode--incomplete {
  border-left-color: var(--badge-warning-fg);
  background: var(--tint-warning);
}

/* A positioned table keeps its visually hidden header text inside the
   scrolling wrapper; otherwise that text widens the page on a phone. */
.cib-ranking,
.cib-trace {
  position: relative;
}

.cib-ranking .row-actions {
  flex-wrap: nowrap;
}

.cib-frequencies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem 1.5rem;
}

.cib-frequency h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.cib-frequency table {
  margin: 0;
}

.cib-frequency th {
  width: 45%;
  font-weight: 400;
}

.cib-succession-starts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0 1rem;
}

.cib-rules label {
  display: block;
}

.cib-trace__cycle td {
  background: var(--tint-warning);
}

.cib-trace__outcome {
  font-weight: 600;
}

@media (max-width: 576px) {
  .cib-row-head {
    max-width: 8rem;
  }

  .cib-ranking .row-actions {
    flex-wrap: wrap;
  }
}

/* ---------- Strategy Explorer ---------- */

/* The stance card leads with a plain-text gist; the formatted summary sits in a
   disclosure so the card stays short next to the explorer's other sections. */
.stance-lead {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.stance-full > summary {
  cursor: pointer;
  color: var(--pico-primary);
}

.stance-full[open] > summary {
  margin-bottom: 0.75rem;
}


/* ---------- Signage dashboard ---------- */

/* The office screen: a fixed, non-scrolling canvas sized to the viewport, read
   from across the room rather than from a desk. Its theme is forced by the
   console (see the inline head script in signage/dashboard.html), so both
   themes have to hold up here — every color comes from the shared tokens.
   Panels switch off in the console and the running-workshop panel comes and
   goes on its own, so the side region auto-places its panels instead of naming
   grid areas: a hidden panel closes its gap rather than leaving a hole. */
.signage {
  display: grid;
  box-sizing: border-box;
  height: 100dvh;
  padding: 1.75rem;
  gap: 1.25rem;
  background: var(--surface-muted);
  font-size: 1.15rem;
  grid-template-columns: 3fr 4fr;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

/* Without the spotlight the side region is all there is; it takes the width. */
.signage:has(.signage__spotlight[hidden]) {
  grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
  .signage {
    height: auto;
    min-height: 100dvh;
    font-size: 1rem;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow: visible;
  }
}

.signage__top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .signage__top {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

.signage__brand {
  flex: none;
}

.signage__brand .brand-logo-img {
  max-height: 3rem;
}

.signage__announcement {
  flex: 1;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}

/* Narrow: the announcement drops to its own line under brand and clock rather
   than squeezing between them. */
@media (max-width: 1024px) {
  .signage__announcement {
    order: 1;
    flex-basis: 100%;
    font-size: 1.1rem;
  }
}

.signage__clock {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  line-height: 1.1;
}

.signage__time {
  color: var(--ink);
  font-size: 3.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .signage__time {
    font-size: 2.25rem;
  }
}

.signage__date {
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* The rotating panel. Both layers sit on top of each other so one can fade in
   while the other fades out; only the visible one is opaque. */
/* No padding of its own: the layers are absolutely positioned against the
   padding box, so their inset is the panel's only inner spacing. ``min-height``
   keeps the default ``auto`` minimum from letting tall content push the panel
   past its grid row, which ``overflow: hidden`` would then clip. It is a
   ``<section>``, and Pico's block margin on one is subtracted from a stretched
   grid item — leaving it short of the side region's bottom edge. */
.signage__spotlight {
  position: relative;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
}

@media (max-width: 1024px) {
  .signage__spotlight {
    min-height: 20rem;
  }
}

/* An <article>, so Pico would give it a card of its own inside the panel. */
.signage-spot {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  inset: 1.75rem;
  margin: 0;
  padding: 0 0 0 1.5rem;
  border-left: 0.4rem solid transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* The two kinds share the panel, so each carries its own accent — the stripe
   and the badge tint read across the room, the label only up close. */
.signage-spot[data-kind="signal"] {
  border-left-color: var(--badge-positive-fg);
}

.signage-spot[data-kind="news"] {
  border-left-color: var(--badge-info-fg);
}

.signage-spot[data-kind="news"] .signage-spot__kind {
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
}

.signage-spot.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .signage-spot {
    transition: none;
  }
}

.signage-spot__image {
  max-height: 40%;
  border-radius: var(--pico-border-radius);
  object-fit: cover;
}

.signage-spot__kind {
  align-self: flex-start;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--badge-positive-bg);
  color: var(--badge-positive-fg);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.signage-spot__title {
  margin: 0;
  color: var(--ink);
  font-size: 2.4rem;
  line-height: 1.15;
}

@media (max-width: 1024px) {
  .signage-spot__title {
    font-size: 1.6rem;
  }
}

.signage-spot__summary {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.4;
}

.signage-spot__meta {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Uniform cells, filled in document order: a panel switched off in the console
   — or the running-workshop panel with no workshop under way — leaves its cell
   and the rest close up behind it. */
.signage__side {
  display: grid;
  min-height: 0;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

@media (max-width: 1024px) {
  .signage__side {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

.signage-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--pico-border-radius);
  background: var(--surface);
}

/* The workshop under way is the one panel people look up for, and it only
   appears while one is running — it gets the full width of the side region. */
.signage-panel--live {
  border-color: var(--pico-primary);
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .signage-panel--live {
    grid-column: auto;
  }
}

.signage-panel__title {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* A panel is sized by its grid cell, not by its rows, so a list that runs
   long is cut; signage.js leaves out the rows that would not fit whole rather
   than show one sliced in half. */
.signage-panel__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
}

.signage-panel__empty {
  margin: 0;
  color: var(--ink-muted);
}

.signage-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.signage-row__title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

.signage-row__meta {
  display: flex;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.signage-row__count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.signage-row--inline {
  flex-direction: row;
  align-items: baseline;
  gap: 0.75rem;
}
.signage-row--inline .signage-row__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signage-row--inline .signage-row__meta {
  flex: none;
}

/* The statistics panel packs as many counts as fit; the grid reflows rather
   than clipping when a new content type joins the registry. */
.signage-panel[data-panel="stats"] .signage-panel__body {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  align-content: start;
}

.signage-stat {
  display: flex;
  flex-direction: column;
}

.signage-stat__count {
  color: var(--ink);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
}

.signage-stat__label {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* The one highlighted count: read from across the room, so it takes the panel
   rather than sharing it. Its body holds a single number instead of a list that
   might run long, so the "more below" fade has nothing to say and would only
   eat the digits. */
.signage-panel--highlight .signage-panel__body {
  align-items: center;
  justify-content: center;
  mask-image: none;
}

.signage-highlight__count {
  color: var(--pico-primary);
  font-size: min(6rem, 13vh);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1024px) {
  .signage-highlight__count {
    font-size: 4rem;
  }
}

/* A count that moved between two polls. Nobody watches a wall screen closely,
   so the flash has to survive being caught out of the corner of an eye: it
   swells hard, holds the accent color for a couple of seconds, then settles.
   How far it swells is per-number: a count sharing a packed tile grid overlaps
   its neighbors long before the one with a panel to itself does. */
@keyframes signage-count-change {
  0% {
    transform: scale(1);
  }

  10% {
    color: var(--pico-primary);
    transform: scale(var(--signage-flash-scale));
  }

  30% {
    color: var(--pico-primary);
    transform: scale(calc(1 + (var(--signage-flash-scale) - 1) * 0.6));
  }

  45% {
    color: var(--pico-primary);
    transform: scale(var(--signage-flash-scale));
  }

  85% {
    color: var(--pico-primary);
    transform: scale(calc(1 + (var(--signage-flash-scale) - 1) * 0.2));
  }

  100% {
    transform: scale(1);
  }
}

.signage-stat__count.is-changed,
.signage-row__count.is-changed,
.signage-highlight__count.is-changed {
  --signage-flash-scale: 1.35;

  animation: signage-count-change 4s ease-in-out;
}

/* Each grows away from the edge it is anchored to, so the swell stays inside
   the panel instead of being clipped by it. */
.signage-stat__count.is-changed {
  transform-origin: left center;
}

.signage-row__count.is-changed {
  transform-origin: right center;
}

.signage-highlight__count.is-changed {
  --signage-flash-scale: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  .signage-stat__count.is-changed,
  .signage-row__count.is-changed,
  .signage-highlight__count.is-changed {
    animation: none;
  }
}

.signage-live__workshop {
  margin: 0;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 600;
}

.signage-live__label {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signage-live__item {
  margin: 0;
  color: var(--pico-primary);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.signage-live__footer {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* ---------- How Might We ---------- */
/* Proposed questions as one column of cards; in the voting phase each card
   grows a dot button carrying its running total. */
.hmw-budget {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.hmw-questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.hmw-question {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left-width: 4px;
  border-left-color: var(--border-soft);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.hmw-question.is-voted {
  border-left-color: var(--pico-primary);
}
.hmw-question__body {
  flex: 1 1 auto;
  min-width: 0;
}
.hmw-question__text {
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}
.hmw-question__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}
.hmw-question__delete {
  align-self: flex-start;
  order: 3;
  line-height: 1;
  padding: 0.1rem 0.2rem;
}
.hmw-dot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 3.4rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  line-height: 1.1;
}
.hmw-dot.is-selected {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  font-weight: 700;
}
.hmw-dot__count {
  font-size: 1.05rem;
  font-weight: 600;
}
.hmw-dot__unit {
  font-size: 0.7rem;
}
.hmw-add {
  margin-top: 0.9rem;
}
.hmw-add textarea {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.hmw-board--closed .hmw-dot {
  opacity: 0.75;
}

/* ---------- Six Thinking Hats ---------- */
/* One column per hat in play, each tinted by its hat; only the caller's own
   column carries a composer. The hat tints are their own tokens because the
   colors are the method, not decoration. */
.hat-banner {
  border: 1px solid var(--border-soft);
  border-left-width: 5px;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  margin: 0 0 1rem;
  background: var(--surface);
}
.hat-banner--white { border-left-color: var(--hat-white); }
.hat-banner--red { border-left-color: var(--hat-red); }
.hat-banner--black { border-left-color: var(--hat-black); }
.hat-banner--yellow { border-left-color: var(--hat-yellow); }
.hat-banner--green { border-left-color: var(--hat-green); }
.hat-banner--blue { border-left-color: var(--hat-blue); }
.hat-banner__title {
  margin: 0;
  font-weight: 600;
}
.hat-banner__hint {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.hat-columns {
  display: grid;
  grid-template-columns: repeat(var(--hat-columns, 3), minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .hat-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .hat-columns {
    grid-template-columns: 1fr;
  }
}
.hat-column {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top-width: 5px;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.hat-column.is-mine {
  box-shadow: 0 0 0 2px var(--pico-primary);
}
.hat-column--white { border-top-color: var(--hat-white); }
.hat-column--red { border-top-color: var(--hat-red); }
.hat-column--black { border-top-color: var(--hat-black); }
.hat-column--yellow { border-top-color: var(--hat-yellow); }
.hat-column--green { border-top-color: var(--hat-green); }
.hat-column--blue { border-top-color: var(--hat-blue); }
.hat-column--white .hat-column__title { color: var(--hat-white-ink); }
.hat-column--red .hat-column__title { color: var(--hat-red-ink); }
.hat-column--black .hat-column__title { color: var(--hat-black-ink); }
.hat-column--yellow .hat-column__title { color: var(--hat-yellow-ink); }
.hat-column--green .hat-column__title { color: var(--hat-green-ink); }
.hat-column--blue .hat-column__title { color: var(--hat-blue-ink); }
.hat-column__head {
  margin-bottom: 0.5rem;
}
.hat-column__title {
  margin: 0;
  font-size: 1rem;
}
.hat-column__count {
  color: var(--ink-muted);
  font-weight: 400;
}
.hat-column__mine {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pico-primary);
}
.hat-column__hint {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}
.hat-notes {
  list-style: none;
  margin: 0.6rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 2.5rem;
}
.hat-note {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  background: var(--surface-muted);
}
.hat-note__text {
  margin: 0;
  /* Room for the corner delete button, which sits outside the text flow so a
     narrow column never wraps the meta line around it. */
  padding-right: 1rem;
  overflow-wrap: break-word;
  hyphens: auto;
}
.hat-note__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.4rem;
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
}
.hat-note__delete {
  position: absolute;
  top: 0.15rem;
  right: 0.3rem;
  line-height: 1;
}
.hat-add textarea {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.hat-roster ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* --- brainwriting (bw) ------------------------------------------------------ */

.bw-banner {
  border-left: 4px solid var(--pico-primary);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}
.bw-banner__title {
  margin: 0;
  font-weight: 700;
}
.bw-banner__hint {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
}
.bw-timer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0 0;
}
.bw-timer__clock {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.bw-timer.is-over .bw-timer__clock {
  color: var(--pico-del-color);
}
.bw-timer__label {
  font-size: 0.85rem;
}
.bw-banner__actions {
  margin-top: 0.6rem;
}
.bw-seat-actions {
  margin-top: 0.9rem;
}
/* The facilitator's move sits apart from the participants' seat actions: a
   rule above it, a line saying whose move it is, and the full-size primary
   button the lobby leads to. */
.bw-facilitator {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}
.bw-facilitator__hint {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}
.bw-facilitator form {
  margin: 0;
}
.bw-facilitator button {
  width: auto;
}
.bw-heading {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.bw-heading__count {
  font-weight: 400;
  font-size: 0.9rem;
}
.bw-lobby,
.bw-sheet,
.bw-overview,
.bw-reveal {
  margin-bottom: 1.25rem;
}
.bw-seats {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  counter-reset: seat;
}
.bw-seat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  counter-increment: seat;
}
.bw-seat::before {
  content: counter(seat);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.bw-seat.is-mine {
  box-shadow: 0 0 0 2px var(--pico-primary);
}
.bw-seat__badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.bw-seat__badge.is-you {
  color: var(--pico-primary);
}
.bw-seat__remove {
  display: inline;
  margin: 0;
}
.bw-seat__remove button {
  line-height: 1;
}
.bw-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bw-row {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  background: var(--surface-muted);
}
.bw-row.is-current {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--pico-primary);
}
.bw-row__label {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.bw-row__empty {
  margin: 0;
  font-size: 0.85rem;
}
.bw-ideas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.bw-idea {
  position: relative;
  /* Room for the corner delete button, which sits outside the text flow. */
  padding-right: 1.2rem;
  overflow-wrap: break-word;
  hyphens: auto;
}
.bw-idea__author {
  font-size: 0.78rem;
}
.bw-idea__delete {
  position: absolute;
  top: 0;
  right: 0.1rem;
  line-height: 1;
}
.bw-add {
  margin-top: 0.7rem;
}
.bw-add textarea {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.bw-progress {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}
.bw-overview__table th,
.bw-overview__table td {
  font-size: 0.9rem;
}
.bw-sheets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
  align-items: start;
}
.bw-sheet-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: 5px solid var(--module-hue);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.bw-sheet-card__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.bw-board--closed .bw-add {
  display: none;
}
@media (max-width: 700px) {
  .bw-sheets {
    grid-template-columns: 1fr;
  }
}

/* --- workshop timeline (wtl) ------------------------------------------------ */

.wtl-filter fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  margin-bottom: 1rem;
}

.wtl-filter__legend {
  margin: 0 0.4rem 0 0;
  padding: 0;
  float: none;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Pico stretches a form label to full width; these ride in one row instead. */
.wtl-filter__option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  margin: 0;
  font-size: 0.9rem;
}

.wtl-filter__option input[type="checkbox"] {
  margin: 0;
}

.wtl-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--wtl-accent, var(--ink-muted));
  flex: 0 0 auto;
}

.wtl-dot--planning,
.wtl-event--planning {
  --wtl-accent: var(--brand-cornflower-ink);
}

.wtl-dot--participants,
.wtl-event--participants {
  --wtl-accent: var(--brand-moss-ink);
}

.wtl-dot--run,
.wtl-event--run {
  --wtl-accent: var(--brand-monarch-ink);
}

.wtl-dot--feedback,
.wtl-event--feedback {
  --wtl-accent: var(--brand-pink-silk-ink);
}

.wtl-cap {
  font-size: 0.85rem;
}

.wtl,
.wtl-events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wtl-day + .wtl-day {
  margin-top: 1.5rem;
}

.wtl-day__label {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* The rail: one continuous line per day, with each event's marker sitting on it. */
.wtl-events {
  border-left: 2px solid var(--border-soft);
  padding-left: 1rem;
}

.wtl-event {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.wtl-event::before {
  content: "";
  position: absolute;
  /* Half the marker plus the rail's own width, so it straddles the line. */
  left: calc(-1rem - 5px);
  top: 0.75rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wtl-accent, var(--ink-muted));
}

.wtl-event__time {
  flex: 0 0 3.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  padding-top: 0.15rem;
}

.wtl-event__body {
  min-width: 0;
}

.wtl-event__label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wtl-accent, var(--ink));
}

.wtl-event__detail {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

.wtl-event__meta {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
}

@media (max-width: 480px) {
  /* Stack the clock above the event: 3.2rem of gutter plus a long slot title
     overflows a phone column. */
  .wtl-event {
    flex-direction: column;
    gap: 0.1rem;
  }

  .wtl-event__time {
    flex: none;
    padding-top: 0;
  }
}
