:root {
  color-scheme: light;
  --ember: oklch(62% 0.16 42);
  --ember-deep: oklch(49% 0.14 40);
  --paper: oklch(95.8% 0.009 85);
  --canvas: oklch(99.2% 0.006 85);
  --wash: oklch(92.4% 0.011 85);
  --surface-subtle: oklch(97.7% 0.006 85);
  --surface-hover: oklch(98.3% 0.006 85);
  --surface-translucent: oklch(99.2% 0.006 85 / 0.62);
  --ink: oklch(24% 0.012 165);
  --ink-secondary: oklch(31% 0.012 165);
  --ink-muted: oklch(50% 0.016 155);
  --rule: oklch(86.4% 0.011 85);
  --rule-strong: oklch(75.5% 0.013 82);
  --rule-dashed: oklch(79.5% 0.012 82);
  --positive: oklch(52% 0.105 158);
  --caution: oklch(56% 0.105 72);
  --danger: oklch(52% 0.13 28);
  --info: oklch(52% 0.09 240);
  --info-strong: oklch(43% 0.09 240);
  --positive-wash: oklch(94% 0.035 155);
  --caution-wash: oklch(95% 0.045 82);
  --danger-wash: oklch(94% 0.035 28);
  --info-wash: oklch(94% 0.03 235);
  --ember-wash: oklch(94% 0.045 45);
  --positive-border: oklch(82% 0.055 155);
  --caution-border: oklch(82% 0.07 82);
  --danger-border: oklch(82% 0.055 28);
  --info-border: oklch(82% 0.045 235);
  --ember-border: oklch(82% 0.075 42);
  --positive-ink: oklch(43% 0.095 155);
  --caution-ink: oklch(43% 0.09 72);
  --danger-ink: oklch(43% 0.12 28);
  --ember-ink: oklch(48% 0.145 40);
  --overlay: oklch(24% 0.012 165 / 0.25);
  --inspector-shadow: 0 18px 48px oklch(24% 0.012 165 / 0.14);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius-control: 6px;
  --radius-panel: 10px;
  --radius-large: 14px;
  --focus: 0 0 0 3px oklch(62% 0.16 42 / 0.24);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ember: oklch(70% 0.15 45);
  --ember-deep: oklch(78% 0.12 50);
  --paper: oklch(18% 0.012 70);
  --canvas: oklch(22.5% 0.012 70);
  --wash: oklch(27.5% 0.013 70);
  --surface-subtle: oklch(25% 0.012 70);
  --surface-hover: oklch(28.5% 0.014 70);
  --surface-translucent: oklch(24% 0.012 70 / 0.72);
  --ink: oklch(92% 0.009 82);
  --ink-secondary: oklch(84% 0.01 82);
  --ink-muted: oklch(69% 0.014 82);
  --rule: oklch(34% 0.014 70);
  --rule-strong: oklch(44% 0.016 70);
  --rule-dashed: oklch(42% 0.016 70);
  --positive: oklch(73% 0.11 157);
  --caution: oklch(78% 0.11 80);
  --danger: oklch(72% 0.13 28);
  --info: oklch(76% 0.095 235);
  --info-strong: oklch(82% 0.085 235);
  --positive-wash: oklch(29% 0.045 155);
  --caution-wash: oklch(30% 0.045 78);
  --danger-wash: oklch(29% 0.05 28);
  --info-wash: oklch(29% 0.04 235);
  --ember-wash: oklch(30% 0.055 42);
  --positive-border: oklch(46% 0.065 155);
  --caution-border: oklch(48% 0.07 78);
  --danger-border: oklch(46% 0.065 28);
  --info-border: oklch(46% 0.055 235);
  --ember-border: oklch(48% 0.085 42);
  --positive-ink: oklch(82% 0.09 155);
  --caution-ink: oklch(84% 0.09 80);
  --danger-ink: oklch(82% 0.1 28);
  --ember-ink: oklch(82% 0.11 48);
  --overlay: oklch(8% 0.008 70 / 0.62);
  --inspector-shadow: 0 18px 48px oklch(8% 0.008 70 / 0.45);
  --focus: 0 0 0 3px oklch(70% 0.15 45 / 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--info);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--info-strong);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--canvas);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.brand,
.topbar-meta,
.freshness-clocks,
.app-actions,
.clock,
.filter-group,
.row-identity,
.row-actions,
.status-line,
.metric-pair,
.inspector-actions,
.source-title {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--canvas);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 0.73rem;
}

