/* ============================================================================
   Desync brand components — ported from brand-demo-draft-6.html, cleaned.
   Changes vs source:
     · added .btn-error / .chip-error / .alert-* using --rubric
     · fixed the `chip chip` duplicate-class typo -> real tier modifiers
     · icon selectors retargeted from [data-lucide] spans to the <svg>
       that leptos_icons emits
   ============================================================================ */

/* Accessibility ------------------------------------------------------------ */
/* Visually-hidden but screen-reader reachable (standard clip pattern). Also the
   carrier for native checkbox/radio/switch inputs whose :checked + :focus-visible
   states drive the styled boxes below. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus rings — :focus-visible only, so mouse clicks stay ring-free. */
.btn:focus-visible,
.chip:focus-visible,
.segmented-item:focus-visible,
.tab:focus-visible,
.file-browser-folder:focus-visible,
.file-browser-file:focus-visible,
.toc a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Shape language ----------------------------------------------------------- */
.frame4 { position: relative; }
.frame4::before,
.frame4::after,
.frame4 > .c-bl,
.frame4 > .c-br {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--teal);
}
.frame4::before { top: -1.5px; left: -1.5px; border-right: none; border-bottom: none; }
.frame4::after  { top: -1.5px; right: -1.5px; border-left: none; border-bottom: none; }
.frame4 > .c-bl { bottom: -1.5px; left: -1.5px; border-right: none; border-top: none; }
.frame4 > .c-br { bottom: -1.5px; right: -1.5px; border-left: none; border-top: none; }

.notch {
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
.barcode {
  background: repeating-linear-gradient(90deg,
    var(--teal) 0 2px, transparent 2px 4px, var(--teal) 4px 5px,
    transparent 5px 7px, var(--teal) 7px 9px, transparent 9px 12px);
}
.signal-meter {
  background: repeating-linear-gradient(90deg, var(--teal) 0 3px, transparent 3px 6px);
}
.dotted-box { outline: 1.5px dotted var(--teal); outline-offset: -4px; padding: 14px; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 10px 18px;
  border: 1.5px solid var(--teal);
  background: var(--parchment);
  color: var(--teal);
  min-height: 40px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, filter .12s ease;
}
/* Interaction states: rest -> hover (raise, hard shadow) -> press (sink).
   The shadow uses the ink token at low alpha so it reads on every variant. */
.btn:hover:not(:disabled) {
  filter: brightness(.985);
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 rgba(11, 20, 22, .28);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
  filter: brightness(.94);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}
.btn-primary { background: var(--teal); color: var(--parchment); }
.btn-mint    { background: var(--mint); color: var(--ink); border-color: var(--ink); }
.btn-gold    { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.btn-ghost   { background: transparent; border-color: var(--slate); color: var(--slate); }
.btn-danger  { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-error   { border-color: var(--rubric); color: var(--rubric); background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 10px; min-height: 30px; }
.btn-xs { padding: 3px 8px; font-size: 9px; min-height: 24px; gap: .3rem; }
.btn-lg { padding: 14px 22px; font-size: 13px; min-height: 50px; }
.btn-icon-only { width: 40px; padding: 0; }
.btn-icon-only.btn-sm { width: 30px; }
.btn-icon-only.btn-xs { width: 24px; }

/* Link-style button: underlined text, no chrome, no raise. */
.btn-link {
  border-color: transparent;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 4px;
  padding-right: 4px;
}
.btn-link:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  color: var(--teal-deep);
}

/* Button group: joined row, inner borders collapse, outer corners only. */
.btn-group { display: inline-flex; align-items: stretch; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { margin-left: -1.5px; }
.btn-group .btn:hover:not(:disabled),
.btn-group .btn:active:not(:disabled) { transform: none; box-shadow: none; }
.btn-group .btn:hover:not(:disabled) { filter: brightness(.95); }

/* Split button: the chevron half is narrow; the menu anchors to the group. */
.btn-split { position: relative; }
.btn-split-toggle { padding-left: 8px; padding-right: 8px; min-width: 32px; }
.btn-split-menu { position: absolute; min-width: 200px; z-index: 30; }
.btn-icon-only.btn-lg { width: 50px; }

/* Chips -------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 64px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: var(--parchment);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: center;
}
.chip-active { background: var(--teal);  color: var(--parchment); border-color: var(--teal); }
.chip-mint   { background: var(--mint);  color: var(--ink); border-color: var(--ink); }
.chip-gold   { background: var(--gold);  color: var(--ink); border-color: var(--ink); }
.chip-error  { background: var(--rubric); color: var(--parchment); border-color: var(--rubric); }
/* signal tiers (replaces the source's `chip chip` typo on MED/LOW cells) */
.chip-tier-high { background: var(--mint); color: var(--ink); border-color: var(--ink); }
.chip-tier-med  { border-color: var(--gold); color: var(--gold-deep); }
.chip-tier-low  { border-color: var(--rule); color: var(--slate); }

/* Sections + table of contents ------------------------------------------- */
.section { padding-top: 96px; padding-bottom: 64px; border-top: 1.5px solid var(--rule); }
.section:first-of-type { border-top: none; padding-top: 48px; }
.toc a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
}
.toc a:hover { background: var(--limestone); color: var(--teal); border-left-color: var(--mint); }
.toc a.is-active { background: var(--limestone); color: var(--teal); border-left-color: var(--teal); }

/* Inputs & controls -------------------------------------------------------- */
.input {
  font-family: var(--font-mono);
  border: 1.5px solid var(--rule);
  background: var(--parchment);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--teal);
  min-height: 42px;
}
.input:focus-within, .input:focus { outline: none; border-color: var(--teal); }
.input.is-error { border-color: var(--rubric); }

/* Native controls — the real <input> is .sr-only; these draw the visible part.
   Checked + focus state are driven off the adjacent native input, so keyboard
   focus and screen readers work for free. */
.checkbox-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule);
  background: var(--parchment);
  color: transparent;
  flex: none;
  transition: background .12s ease, border-color .12s ease;
}
.sr-only:checked + .checkbox-box {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--parchment);
}
.sr-only:focus-visible + .checkbox-box { box-shadow: var(--focus-ring); }

