/* ================================================================
   DXED CRYPTO — design system.

   One system for every Crypto surface. The structural idea is that the
   product is built from *sections and rows*, not from a grid of floating
   rounded cards: a page is a stack of labelled sections separated by
   hairlines, and a list is a stack of rows separated by hairlines. Cards
   are reserved for things that are genuinely a discrete object you pick
   up (a project tile, an event tile), and they are never nested.

   Colour carries no meaning on its own. Every status is a word first;
   the tint only reinforces it.
   ================================================================ */

/* Tokens live on :root, not on the container: dialogs and sheets are appended
   to <body>, so container-scoped custom properties would not reach them. */
:root {
  --cx-gutter: 28px;
  --cx-rail: 300px;
  --cx-max: 1320px;

  --cx-line: rgba(255, 255, 255, 0.07);
  --cx-line-strong: rgba(255, 255, 255, 0.12);
  --cx-surface: rgba(255, 255, 255, 0.018);
  --cx-surface-hover: rgba(255, 255, 255, 0.038);
  --cx-ink: var(--text-primary);
  --cx-ink-2: var(--text-secondary);
  --cx-ink-3: var(--text-muted);
  --cx-accent: var(--accent-light);

  --cx-ok: #5aa87a;
  --cx-warn: #c39355;
  --cx-bad: #d06468;
  --cx-info: #7f93b8;

  --cx-r: 10px;          /* one radius, used sparingly */
  --cx-r-sm: 6px;
}

#crypto-container, .cx-overlay {
  color: var(--cx-ink);
  font-variant-numeric: tabular-nums;
}

/* ── Page shell ─────────────────────────────────────────────── */

.cx-shell { display: flex; flex-direction: column; min-height: 100%; }

/* Sub-navigation: sits under the DXED header and stays put. This is the
   thing that tells you "you are inside Crypto" on every page. */
.cx-subnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2px;
  padding: 0 var(--cx-gutter);
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cx-line);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  scroll-padding-inline: var(--cx-gutter);
}
.cx-subnav::-webkit-scrollbar { display: none; }
.cx-subnav-brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cx-ink-3); padding-right: 18px; margin-right: 6px;
  border-right: 1px solid var(--cx-line); align-self: stretch; white-space: nowrap;
}
.cx-navlink {
  position: relative; background: none; border: 0; font: inherit; text-decoration: none;
  color: var(--cx-ink-3); font-size: 13.5px; font-weight: 600;
  padding: 15px 14px 13px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .14s ease;
}
.cx-navlink:hover { color: var(--cx-ink-2); }
.cx-navlink[aria-current="page"] { color: var(--cx-ink); border-bottom-color: var(--cx-accent); }
.cx-navlink-count {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 20px;
  background: var(--cx-surface-hover); color: var(--cx-ink-3);
  font-size: 10.5px; font-weight: 700; line-height: 1.5;
}
.cx-navlink-count[data-tone="alert"] { background: rgba(208, 100, 104, .16); color: var(--cx-bad); }

.cx-page { width: 100%; max-width: var(--cx-max); margin: 0 auto; padding: 0 var(--cx-gutter) 96px; }

/* ── Page header ────────────────────────────────────────────── */

.cx-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding: 30px 0 18px;
  border-bottom: 1px solid var(--cx-line); margin-bottom: 24px;
}
.cx-head-text { min-width: 0; max-width: 640px; }
.cx-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.cx-head p { margin-top: 7px; font-size: 13.5px; line-height: 1.55; color: var(--cx-ink-3); }
.cx-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-back {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--cx-ink-3);
  cursor: pointer; padding: 18px 0 0; margin-bottom: -8px;
}
.cx-back:hover { color: var(--cx-ink); }

/* ── Layout: main column + context rail ─────────────────────── */

.cx-cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--cx-rail); gap: 40px; align-items: start; }
.cx-rail { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 74px; }

/* ── Sections ───────────────────────────────────────────────── */