.freshness-clocks {
  gap: 8px;
}

.topbar-meta {
  gap: 8px;
}

.app-actions {
  gap: 6px;
}

.clock {
  gap: 8px;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
}

.clock span:last-child {
  display: grid;
  gap: 1px;
}

.clock b,
.clock small {
  line-height: 1.2;
}

.clock b {
  font-size: 0.71rem;
  font-weight: 680;
}

.clock small {
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.is-healthy .status-dot {
  background: var(--positive);
}

.is-pending .status-dot {
  background: var(--caution);
}

.is-degraded .status-dot {
  background: var(--danger);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
}

.icon-button:hover {
  border-color: var(--rule-strong);
  background: var(--wash);
}

.icon-button svg,
.search-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-sun {
  display: none;
}

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

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.workspace {
  width: min(1540px, 100%);
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 40px) 56px;
}

.install-hint {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--ember-border);
  border-radius: var(--radius-panel);
  background: var(--ember-wash);
}

.install-hint strong,
.install-hint p {
  margin: 0;
}

.install-hint strong {
  font-size: 0.82rem;
}

.install-hint p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.install-hint button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
  font-size: 0.72rem;
  font-weight: 650;
}

.connection-notice {
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--caution-border);
  border-radius: var(--radius-control);
  background: var(--caution-wash);
  color: var(--caution-ink);
  font-size: 0.78rem;
  font-weight: 620;
}

.briefing {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--ink);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--ember-deep);
  font-size: 0.71rem;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.briefing h2 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 680;
  line-height: 1.24;
  letter-spacing: -0.028em;
}

.briefing-note {
  max-width: 78ch;
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.metric-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, auto));
  gap: 0;
  margin: 0;
}

.metric-rail div {
  min-width: 86px;
  padding: 0 14px;
  border-left: 1px solid var(--rule);
}

.metric-rail dt {
  color: var(--ink-muted);
  font-size: 0.69rem;
  font-weight: 620;
  white-space: nowrap;
}

.metric-rail dd {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.system-notice {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--caution-border);
  border-radius: var(--radius-control);
  background: var(--caution-wash);
  color: var(--caution-ink);
  font-size: 0.8rem;
}

.system-notice.is-error {
  border-color: var(--danger-border);
  background: var(--danger-wash);
  color: var(--danger-ink);
}

.control-deck {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.view-tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.view-tab:hover {
  color: var(--ink);
  background: var(--surface-translucent);
}

.view-tab.is-active {
  border-color: var(--ember);
  color: var(--ink);
}

.tab-count {
  display: inline-block;
  min-width: 20px;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--wash);
  font-size: 0.67rem;
  text-align: center;
}

.search-wrap {
  position: relative;
  display: flex;
  flex: 0 1 360px;
  align-items: center;
}

.search-wrap > svg {
  position: absolute;
  left: 11px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 9px 52px 9px 36px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
  font-size: 0.8rem;
}

.search-wrap input:hover {
  border-color: var(--rule-strong);
}

.search-wrap input:focus {
  border-color: var(--ember);
  outline: none;
  box-shadow: var(--focus);
}

.search-wrap kbd {
  position: absolute;
  right: 8px;
  padding: 2px 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.63rem;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.filter-group {
  gap: 5px;
}

.filter-group + .filter-group {
  padding-left: 12px;
  border-left: 1px solid var(--rule);
}

.filter-chip {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 610;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--rule);
  color: var(--ink);
}

.filter-chip.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--canvas);
}

.archive-loading,
.archive-coverage {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: var(--ink-muted);
  background: var(--canvas);
}

.archive-coverage.is-current {
  border-color: color-mix(in srgb, var(--positive) 38%, var(--rule));
  color: var(--positive);
}

.archive-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.archive-stock-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  color: var(--ink);
  background: var(--canvas);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.archive-stock-card:hover,
.archive-stock-card:focus-visible {
  border-color: var(--ember);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ink) 9%, transparent);
  transform: translateY(-1px);
}

.archive-stock-card strong,
.archive-stock-card small,
.archive-stock-title {
  display: block;
}

.archive-stock-card strong {
  margin: 14px 0 5px;
  font: 700 clamp(1.5rem, 4vw, 2.1rem)/1 var(--font-sans);
}

.archive-stock-card small {
  color: var(--ink-muted);
  line-height: 1.45;
}