.radio-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  background: var(--parchment);
  flex: none;
}
.radio-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background .12s ease;
}
.sr-only:checked + .radio-dot::after { background: var(--teal); }
.sr-only:focus-visible + .radio-dot { box-shadow: var(--focus-ring); }

.switch-track {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background: var(--limestone);
  flex: none;
  transition: background .14s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--parchment);
  border: 1px solid var(--ink);
  transition: left .14s ease;
}
.sr-only:checked + .switch-track { background: var(--mint); }
.sr-only:checked + .switch-track .switch-thumb { left: 22px; }
.sr-only:focus-visible + .switch-track { box-shadow: var(--focus-ring); }

/* Segmented control — items split a mono-bordered row; .is-active inverts. */
.segmented {
  display: inline-flex;
  width: fit-content;
  border: 1.5px solid var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.segmented-item {
  padding: 8px 14px;
  background: var(--parchment);
  color: var(--teal);
  cursor: pointer;
  border: none;
  border-left: 1.5px solid var(--teal);
}
.segmented-item:first-child { border-left: none; }
.segmented-item.is-active { background: var(--teal); color: var(--parchment); }

/* Field affordances */
.field-hint  { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--slate); }
.field-error { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--rubric); }
.req { color: var(--gold-deep); }

/* Meters ------------------------------------------------------------------- */
.score-bar { height: 6px; background: var(--limestone); }
.score-bar > i { display: block; height: 100%; background: var(--mint); }
.score-bar.is-gold   > i { background: var(--gold); }
.score-bar.is-rubric > i { background: var(--rubric); }
.score-bar.is-teal   > i { background: var(--teal); }
.score-bar.is-mint   > i { background: var(--mint); }
.meter-mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--slate); }

/* Tables ------------------------------------------------------------------- */
.table-mono th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1.5px solid var(--rule);
}
.table-mono td {
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--teal);
  vertical-align: middle;
}
.table-mono tr:hover td { background: var(--limestone); }
.num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }

/* DataTable options: zebra stripes, density, sticky header, typed cells -- */
.table-zebra tbody tr:nth-child(even) td { background: rgba(231, 227, 218, .45); }
.table-zebra tbody tr:hover td { background: var(--limestone); }
.table-compact th { padding: 6px 10px; }
.table-compact td { padding: 5px 10px; font-size: 12px; }
.table-scroll { max-height: 340px; overflow: auto; border: 1px solid var(--rule); }
.table-scroll thead th { position: sticky; top: 0; background: var(--parchment); z-index: 2; }
.density-toggle { cursor: pointer; flex: none; }