.cx-section { margin-bottom: 38px; }
.cx-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--cx-line);
}
.cx-section-head h2, .cx-section-head h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--cx-ink-2);
}
.cx-section-note { font-size: 12px; color: var(--cx-ink-3); }
.cx-more {
  background: none; border: 0; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--cx-ink-3); cursor: pointer; padding: 2px 0; white-space: nowrap;
}
.cx-more:hover { color: var(--cx-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── Summary strip ──────────────────────────────────────────── */
/* Five compact figures, not five giant statistic cards. */

.cx-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--cx-line); border-radius: var(--cx-r); overflow: hidden; margin-bottom: 34px;
}
.cx-summary-item {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 14px 16px; background: none; border: 0; border-right: 1px solid var(--cx-line);
  font: inherit; text-align: left; cursor: pointer; color: inherit; min-width: 0;
  transition: background .14s ease;
}
.cx-summary-item:last-child { border-right: 0; }
.cx-summary-item:hover { background: var(--cx-surface-hover); }
.cx-summary-value { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cx-summary-label { font-size: 11.5px; color: var(--cx-ink-3); line-height: 1.35; }
.cx-summary-item[data-tone="alert"] .cx-summary-value { color: var(--cx-bad); }

/* ── Rows: the workhorse list primitive ─────────────────────── */

.cx-rows { display: flex; flex-direction: column; }
.cx-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px; align-items: center; padding: 13px 12px; margin: 0 -12px;
  border-bottom: 1px solid var(--cx-line); text-align: left;
  background: none; border-left: 0; border-right: 0; border-top: 0;
  font: inherit; color: inherit; width: calc(100% + 24px); cursor: pointer;
  transition: background .14s ease;
}
.cx-rows > .cx-row:last-child { border-bottom: 0; }
.cx-row:hover { background: var(--cx-surface-hover); }
.cx-row-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cx-row-title {
  font-size: 14px; font-weight: 650; line-height: 1.35; color: var(--cx-ink);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.cx-row-meta {
  font-size: 12px; color: var(--cx-ink-3); line-height: 1.45;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.cx-row-meta > * { flex-shrink: 0; }
.cx-row-sep { opacity: .45; }
.cx-row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cx-row-excerpt {
  font-size: 12.5px; color: var(--cx-ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Cards: only for discrete pick-up-able objects ──────────── */

.cx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1px;
  background: var(--cx-line); border: 1px solid var(--cx-line); border-radius: var(--cx-r); overflow: hidden; }
.cx-card {
  display: flex; flex-direction: column; gap: 9px; padding: 15px;
  background: var(--bg-primary); border: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer; min-width: 0; transition: background .14s ease;
}
.cx-card:hover { background: var(--cx-surface-hover); }
.cx-card-top { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.cx-card-title { font-size: 14px; font-weight: 650; line-height: 1.3; display: flex; align-items: center; gap: 5px; }
.cx-card-sub {
  font-size: 12.5px; color: var(--cx-ink-3); line-height: 1.45; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cx-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--cx-line);
  font-size: 11.5px; color: var(--cx-ink-3);
}

/* ── Identity ───────────────────────────────────────────────── */

.cx-logo {
  width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--cx-surface); border: 1px solid var(--cx-line);
}
.cx-logo-sm { width: 22px; height: 22px; border-radius: 5px; }
.cx-logo-xl { width: 72px; height: 72px; border-radius: 14px; }
.cx-logo-text {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--cx-ink-3); letter-spacing: -0.02em;
}
.cx-logo-sm.cx-logo-text { font-size: 11px; }
.cx-logo-xl.cx-logo-text { font-size: 28px; }
.cx-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--cx-surface); }

.cx-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  background: rgba(90, 168, 122, .18); color: var(--cx-ok); font-size: 9px; font-weight: 900;
}

/* ── Status vocabulary ──────────────────────────────────────── */
/* A word, optionally with a dot. Never a glowing pill. */

.cx-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; color: var(--cx-ink-2); white-space: nowrap;
}
.cx-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0; opacity: .9;
}
.cx-status[data-tone="ok"] { color: var(--cx-ok); }
.cx-status[data-tone="warn"] { color: var(--cx-warn); }
.cx-status[data-tone="bad"] { color: var(--cx-bad); }
.cx-status[data-tone="info"] { color: var(--cx-info); }
.cx-status[data-tone="idle"] { color: var(--cx-ink-3); }
.cx-status-plain::before { display: none; }

/* Metadata labels: quiet text, not chrome. */
.cx-tag { font-size: 11.5px; color: var(--cx-ink-3); white-space: nowrap; }
.cx-tag-strong { color: var(--cx-ink-2); font-weight: 600; }
/* The one boxed label, used where a category must be scannable in a list. */
.cx-chip {
  display: inline-block; padding: 2px 7px; border: 1px solid var(--cx-line-strong);
  border-radius: var(--cx-r-sm); font-size: 10.5px; font-weight: 650;
  letter-spacing: .02em; color: var(--cx-ink-2); white-space: nowrap;
}
.cx-chip-official { border-color: rgba(90, 168, 122, .35); color: var(--cx-ok); }