.archive-stock-title {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-back {
  margin-bottom: 14px;
}

.archive-stock-summary {
  margin-bottom: 14px;
  padding: 16px;
  border-left: 3px solid var(--ember);
  border-radius: 0 14px 14px 0;
  background: var(--canvas);
}

.archive-stock-summary h3,
.archive-stock-summary p {
  margin: 0;
}

.archive-stock-summary p {
  margin-top: 7px;
  color: var(--ink-muted);
}

.result-count {
  margin: 0 0 0 auto;
  color: var(--ink-muted);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.view-root {
  min-height: 420px;
  padding-top: 18px;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.section-heading p {
  max-width: 74ch;
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.section-heading .section-meta {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 0.72rem;
  text-align: right;
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--canvas);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 0.67rem;
  font-weight: 660;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2),
.data-table th:last-child,
.data-table td:last-child {
  text-align: left;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: var(--surface-hover);
}

.col-token {
  width: 22%;
}

.col-status {
  width: 17%;
}

.col-number {
  width: 10%;
}

.col-evidence {
  width: 18%;
}

.col-action {
  width: 54px;
}

.row-identity {
  gap: 9px;
  min-width: 0;
}

.platform-mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--wash);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 760;
  text-transform: uppercase;
}

.platform-mark.is-long {
  background: var(--info-wash);
  color: var(--info-strong);
}

.identity-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.token-link {
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}

.token-link:hover strong,
.token-link:active strong {
  color: var(--info);
}

.external-hint {
  margin-left: 6px;
  color: var(--info);
  font-size: 0.61rem;
  font-weight: 650;
  letter-spacing: 0;
}

.token-link:hover .external-hint {
  text-decoration: underline;
}

.identity-copy strong,
.identity-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-copy strong {
  font-size: 0.79rem;
  font-weight: 690;
}

.identity-copy small {
  margin-top: 1px;
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.identity-copy .identity-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  overflow: visible;
}

.identity-meta code {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
}

.identity-resolution {
  flex: 0 0 auto;
  font-family: var(--font-sans);
}

.identity-resolution.is-pending,
.identity-resolution.is-partial {
  color: var(--caution-ink);
}

.identity-resolution.is-failed {
  color: var(--danger-ink);
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-muted);
  font-size: 0.63rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
}

.tag.is-new,
.tag.is-focus {
  border-color: var(--ember-border);
  background: var(--ember-wash);
  color: var(--ember-ink);
}

.tag.is-positive {
  border-color: var(--positive-border);
  background: var(--positive-wash);
  color: var(--positive-ink);
}

.tag.is-caution {
  border-color: var(--caution-border);
  background: var(--caution-wash);
  color: var(--caution-ink);
}

.tag.is-danger {
  border-color: var(--danger-border);
  background: var(--danger-wash);
  color: var(--danger-ink);
}

.tag.is-info {
  border-color: var(--info-border);
  background: var(--info-wash);
  color: var(--info-strong);
}

.number,
.metric-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.number.is-unknown {
  color: var(--ink-muted);
}

.number.is-positive {
  color: var(--positive);
}

.number.is-negative {
  color: var(--danger);
}

.evidence-cell {
  color: var(--ink-muted);
  font-size: 0.71rem;
  line-height: 1.35;
}

.evidence-cell strong {
  color: var(--ink);
  font-weight: 650;
}

.row-action {
  min-width: 42px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
  font-size: 0.67rem;
  font-weight: 650;
  line-height: 1;
}

.row-action:hover {
  border-color: var(--ember);
  color: var(--ember-deep);
}

.load-more {
  display: block;
  width: calc(100% - 20px);
  min-height: 38px;
  margin: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 640;
}

.load-more:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.stock-list {
  display: grid;
  gap: 8px;
}

.stock-group {
  overflow: clip;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--canvas);
}

.stock-group[open] {
  border-color: var(--rule-strong);
}

.stock-group > summary {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) repeat(5, minmax(82px, 0.42fr)) 24px;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}

.stock-group > summary::-webkit-details-marker {
  display: none;
}

.stock-group > summary:hover {
  background: var(--surface-hover);
}

.stock-name {
  min-width: 0;
}

.stock-name strong,
.stock-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-name strong {
  font-size: 0.87rem;
  font-weight: 700;
}

.stock-name small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.summary-metric {
  text-align: right;
}

.summary-metric span,
.summary-metric b {
  display: block;
}

.summary-metric span {
  color: var(--ink-muted);
  font-size: 0.63rem;
}