/* Typed cells: grade square, mini score bar, link */
.cell-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}
.cell-score { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.cell-score-track { flex: 1; height: 5px; background: var(--limestone); border-radius: 3px; overflow: hidden; min-width: 56px; }
.cell-score-fill { display: block; height: 100%; background: var(--teal); }
.cell-link { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.cell-link:hover { color: var(--teal-deep); }
.cell-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cell-delta { font-variant-numeric: tabular-nums; }
.cell-delta-up { color: var(--mint); }
.cell-delta-down { color: var(--rubric); }

/* Charts ------------------------------------------------------------------ */
.chart-figure { margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-tick {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  fill: var(--slate);
  text-transform: uppercase;
}
.chart-caption { margin-top: 8px; opacity: .7; }
.chart-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chart-donut-svg { width: 132px; height: 132px; flex: none; }
.chart-gauge-svg { width: 132px; height: 132px; }
.chart-radar-svg { width: 100%; max-width: 280px; }
.chart-legend-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; margin-top: 8px; }
.chart-donut-center {
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: .04em;
  fill: var(--ink);
}
.chart-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 180px; }
.chart-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--slate); }
.chart-legend-swatch { width: 10px; height: 10px; flex: none; }
.chart-legend-name { flex: 1; }
.chart-legend-value { color: var(--ink); font-size: 12px; }
.chart-legend-share { opacity: .55; margin-left: 4px; }

/* CodeBlock — the light code plate: limestone ground, hairline rule, an
   icon-led header. The ink plate retired 2026-06-11 (founder's call). ----- */
.code-block { border: 1px solid var(--rule); background: var(--limestone); }
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--parchment);
}
.code-block-kicker { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.code-block-icon { color: var(--teal); flex: none; }
.code-block-label { color: var(--teal); }
.code-block .btn-ghost { border-color: var(--rule); color: var(--teal); }
.code-block-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink);
}
.code-block-wrap { white-space: pre-wrap; word-break: break-word; }

/* hCard fallback: hidden contact metadata, off-canvas (not display:none, so
   it stays in the DOM), aria-hidden and out of tab order ------------------- */
.hcard-fallback {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* Media embeds: the 16:9 frame, the figure, the markdown block ------------ */
.media-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1.5px solid var(--rule); background: var(--limestone);
}
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.figure-img { margin: 0; }
.figure-img img { display: block; width: 100%; border: 1.5px solid var(--rule); }
.figure-img figcaption {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--slate); margin-top: 8px;
  display: flex; gap: 12px; align-items: baseline;
}
.figure-credit { margin-left: auto; opacity: .6; }
.md-block { font-size: 15px; line-height: 1.65; color: var(--slate); max-width: 68ch; display: grid; gap: 10px; }
.md-block h2, .md-block h3, .md-block h4 { font-family: var(--font-serif); font-weight: 600; color: var(--ink); line-height: 1.2; margin-top: 6px; }
.md-block h2 { font-size: 24px; }
.md-block h3 { font-size: 19px; }
.md-block h4 { font-size: 16px; }
.md-block ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.md-block a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.md-block code { font-family: var(--font-mono); font-size: 12.5px; background: var(--limestone); border: 1px solid var(--rule); padding: 1px 5px; }
.md-block pre { background: var(--limestone); border: 1px solid var(--rule); padding: 12px 14px; overflow-x: auto; margin: 0; }
.md-block pre code { border: none; background: none; padding: 0; font-size: 12px; line-height: 1.6; }