/* Confidence: a bar plus the number, so it reads without colour. */
.cx-meter { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--cx-ink-3); }
.cx-meter-track { width: 46px; height: 3px; border-radius: 2px; background: var(--cx-line-strong); overflow: hidden; }
.cx-meter-fill { display: block; height: 100%; background: var(--cx-ink-2); }
.cx-meter[data-tone="ok"] .cx-meter-fill { background: var(--cx-ok); }
.cx-meter[data-tone="warn"] .cx-meter-fill { background: var(--cx-warn); }
.cx-meter[data-tone="bad"] .cx-meter-fill { background: var(--cx-bad); }

/* ── Buttons ────────────────────────────────────────────────── */

.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 7px 13px; border-radius: var(--cx-r-sm);
  border: 1px solid var(--cx-line-strong); background: transparent; color: var(--cx-ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background .14s ease, border-color .14s ease, opacity .14s ease;
}
.cx-btn:hover { background: var(--cx-surface-hover); }
.cx-btn:disabled { opacity: .5; cursor: not-allowed; }
.cx-btn-primary { background: var(--cx-ink); border-color: var(--cx-ink); color: var(--bg-primary); }
.cx-btn-primary:hover { background: #fff; border-color: #fff; }
.cx-btn-sm { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.cx-btn-ghost { border-color: transparent; color: var(--cx-ink-2); }
.cx-btn-ghost:hover { border-color: var(--cx-line-strong); color: var(--cx-ink); }
.cx-btn-danger { border-color: rgba(208, 100, 104, .4); color: var(--cx-bad); }
.cx-btn[aria-pressed="true"] { background: var(--cx-surface-hover); border-color: var(--cx-line-strong); color: var(--cx-ink); }
.cx-btn-icon { padding: 6px; min-width: 30px; min-height: 30px; }

.cx-link { color: var(--cx-ink-2); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--cx-line-strong); overflow-wrap: anywhere; }
.cx-link:hover { color: var(--cx-ink); text-decoration-color: currentColor; }

:where(#crypto-container) :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--cx-accent); outline-offset: 2px; border-radius: var(--cx-r-sm);
}

/* ── Toolbar (search + filters + sort) ──────────────────────── */

.cx-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--cx-line);
}
.cx-search { position: relative; flex: 1 1 260px; min-width: 0; }
.cx-search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  background: var(--cx-surface); border: 1px solid var(--cx-line-strong); border-radius: var(--cx-r-sm);
  color: var(--cx-ink); font: inherit; font-size: 13.5px; outline: none;
}
.cx-search input::placeholder { color: var(--cx-ink-3); }
.cx-search input:focus { border-color: var(--cx-line-strong); background: var(--cx-surface-hover); }
.cx-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cx-ink-3); pointer-events: none; font-size: 13px; }
.cx-select {
  height: 36px; padding: 0 26px 0 11px; background: var(--cx-surface);
  border: 1px solid var(--cx-line-strong); border-radius: var(--cx-r-sm);
  color: var(--cx-ink); font: inherit; font-size: 13px; cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 16px, calc(100% - 10px) 16px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
/* Quick toggles: text with a state, not a fat pill row. */
.cx-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px;
  border: 1px solid var(--cx-line-strong); border-radius: var(--cx-r-sm);
  background: transparent; color: var(--cx-ink-3); font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cx-toggle[aria-pressed="true"] { color: var(--cx-ink); background: var(--cx-surface-hover); }
.cx-toolbar-count { font-size: 12px; color: var(--cx-ink-3); margin-left: auto; white-space: nowrap; }
.cx-filter-badge {
  display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--cx-ink); color: var(--bg-primary); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.cx-applied { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 12px 0 0; }
.cx-applied-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px;
  border: 1px solid var(--cx-line-strong); border-radius: 20px;
  font-size: 11.5px; color: var(--cx-ink-2); background: none; font-family: inherit; cursor: pointer;
}
.cx-applied-chip:hover { color: var(--cx-ink); border-color: var(--cx-ink-3); }
.cx-applied-chip span { font-size: 13px; line-height: 1; opacity: .7; }

/* ── Rail modules ───────────────────────────────────────────── */