.summary-metric b {
  margin-top: 2px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.disclosure-chevron {
  width: 9px;
  height: 9px;
  justify-self: end;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.stock-group[open] .disclosure-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.stock-group-body {
  border-top: 1px solid var(--rule);
}

.company-strip {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.company-strip strong {
  color: var(--ink);
}

.measurement-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.measurement-strip strong {
  color: var(--ink);
}

.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.health-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--canvas);
}

.health-panel > header {
  padding: 13px 14px;
  border-bottom: 1px solid var(--rule);
}

.health-panel > header h3 {
  margin: 0;
  font-size: 0.86rem;
}

.health-panel > header p {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

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

.source-item {
  display: grid;
  grid-template-columns: minmax(145px, 0.4fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
}

.source-item:last-child {
  border-bottom: 0;
}

.source-title {
  gap: 7px;
  font-weight: 650;
}

.source-item p {
  margin: 0;
  color: var(--ink-muted);
}

.metadata-coverage-panel {
  margin-top: 18px;
}

.metadata-coverage-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metadata-coverage-list .source-item:nth-child(odd) {
  border-right: 1px solid var(--rule);
}

.identity-note {
  margin-top: 9px !important;
  padding: 8px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}

.identity-note.is-pending,
.identity-note.is-partial {
  border-color: var(--caution-border);
  background: var(--caution-wash);
  color: var(--caution-ink);
}

.identity-note.is-failed {
  border-color: var(--danger-border);
  background: var(--danger-wash);
  color: var(--danger-ink);
}

.rpc-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0;
  padding: 14px;
  font-size: 0.73rem;
}

.rpc-list dt {
  color: var(--ink-muted);
}

.rpc-list dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.method-note {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--wash);
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.method-note strong {
  color: var(--ink);
}

.empty-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  padding: 32px;
  border: 1px dashed var(--rule-dashed);
  border-radius: var(--radius-panel);
  background: var(--surface-translucent);
  text-align: center;
}

.empty-state svg {
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  fill: none;
  stroke: var(--ink-muted);
  stroke-linecap: round;
  stroke-width: 1.4;
}

.empty-state h3 {
  margin: 0;
  font-size: 0.92rem;
}

.empty-state p {
  max-width: 44ch;
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.footer {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 3vw, 40px);
  border-top: 1px solid var(--rule);
  background: var(--canvas);
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.footer p {
  margin: 0;
}

.footer div {
  display: flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
}

.inspector {
  width: min(620px, calc(100vw - 28px));
  max-width: none;
  height: calc(100vh - 28px);
  max-height: none;
  margin: 14px 14px 14px auto;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-large);
  background: var(--canvas);
  box-shadow: var(--inspector-shadow);
  color: var(--ink);
}

.inspector::backdrop {
  background: var(--overlay);
}

.inspector-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.inspector-header {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--rule);
}

.inspector-header h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.inspector-body {
  overflow-y: auto;
  padding: 18px 20px 32px;
}

.inspector-section {
  padding: 17px 0;
  border-bottom: 1px solid var(--rule);
}

.inspector-section:first-child {
  padding-top: 0;
}

.inspector-section:last-child {
  border-bottom: 0;
}

.inspector-section h3 {
  margin: 0 0 9px;
  font-size: 0.83rem;
  font-weight: 700;
}

.inspector-section p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  line-height: 1.62;
}

.inspector-section p + p {
  margin-top: 8px;
}

.contract-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.contract-line code {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button,
.text-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 640;
}

.copy-button:hover,
.text-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.inspector-actions {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
}