/* Blocks (desync-blocks): KPI grid, workflow sequence, activity feed ------ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi-card {
  display: grid; gap: 6px; align-content: start;
  background: var(--parchment); border: 1px solid var(--rule); padding: 16px 18px;
}
.kpi-label { opacity: .7; }
.kpi-row { display: flex; align-items: baseline; gap: 10px; }
.kpi-value { font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; }
.kpi-spark { margin-top: 4px; }

.seq { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.seq-step { display: flex; gap: 14px; position: relative; padding: 0 0 22px 0; }
.seq-step:last-child { padding-bottom: 0; }
/* the vertical rail: a hairline dropping from each marker to the next */
.seq:not(.seq-horizontal) .seq-step:not(:last-child)::before {
  content: ""; position: absolute; left: 11px; top: 24px; bottom: 0;
  width: 1px; background: var(--rule);
}
.seq-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 23px; flex: none; border: 1.5px solid var(--rule);
  background: var(--parchment); color: var(--slate); z-index: 1;
}
.seq-done { border-color: var(--mint); color: var(--teal); background: rgba(111, 166, 156, .14); }
.seq-active { border-color: var(--teal); color: var(--teal); }
.seq-pending { color: var(--rule); }
.seq-body { display: grid; gap: 3px; min-width: 0; }
.seq-title { font-family: var(--font-serif); font-weight: 600; font-size: 16px; color: var(--ink); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.seq-meta { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.seq-detail { font-size: 13.5px; line-height: 1.55; color: var(--slate); max-width: 52ch; }
/* the horizontal band: steps in a row, the rail running between markers */
.seq-horizontal { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 18px; }
.seq-horizontal .seq-step { flex-direction: column; gap: 10px; padding: 0; }
.seq-horizontal .seq-step:not(:last-child)::after {
  content: ""; position: absolute; left: 30px; right: -12px; top: 11px;
  height: 1px; background: var(--rule);
}
@media (max-width: 760px) {
  .seq-horizontal { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .seq-horizontal .seq-step { flex-direction: row; gap: 14px; padding-bottom: 22px; }
  .seq-horizontal .seq-step:last-child { padding-bottom: 0; }
  .seq-horizontal .seq-step:not(:last-child)::after {
    left: 11px; right: auto; top: 24px; bottom: 0; width: 1px; height: auto;
  }
}

.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 2px; border-bottom: 1px dotted var(--rule);
}
.feed-row:last-child { border-bottom: none; }
.feed-when { font-size: 10.5px; letter-spacing: .1em; color: var(--slate); opacity: .7; flex: none; width: 44px; }
.feed-ico { flex: none; position: relative; top: 1px; }
.feed-line { font-size: 14px; line-height: 1.55; color: var(--ink); }

/* DataTable — sortable header buttons + filter field --------------------- */
.data-table-filter { max-width: 460px; margin-bottom: 12px; }
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.table-mono th[aria-sort="ascending"] .th-sort,
.table-mono th[aria-sort="descending"] .th-sort { color: var(--teal); }
.th-sort:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.th-sort-arrow { font-size: 11px; line-height: 1; }
.table-pager { display: flex; align-items: center; gap: 10px; padding: 10px 2px 0; }
.table-pager-count { opacity: .7; margin-right: auto; }
.table-pager-btn {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal);
  background: var(--parchment); border: 1px solid var(--rule);
  padding: 7px 14px; min-height: 36px; cursor: pointer;
}
.table-pager-btn:hover { border-color: var(--teal); }
.table-pager-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.table-pager-btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.table-pager-btn[aria-disabled="true"]:hover { border-color: var(--rule); }
.empty-state-cell { padding: 0 !important; background: var(--parchment); }
.table-mono tr:hover td.empty-state-cell,
.table-zebra tbody tr:hover td.empty-state-cell { background: var(--parchment); }

/* EmptyState — the single zero-data affordance -------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 40px 24px;
}
.empty-state-title { font-size: 13px; color: var(--teal); }
.empty-state-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--slate);
  max-width: 48ch;
}
.empty-state-action { margin-top: 4px; }

/* Alerts (data-driven kind -> colour) -------------------------------------- */
/* Alert border by kind; icon colour is set on the element via a c-* class (theme.rs). */
.alert { border: 1.5px solid var(--rule); background: var(--parchment); padding: 16px; display: grid; gap: 4px; }
.alert-info        { border-color: var(--rule); }
.alert-success     { border-color: var(--rule); }
.alert-warning     { border-color: var(--rule); }
.alert-error       { border-color: var(--rubric); }
.alert-destructive { border-color: var(--danger); }

/* Icon tiles --------------------------------------------------------------- */
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 6px;
  border: 1px solid var(--rule);
  background: var(--parchment);
  min-height: 90px;
}
.icon-tile svg { width: 22px; height: 22px; color: var(--teal); }
.icon-tile .label { font-size: 9px; letter-spacing: .08em; }

/* Icon sizing inside controls (svg emitted by leptos_icons) ---------------- */
.dico svg { stroke-width: 1.75; }
.btn svg { width: 14px; height: 14px; }
.btn-lg svg { width: 16px; height: 16px; }
.btn-sm svg { width: 12px; height: 12px; }

/* Crosshair "D" mark wrapper (used only as a SEPARATE framing treatment;
   the D-mark asset already carries its own brackets, so we never double them) */