.cx-rail-mod { }
.cx-rail-head {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--cx-ink-3); padding-bottom: 9px; margin-bottom: 10px; border-bottom: 1px solid var(--cx-line);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.cx-rail-list { display: flex; flex-direction: column; gap: 2px; }
.cx-rail-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; margin: 0 -8px;
  border: 0; background: none; font: inherit; color: inherit; text-align: left;
  cursor: pointer; border-radius: var(--cx-r-sm); min-width: 0;
}
.cx-rail-item:hover { background: var(--cx-surface-hover); }
.cx-rail-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cx-rail-meta { font-size: 11.5px; color: var(--cx-ink-3); white-space: nowrap; }
.cx-rail-note { font-size: 12px; line-height: 1.55; color: var(--cx-ink-3); }
.cx-rail-note strong { color: var(--cx-ink-2); font-weight: 650; }
.cx-rep-bars { display: flex; flex-direction: column; gap: 7px; }
.cx-rep-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.cx-rep-track { grid-column: 1 / -1; height: 3px; background: var(--cx-line-strong); border-radius: 2px; overflow: hidden; }
.cx-rep-fill { display: block; height: 100%; background: var(--cx-ink-2); }

/* ── Project header ─────────────────────────────────────────── */

.cx-banner { height: 168px; border-radius: var(--cx-r); background-size: cover; background-position: center;
  border: 1px solid var(--cx-line); margin-bottom: -34px; }
.cx-phead { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0 20px; flex-wrap: wrap; position: relative; }
.cx-phead-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cx-phead h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-phead-desc { font-size: 13.5px; color: var(--cx-ink-2); line-height: 1.55; max-width: 620px; }
.cx-facts { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12.5px; color: var(--cx-ink-3); }
.cx-phead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* Banner-strength notice, used for active alerts on a project. */
.cx-notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; border: 1px solid var(--cx-line-strong); border-left-width: 3px;
  border-radius: var(--cx-r-sm); font-size: 13px; margin-bottom: 18px;
}
.cx-notice[data-tone="bad"] { border-left-color: var(--cx-bad); background: rgba(208, 100, 104, .06); }
.cx-notice[data-tone="warn"] { border-left-color: var(--cx-warn); background: rgba(195, 147, 85, .06); }
.cx-notice[data-tone="info"] { border-left-color: var(--cx-info); background: var(--cx-surface); }
.cx-notice strong { font-weight: 650; }
.cx-notice-actions { margin-left: auto; display: flex; gap: 8px; }

/* Tabs inside a page (project, management, admin). */
.cx-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--cx-line); margin-bottom: 26px;
  overflow-x: auto; scrollbar-width: none;
}
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--cx-ink-3);
  padding: 10px 12px; cursor: pointer; white-space: nowrap;
}
.cx-tab:hover { color: var(--cx-ink-2); }
.cx-tab[aria-selected="true"] { color: var(--cx-ink); border-bottom-color: var(--cx-accent); }

/* ── Definition lists / key-value data ──────────────────────── */

.cx-dl { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 9px 20px; font-size: 13px; }
.cx-dl dt { color: var(--cx-ink-3); }
.cx-dl dd { color: var(--cx-ink); overflow-wrap: anywhere; }
.cx-prose { font-size: 14px; line-height: 1.65; color: var(--cx-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }

/* Contracts: chain + truncated address + actions, never a wall of hex. */
.cx-contract {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--cx-line);
}
.cx-contract:last-child { border-bottom: 0; }
.cx-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  color: var(--cx-ink-2); overflow-wrap: anywhere;
}
.cx-contract-actions { display: flex; gap: 6px; }

/* Evidence rows on a proof detail. */
.cx-evidence { display: flex; flex-direction: column; }
.cx-evidence-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--cx-line);
}
.cx-evidence-row:last-child { border-bottom: 0; }
.cx-evidence-index { font-size: 11.5px; color: var(--cx-ink-3); font-variant-numeric: tabular-nums; min-width: 18px; }

/* Timeline. */
.cx-timeline { display: flex; flex-direction: column; }
.cx-tl {
  display: grid; grid-template-columns: 108px auto minmax(0, 1fr); gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--cx-line); align-items: baseline;
}
.cx-tl:last-child { border-bottom: 0; }
.cx-tl-date { font-size: 12px; color: var(--cx-ink-3); white-space: nowrap; }
.cx-tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cx-line-strong); align-self: center; }
.cx-tl[data-kind="alert"] .cx-tl-dot { background: var(--cx-bad); }
.cx-tl[data-kind="milestone"] .cx-tl-dot { background: var(--cx-ok); }
.cx-tl-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.cx-tl-detail { font-size: 12.5px; color: var(--cx-ink-3); margin-top: 3px; line-height: 1.5; }