.metric-grid div {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.metric-grid div:nth-child(3n) {
  border-right: 0;
}

.metric-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.metric-grid small,
.metric-grid strong {
  display: block;
}

.metric-grid small {
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.metric-grid strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness-note {
  margin-bottom: 10px !important;
  padding: 8px 9px;
  border-radius: var(--radius-control);
  background: var(--caution-wash);
  color: var(--caution-ink) !important;
  font-size: 0.7rem !important;
}

.freshness-note.is-current {
  background: var(--positive-wash);
  color: var(--positive-ink) !important;
}

.association-level {
  margin-bottom: 8px;
}

.trend-chart {
  width: 100%;
  height: auto;
  min-height: 154px;
  overflow: visible;
}

.trend-chart .axis {
  stroke: var(--rule);
  stroke-width: 1;
}

.trend-chart .series {
  fill: none;
  stroke: var(--ember);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.trend-chart .point {
  fill: var(--canvas);
  stroke: var(--ember);
  stroke-width: 2;
}

.trend-chart text {
  fill: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 9px;
}

.trend-caption {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.timeline {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-step {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  font-size: 0.63rem;
}

.post-list {
  display: grid;
  gap: 7px;
}

.post-item {
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--surface-hover);
}

.post-item summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.post-item summary::-webkit-details-marker {
  display: none;
}

.post-item summary span:first-child {
  min-width: 0;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-body {
  padding: 0 10px 11px;
}

.post-body p {
  font-size: 0.72rem;
}

.post-meta {
  margin-top: 8px !important;
  color: var(--ink-muted) !important;
  font-size: 0.65rem !important;
}

.post-significance {
  margin-top: 8px !important;
  padding-left: 9px;
  border-left: 1px solid var(--ember);
  color: var(--ink) !important;
}

@media (max-width: 1050px) {
  .briefing {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .metric-rail {
    width: 100%;
    grid-template-columns: repeat(5, 1fr);
  }

  .metric-rail div:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .health-grid {
    grid-template-columns: 1fr;
  }

  .stock-group > summary {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(76px, 0.35fr)) 24px;
  }

  .stock-group > summary .summary-metric:nth-of-type(n + 4) {
    display: none;
  }

  .data-table .optional-column {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 8px;
    align-items: center;
  }

  .brand p {
    display: none;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .brand h1 {
    font-size: 0.9rem;
  }

  .topbar-meta {
    display: contents;
  }

  .app-actions {
    grid-row: 1;
    grid-column: 2;
    gap: 4px;
  }

  .app-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .freshness-clocks {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
  }

  .clock {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    padding: 6px 8px;
  }

  .clock small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    padding-top: 20px;
  }

  .install-hint {
    align-items: flex-start;
  }

  .briefing {
    padding-bottom: 18px;
  }

  .briefing h2 {
    font-size: 1.28rem;
  }

  .metric-rail {
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
  }

  .metric-rail div,
  .metric-rail div:first-child {
    padding: 8px 10px;
    border-left: 0;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }

  .metric-rail div:nth-child(2n) {
    border-right: 0;
  }

  .metric-rail div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }

  .metric-rail div:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }

  .control-deck {
    display: grid;
    gap: 10px;
  }

  .search-wrap {
    grid-row: 1;
    width: 100%;
    max-width: none;
  }

  .view-tabs {
    grid-row: 2;
  }

  .filter-bar {
    align-items: flex-start;
    overflow-x: auto;
  }

  .filter-group {
    flex: 0 0 auto;
  }

  .result-count {
    display: none;
  }

  .table-shell,
  .table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table,
  .data-table tbody {
    display: block;
    width: 100%;
  }

  .data-table thead,
  .data-table colgroup {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 8px;
  }

  .data-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding: 11px 12px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-panel);
    background: var(--canvas);
  }

  .data-table tbody tr:hover td {
    background: transparent;
  }

  .data-table td {
    display: block;
    padding: 4px 0;
    border: 0;
    text-align: left;
  }

  .data-table td:first-child,
  .data-table td:nth-child(2),
  .data-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .data-table td:first-child {
    padding-right: 58px;
  }

  .data-table td:nth-child(3)::before,
  .data-table td:nth-child(4)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.61rem;
    font-weight: 620;
  }

  .data-table td:nth-child(7) {
    padding-top: 7px;
    border-top: 1px solid var(--rule);
  }

  .data-table td:last-child {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
  }

  .data-table .row-action {
    min-width: 46px;
  }

  .stock-group > summary {
    grid-template-columns: minmax(0, 1fr) 82px 24px;
  }

  .stock-group > summary .summary-metric:nth-of-type(n + 2) {
    display: none;
  }

  .company-strip {
    line-height: 1.55;
  }

  .footer {
    display: grid;
  }

  .footer div {
    flex-wrap: wrap;
    white-space: normal;
  }

  .metadata-coverage-list {
    grid-template-columns: 1fr;
  }

  .metadata-coverage-list .source-item:nth-child(odd) {
    border-right: 0;
  }

  .identity-copy .identity-meta {
    flex-wrap: wrap;
    row-gap: 1px;
  }

  .inspector {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-grid div {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }

  .metric-grid div:nth-child(3n) {
    border-right: 1px solid var(--rule);
  }

  .metric-grid div:nth-child(2n) {
    border-right: 0;
  }

  .metric-grid div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--rule);
  }

  .metric-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (display-mode: standalone) {
  .topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
