/* ==========================================================================
   Newsdesk Mini App — Pocket Market Terminal Design System
   Mobile-first (390px), strict CSP (classes only, zero inline styles).
   ========================================================================== */

:root {
  --bg: #f4f6f9;
  --surface-1: #ffffff;
  --surface-2: #eef2f6;
  --surface-3: #e3e8ef;
  --fg: #0f172a;
  --fg-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: rgba(15, 23, 42, 0.085);
  --border-strong: rgba(15, 23, 42, 0.16);
  --topbar-bg: rgba(244, 246, 249, 0.86);
  --tabbar-bg: rgba(255, 255, 255, 0.92);

  --accent: #2563eb;
  --accent-fg: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.11);

  --up: #059669;
  --up-soft: rgba(5, 150, 105, 0.12);
  --down: #e11d48;
  --down-soft: rgba(225, 29, 72, 0.11);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.13);
  --macro: #6366f1;
  --macro-soft: rgba(99, 102, 241, 0.12);

  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 15px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #090b10;
    --surface-1: #12161f;
    --surface-2: #191f2c;
    --surface-3: #232b3d;
    --fg: #f1f5f9;
    --fg-2: #cbd5e1;
    --muted: #8b98ad;
    --faint: #5b677a;
    --border: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.15);
    --topbar-bg: rgba(9, 11, 16, 0.84);
    --tabbar-bg: rgba(16, 20, 28, 0.94);

    --accent: #3b82f6;
    --accent-fg: #ffffff;
    --accent-soft: rgba(59, 130, 246, 0.16);

    --up: #10b981;
    --up-soft: rgba(16, 185, 129, 0.15);
    --down: #f43f5e;
    --down-soft: rgba(244, 63, 94, 0.15);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.16);
    --macro: #818cf8;
    --macro-soft: rgba(129, 140, 248, 0.16);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

:root[data-scheme="dark"] {
  --bg: #090b10;
  --surface-1: #12161f;
  --surface-2: #191f2c;
  --surface-3: #232b3d;
  --fg: #f1f5f9;
  --fg-2: #cbd5e1;
  --muted: #8b98ad;
  --faint: #5b677a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --topbar-bg: rgba(9, 11, 16, 0.84);
  --tabbar-bg: rgba(16, 20, 28, 0.94);

  --accent: #3b82f6;
  --accent-fg: #ffffff;
  --accent-soft: rgba(59, 130, 246, 0.16);

  --up: #10b981;
  --up-soft: rgba(16, 185, 129, 0.15);
  --down: #f43f5e;
  --down-soft: rgba(244, 63, 94, 0.15);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --macro: #818cf8;
  --macro-soft: rgba(129, 140, 248, 0.16);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Numeric alignment everywhere */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Boot & Gate */
.boot-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 75vh;
  gap: 6px;
}
.boot-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.boot-sub {
  font-size: 13px;
  color: var(--muted);
}

/* App Shell */
.shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-decoration: none;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-pill-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.icon-pill svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Status Dot */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.status-dot-fresh { background: var(--up); }
.status-dot-stale { background: var(--warn); }

/* Main Content Area */
.content {
  padding: 12px 14px 8px;
}

.footer-note {
  margin: 22px 14px 8px;
  text-align: center;
  font-size: 11.5px;
  color: var(--faint);
}

/* Bottom Tab Bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 520px;
  margin: 0 auto;
  background: var(--tabbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tab-item svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab-item[aria-current="page"] {
  color: var(--accent);
}
.tab-item[aria-current="page"] svg {
  stroke-width: 2.2;
}

/* Section Headers & Segmented Controls */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 8px;
}
.section-head-first {
  margin-top: 2px;
}
.section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.page-title {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.subtle-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.seg-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.seg-bar::-webkit-scrollbar { display: none; }

.seg-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg-pill-active {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

/* ==========================================================================
   Compact Market Tape Strip (2-row horizontal grid, replaces tall snapshot list)
   ========================================================================== */
.tape-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: minmax(126px, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tape-grid::-webkit-scrollbar { display: none; }

.tape-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  padding: 8px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.tape-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tape-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}
.tape-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}
.tape-chg {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   Shared Tokens: Ticker Pills, Move Badges, Signal Dots, Micro Tags
   ========================================================================== */
.ticker-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex-shrink: 0;
}
.ticker-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mkt-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.mkt-tag-halt {
  background: var(--warn-soft);
  color: var(--warn);
}
.mkt-tag-macro {
  background: var(--macro-soft);
  color: var(--macro);
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.delta-up {
  background: var(--up-soft);
  color: var(--up);
}
.delta-down {
  background: var(--down-soft);
  color: var(--down);
}
.delta-flat {
  background: var(--surface-2);
  color: var(--muted);
}

.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-muted { color: var(--muted); }

.sig-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sig-dot-up { background: var(--up); }
.sig-dot-down { background: var(--down); }
.sig-dot-neutral { background: var(--border-strong); }

/* ==========================================================================
   Cards & Structured Post Views (Zero Emoji Slop)
   ========================================================================== */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.card-compact {
  padding: 10px 12px;
  margin-bottom: 8px;
}
.card-bull {
  border-left: 3px solid var(--up);
}
.card-bear {
  border-left: 3px solid var(--down);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.card-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brief-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.brief-tape-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.brief-synopsis {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-2);
}

.brief-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.brief-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.brief-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.brief-row-main {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
.brief-row-main .sig-dot {
  margin-top: 7px;
}

.brief-row-text {
  min-width: 0;
  flex: 1;
}

.headline-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.38;
}
.headline-link:hover {
  color: var(--accent);
}

.sub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.ext-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.drawer-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.drawer-list li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.drawer-list li:last-child {
  border-bottom: 0;
}

/* On-Deck Catalyst Strip on Today */
.ondeck-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.ondeck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}
.ondeck-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.ondeck-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-2);
}
.ondeck-row > .sub-meta {
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0;
}