.crosshair-d { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.crosshair-d img { width: 60%; height: 60%; object-fit: contain; }
.crosshair-d::before,
.crosshair-d::after,
.crosshair-d > .ch-bl,
.crosshair-d > .ch-br {
  content: "";
  position: absolute;
  width: 18%;
  height: 18%;
  border: 2px solid var(--teal);
}
.crosshair-d::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.crosshair-d::after  { top: 0; right: 0; border-left: none; border-bottom: none; }
.crosshair-d > .ch-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.crosshair-d > .ch-br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* Toast (feedback kit confirmations) --------------------------------------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--teal); background: var(--parchment);
  padding: 10px 14px; min-width: 240px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  box-shadow: 4px 4px 0 rgba(11, 20, 22, .12);
}
.toast.is-error { border-color: var(--rubric); }
/* .toast-ico colour comes from the signal's c-* class (theme.rs color_class):
   mint=success, rubric=error, danger=destructive. No override here, or the
   higher-specificity rule repaints Destructive's oxblood to rubric. */

/* Modal overlay ------------------------------------------------------------ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(11, 20, 22, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-panel {
  position: relative;
  background: var(--parchment);
  border: 1.5px solid var(--teal);
  max-width: 520px; width: 100%;
  box-shadow: 8px 8px 0 rgba(11, 20, 22, .14);
}

/* ============================================================================
   Design-system additions: depth, navigation, overlays, utilities, images.
   ============================================================================ */

/* Depth + interaction (offset hard shadow = print/technical, not soft AI blur) */
.shadow-hard { box-shadow: 5px 5px 0 rgba(11, 20, 22, .10); }
.lift { transition: transform .15s ease, box-shadow .15s ease; }
.lift:hover { transform: translateY(-3px); box-shadow: 7px 7px 0 rgba(11, 20, 22, .12); }

/* Plain panels for nesting (cards-on-cards) — hairline, no corner brackets */
.panel { background: var(--parchment); border: 1px solid var(--rule); }
.panel-inset { background: var(--limestone); border: 1px solid var(--rule); }

/* Tabs */
.tablist { display: flex; border-bottom: 1.5px solid var(--rule); }
.tab {
  padding: 9px 16px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
  border-bottom: 2px solid transparent; margin-bottom: -1.5px; cursor: pointer; background: none;
}
.tab:hover { color: var(--teal); }
.tab.is-active { color: var(--teal); border-bottom-color: var(--teal); }

/* Breadcrumbs */
.crumbs { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--slate); }
.crumbs li { list-style: none; }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.crumbs .cur { color: var(--teal); }

/* Sidebar / side menu */
.sidenav { display: grid; gap: 2px; }
.sidenav a, .sidenav button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
  font-size: 13px; color: var(--slate); border-left: 2px solid transparent;
  text-align: left; background: none; cursor: pointer;
}
.sidenav a:hover, .sidenav button:hover { background: var(--limestone); color: var(--teal); }
.sidenav .is-active { background: var(--limestone); color: var(--teal); border-left-color: var(--teal); }

/* File browser — folder list + file list over a flat file set */
.file-browser { border: 1px solid var(--rule); background: var(--parchment); }
.file-browser-search { padding: 12px; border-bottom: 1px solid var(--rule); max-width: 320px; }
.file-browser-panes { display: grid; grid-template-columns: 200px 1fr; }
@media (max-width: 640px) { .file-browser-panes { grid-template-columns: 1fr; } }
.file-browser-folders {
  display: grid; gap: 2px; align-content: start;
  padding: 8px; border-right: 1px solid var(--rule);
}
@media (max-width: 640px) {
  .file-browser-folders { border-right: none; border-bottom: 1px solid var(--rule); }
}
.file-browser-folder {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
  font-size: 13px; color: var(--slate); border-left: 2px solid transparent;
  text-align: left; background: none; cursor: pointer;
}
.file-browser-folder:hover { background: var(--limestone); color: var(--teal); }
.file-browser-folder.is-active {
  background: var(--limestone); color: var(--teal); border-left-color: var(--teal);
}
.file-browser-files { display: grid; gap: 2px; padding: 8px; align-content: start; }
.file-browser-file {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 12px;
  text-align: left; background: none; cursor: pointer; border: 1px solid transparent;
}
.file-browser-file:hover { background: var(--limestone); border-color: var(--rule); }
.file-browser-file-body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.file-browser-file-name { font-size: 13px; color: var(--ink); }
.file-browser-file-preview {
  font-size: 12px; color: var(--slate); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-browser-file-folder { flex: none; color: var(--slate); opacity: .7; align-self: center; }

/* Popover / dropdown */
.popover {
  position: absolute; z-index: 60; min-width: 210px;
  background: var(--parchment); border: 1.5px solid var(--teal);
  box-shadow: 5px 5px 0 rgba(11, 20, 22, .12);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; width: 100%;
  font-size: 13px; color: var(--teal); cursor: pointer; text-align: left; background: none;
}
.menu-item:hover { background: var(--limestone); }
.menu-item.is-danger { color: var(--rubric); }

/* Tooltip (CSS-only on hover) */
.tip { position: relative; display: inline-flex; }
.tip > .tip-body {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: var(--parchment); font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .08em; padding: 5px 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease; z-index: 60;
}
.tip:hover > .tip-body,
.tip:focus-within > .tip-body { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Drawer (slide-out) */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(11, 20, 22, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(360px, 86vw); z-index: 71;
  background: var(--parchment); border-left: 1.5px solid var(--teal);
  box-shadow: -8px 0 0 rgba(11, 20, 22, .12);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
}
.drawer-panel.is-open { transform: translateX(0); }

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--limestone); color: var(--slate);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  border: 1px solid var(--rule); flex: none;
}