/* ── Empty / error / skeleton ───────────────────────────────── */

.cx-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 34px 0; border-top: 1px solid var(--cx-line);
}
.cx-empty-title { font-size: 14px; font-weight: 650; color: var(--cx-ink-2); }
.cx-empty-body { font-size: 13px; color: var(--cx-ink-3); line-height: 1.6; max-width: 46ch; }
.cx-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cx-empty[data-variant="inline"] { padding: 20px 0; border-top: 0; }

.cx-skel { background: var(--cx-surface); border-radius: var(--cx-r-sm); position: relative; overflow: hidden; }
.cx-skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent);
  animation: cx-sweep 1.25s ease-in-out infinite;
}
@keyframes cx-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.cx-skel-row { display: grid; grid-template-columns: 34px minmax(0,1fr) 70px; gap: 14px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--cx-line); }
.cx-skel-line { height: 10px; }
.cx-skel-logo { width: 34px; height: 34px; border-radius: 8px; }
.cx-skel-stack { display: flex; flex-direction: column; gap: 7px; }

/* ── Forms ──────────────────────────────────────────────────── */

.cx-form { display: flex; flex-direction: column; gap: 18px; }
.cx-fieldset { border: 0; display: flex; flex-direction: column; gap: 13px; }
.cx-fieldset legend {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--cx-ink-3); padding-bottom: 9px; margin-bottom: 4px;
  border-bottom: 1px solid var(--cx-line); width: 100%;
}
.cx-field { display: flex; flex-direction: column; gap: 6px; }
.cx-field > span { font-size: 12.5px; font-weight: 600; color: var(--cx-ink-2); }
.cx-field input, .cx-field select, .cx-field textarea {
  background: var(--cx-surface); border: 1px solid var(--cx-line-strong); border-radius: var(--cx-r-sm);
  padding: 9px 11px; color: var(--cx-ink); font: inherit; font-size: 13.5px; outline: none; width: 100%;
}
.cx-field textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.cx-field input:focus, .cx-field select:focus, .cx-field textarea:focus { border-color: var(--cx-ink-3); }
.cx-field-hint { font-size: 12px; color: var(--cx-ink-3); line-height: 1.5; }
.cx-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.cx-checkline { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--cx-ink-2); cursor: pointer; padding: 6px 0; }
.cx-checkline input { margin-top: 2px; accent-color: var(--cx-accent); width: 15px; height: 15px; flex-shrink: 0; }
.cx-checkline-label { display: flex; flex-direction: column; gap: 2px; }
.cx-checkline-note { font-size: 11.5px; color: var(--cx-ink-3); }
.cx-form-error {
  font-size: 13px; color: var(--cx-bad); background: rgba(208, 100, 104, .07);
  border: 1px solid rgba(208, 100, 104, .3); border-radius: var(--cx-r-sm); padding: 9px 11px; line-height: 1.5;
}
.cx-form-error ul { margin: 6px 0 0 16px; }

/* ── Dialog / bottom sheet ──────────────────────────────────── */

.cx-overlay {
  position: fixed; inset: 0; z-index: 1200; display: flex;
  align-items: center; justify-content: center; padding: 24px;
}
.cx-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(2px); }
.cx-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--bg-secondary); border: 1px solid var(--cx-line-strong);
  border-radius: var(--cx-r); box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.cx-dialog-wide { max-width: 720px; }
.cx-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--cx-line); flex-shrink: 0;
}
.cx-dialog-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.cx-dialog-head p { font-size: 12.5px; color: var(--cx-ink-3); margin-top: 3px; }
.cx-dialog-body { padding: 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cx-dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--cx-line); flex-shrink: 0; flex-wrap: wrap;
}

/* ── Detail panes ───────────────────────────────────────────── */

.cx-detail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
.cx-detail-side { display: flex; flex-direction: column; gap: 22px; }
.cx-lede { font-size: 15px; line-height: 1.6; color: var(--cx-ink); max-width: 62ch; }
.cx-claim { font-size: 21px; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; max-width: 24ch; }
.cx-verdict { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--cx-line); border-bottom: 1px solid var(--cx-line); margin: 18px 0 24px; }
.cx-verdict-main { display: flex; flex-direction: column; gap: 3px; }
.cx-verdict-label { font-size: 16px; font-weight: 650; }
.cx-assessment { padding: 13px 0; border-bottom: 1px solid var(--cx-line); display: flex; flex-direction: column; gap: 6px; }
.cx-assessment:last-child { border-bottom: 0; }
.cx-assessment-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; }