/* ==========================================================================
   Radar: Bullish / Bearish Skew Cards, Chips, Read-through & Insiders
   ========================================================================== */
.skew-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.skew-title-group {
  min-width: 0;
}
.company-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skew-right {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  flex-shrink: 0;
}
.score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 6px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.score-badge span {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.score-bull { background: var(--up-soft); color: var(--up); }
.score-bear { background: var(--down-soft); color: var(--down); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.evidence-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 500;
}

.skew-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

/* ==========================================================================
   Sparklines & Area Charts
   ========================================================================== */
.spark-sm {
  display: block;
  width: 78px;
  height: 28px;
  overflow: visible;
  flex-shrink: 0;
}
.spark-md {
  display: block;
  width: 100%;
  height: 54px;
  margin: 8px 0 4px;
  overflow: visible;
}
.chart-lg {
  display: block;
  width: 100%;
  height: 118px;
  margin: 8px 0 6px;
  overflow: visible;
}
.spark-line {
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-up .spark-line { stroke: var(--up); }
.spark-down .spark-line { stroke: var(--down); }
.spark-up .spark-area { fill: var(--up); opacity: 0.12; }
.spark-down .spark-area { fill: var(--down); opacity: 0.12; }

/* ==========================================================================
   Claims (Friends Prediction League)
   ========================================================================== */
.slots-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}
.slot-pips {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
}
.pip-used {
  background: var(--accent);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn-ghost {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger-ghost {
  background: var(--down-soft);
  border-color: transparent;
  color: var(--down);
}
.btn-up-ghost {
  background: var(--up-soft);
  border-color: transparent;
  color: var(--up);
}

/* Composer Form */
.composer {
  background: var(--surface-1);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 10px 0 5px;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.text-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px; /* Prevents iOS auto-zoom */
  font-family: var(--font-sans);
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.preset-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.preset-btn-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.dir-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dir-opt {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.dir-opt-up {
  background: var(--up-soft);
  border-color: var(--up);
  color: var(--up);
}
.dir-opt-down {
  background: var(--down-soft);
  border-color: var(--down);
  color: var(--down);
}

.audacity-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.audacity-pts {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Claim Card & SVG Progress Bar */
.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.claim-call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0 4px;
}
.claim-target {
  white-space: nowrap;
  font-size: 13px;
}
.claim-spot {
  white-space: nowrap;
  font-size: 12px;
  text-align: right;
}
.claim-note {
  margin: 6px 0 2px;
  padding-left: 8px;
  border-left: 2px solid var(--border-strong);
  font-size: 12.5px;
  color: var(--fg-2);
  font-style: italic;
}
.prog-svg {
  display: block;
  width: 100%;
  height: 6px;
  margin: 7px 0 5px;
  border-radius: 3px;
  overflow: hidden;
}
.prog-track { fill: var(--surface-3); }
.prog-fill-ok { fill: var(--up); }
.prog-fill-warn { fill: var(--down); }
.prog-fill-accent { fill: var(--accent); }

.claim-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Tables & KPI Tiles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.kpi-tile {
  padding: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
.kpi-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
}
.kpi-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.clean-table-wrap {
  overflow-x: auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.clean-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.clean-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-2);
}
.clean-table tr:last-child td {
  border-bottom: 0;
}

/* Search Form */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-bar .text-input {
  flex: 1;
}

/* Empty & Error States */
.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin: 10px 0;
}
.alert-banner {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--down-soft);
  color: var(--down);
  font-size: 12.5px;
  font-weight: 500;
  margin: 8px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