/* Badge (count) — sharp, technical */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--teal); color: var(--parchment);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em;
}
.badge-rubric { background: var(--rubric); }
.badge-gold { background: var(--gold); color: var(--ink); }

/* Spinner (ring) */
.spinner { border: 2px solid var(--limestone); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--limestone) 25%, #efece3 50%, var(--limestone) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Accordion */
.acc-item { border-bottom: 1px solid var(--rule); }
.acc-head { display: flex; align-items: center; gap: 10px; padding: 14px 2px; cursor: pointer; width: 100%; background: none; text-align: left; }

/* The portrait plate (founder rule 2026-06-10: NO round frames, ever — the
   brand is hairlines, brackets, and hard shadows). A sharp 4:5 plate with the
   teal hairline and the hard offset shadow. Width is the caller's; the ratio
   and the corners are not. */
.cameo {
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: 0;
  overflow: hidden;
  border: 1.5px solid var(--teal);
  background: var(--limestone);
  box-shadow: 5px 5px 0 rgba(11, 20, 22, .10);
}
.cameo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Background plate: a commissioned plate sitting BEHIND content ("when you
   see it, you see it"): absolutely positioned, quiet by default. Pair with
   .plate-breathe for the sanctioned whisper of motion. */
.plate-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .22;
  pointer-events: none;
}
/* The one sanctioned plate animation: a slow breathe of presence (opacity and
   warmth), 14s, barely there. Anything louder is off-brand. */
@keyframes plate-breathe {
  0%, 100% { opacity: .16; filter: saturate(.9); }
  50% { opacity: .30; filter: saturate(1.15); }
}
.plate-breathe { animation: plate-breathe 14s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .plate-breathe { animation: none; opacity: .22; }
}
/* Knock a teal-on-transparent logo to light, for use on dark/teal lockup bars. */
.logo-invert { filter: brightness(0) invert(1); }
.placeholder {
  display: flex; align-items: center; justify-content: center;
  background-color: var(--limestone);
  background-image:
    linear-gradient(to right, rgba(14, 61, 65, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 61, 65, .06) 1px, transparent 1px);
  background-size: 16px 16px; color: var(--slate); border: 1px solid var(--rule);
}

/* Motion guard */
@media (prefers-reduced-motion: reduce) {
  .lift, .drawer-panel, .drawer-backdrop, .tip > .tip-body, .switch-thumb { transition: none; }
  .lift:hover { transform: none; } /* same policy as .btn: no hover raise */
  .spinner, .skeleton { animation: none; }
}

/* Epigraph — THE Latin treatment (founder rule 2026-06-10): rare, dark, loud.
   Gold serif on ink for contrast; the gloss always rides beneath in mono.
   Use at most one or two per page; all other accent text stays English. */
.epigraph {
  margin: 0;
  background: var(--ink);
  border: 1.5px solid var(--teal-deep);
  padding: 22px 26px;
  position: relative;
}
.epigraph-latin {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.25;
  color: var(--festal);
  margin: 0;
}
.epigraph-gloss {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rule);
  margin-top: 10px;
  display: block;
}
.epigraph-rule {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--festal) 35%, transparent);
  pointer-events: none;
}