/* ── Utility ────────────────────────────────────────────────── */

.cx-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cx-stack { display: flex; flex-direction: column; gap: 22px; }
.cx-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-divider { height: 1px; background: var(--cx-line); margin: 26px 0; border: 0; }
.cx-load-more { display: flex; justify-content: center; padding: 20px 0 0; }

/* ── Tablet ─────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root { --cx-gutter: 22px; --cx-rail: 260px; }
  .cx-cols { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  /* The rail becomes a normal section in the content order, not a column. */
  .cx-rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px; }
  .cx-detail { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cx-detail-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
}

/* ── Mobile ─────────────────────────────────────────────────── */

@media (max-width: 720px) {
  :root { --cx-gutter: 16px; }
  .cx-page { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .cx-subnav { padding: 0 var(--cx-gutter); }
  .cx-subnav-brand { display: none; }
  .cx-navlink { padding: 13px 11px 11px; font-size: 13px; }

  .cx-head { padding: 20px 0 14px; margin-bottom: 18px; align-items: flex-start; }
  .cx-head h1 { font-size: 21px; }
  .cx-head p { font-size: 13px; }
  .cx-head-actions { width: 100%; }
  .cx-head-actions .cx-btn { flex: 1 1 auto; }

  /* Summary becomes a horizontally scrollable strip rather than 5 squeezed
     columns; each item stays readable at 320px. */
  .cx-summary {
    display: flex; overflow-x: auto; scrollbar-width: none;
    scroll-snap-type: x proximity; margin-bottom: 26px;
  }
  .cx-summary::-webkit-scrollbar { display: none; }
  .cx-summary-item { flex: 0 0 auto; min-width: 132px; scroll-snap-align: start; }

  .cx-cards { grid-template-columns: minmax(0, 1fr); }
  .cx-row { grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 12px 8px; margin: 0 -8px; width: calc(100% + 16px); }
  /* Actions move under the content instead of being squeezed beside it. */
  .cx-row-side { grid-column: 1 / -1; justify-content: flex-start; padding-left: 45px; }
  .cx-row-side:empty { display: none; }

  .cx-toolbar { gap: 7px; padding-bottom: 13px; }
  .cx-search { flex: 1 1 100%; }
  .cx-toolbar-count { margin-left: 0; width: 100%; }

  .cx-phead { padding: 16px 0; gap: 14px; }
  .cx-phead h1 { font-size: 21px; }
  .cx-logo-xl { width: 54px; height: 54px; border-radius: 12px; font-size: 21px; }
  .cx-banner { height: 108px; margin-bottom: -22px; }
  .cx-phead-actions { width: 100%; }
  .cx-phead-actions .cx-btn { flex: 1 1 auto; }

  .cx-dl { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .cx-dl dt { margin-top: 10px; font-size: 12px; }
  .cx-tl { grid-template-columns: auto minmax(0, 1fr); gap: 11px; }
  .cx-tl-date { grid-column: 1 / -1; }
  .cx-contract, .cx-evidence-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .cx-contract-actions { justify-content: flex-start; }

  .cx-field-row { grid-template-columns: minmax(0, 1fr); }

  /* Dialogs become bottom sheets: reachable, and they never sit behind the
     on-screen keyboard because the body scrolls and the footer is pinned. */
  .cx-overlay { padding: 0; align-items: flex-end; }
  .cx-dialog {
    max-width: none; max-height: 92dvh; border-radius: var(--cx-r) var(--cx-r) 0 0;
    border-bottom: 0; animation: cx-sheet .22s cubic-bezier(.2, .8, .3, 1);
  }
  .cx-dialog-head::before {
    content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 34px; height: 3px; border-radius: 2px; background: var(--cx-line-strong);
  }
  .cx-dialog-head { position: relative; padding-top: 20px; }
  .cx-dialog-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .cx-dialog-foot .cx-btn { flex: 1 1 auto; }
}
@keyframes cx-sheet { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }

@media (max-width: 380px) {
  :root { --cx-gutter: 13px; }
  .cx-head h1 { font-size: 19px; }
  .cx-navlink { padding: 12px 9px 10px; font-size: 12.5px; }
  .cx-row-side { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-btn, .cx-row, .cx-card, .cx-navlink, .cx-summary-item { transition: none; }
  .cx-skel::after { animation: none; }
  .cx-dialog { animation: none; }
}
