* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

::selection { color: var(--on-accent); background: var(--accent-fill); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input::placeholder { color: var(--muted); opacity: 1; }
a { color: inherit; }
#main-content { min-height: calc(100svh - 272px); outline: none; }
.skip-link { position: fixed; top: 10px; left: 20px; z-index: 100; padding: 10px 18px; color: var(--on-accent); background: var(--accent-fill); border-radius: var(--radius); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.boot-state { min-height: 65svh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.boot-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 900ms ease-in-out infinite alternate; }

button,
input,
select {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

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

.login-shell {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 10% 18%, var(--bloom), transparent 52%);
}

.auth-layout {
  position: relative;
  width: min(var(--page-width), 100%);
  min-height: min(780px, calc(100svh - 74px));
  margin: 0 auto;
  padding: clamp(40px, 7vh, 96px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
}
.login-story { min-width: 0; animation: enter-panel 700ms var(--ease) both; }
.login-story .eyebrow { margin-bottom: 28px; }
.login-story h1 { margin: 0; font: 400 clamp(44px, 4.7vw, 68px)/1.04 var(--font-display); letter-spacing: -0.035em; }
.login-story h1 em { color: var(--accent); font-weight: 400; }
.login-lede { margin: 26px 0 8px; font-size: 18px; font-weight: 500; }
.login-description { max-width: 37em; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.source-collection { max-width: 470px; margin-top: 34px; }
.source-collection-heading { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font: 10px/1.5 var(--font-mono); letter-spacing: 0.08em; }
.source-card { display: flex; align-items: center; gap: 15px; padding: 15px 2px; border-bottom: 1px solid var(--line); animation: enter-row 650ms var(--ease) both; }
.source-card:nth-child(3) { animation-delay: 80ms; }
.source-card:nth-child(4) { animation-delay: 160ms; }
.source-number { color: var(--muted); font: 11px var(--font-mono); }
.source-card > svg { color: var(--accent); width: 19px; height: 19px; }
.source-card strong { display: block; font-size: 13px; font-weight: 500; }
.source-card small { display: block; margin-top: 2px; color: var(--muted); font: 9px var(--font-mono); letter-spacing: 0.08em; }
.source-format { margin-left: auto; padding: 3px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font-size: 10px; }
.login-caption { display: flex; gap: 9px; align-items: center; margin: 20px 0 0; color: var(--muted); font-size: 11px; }
.login-caption > span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.login-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  justify-self: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(26px, 3.4vw, 44px);
  box-shadow: var(--shadow);
  animation: enter-panel 750ms 80ms var(--ease) both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font: 10px/1.5 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-heading h2,
.section-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
}

.login-heading h2 {
  font-size: 30px;
}

.login-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-note { display: flex; align-items: flex-start; gap: 7px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.login-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 28px;
  padding: 3px;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.auth-tab {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.auth-tabs + .login-form {
  margin-top: 20px;
}

.login-form label,
.filter-field {
  display: grid;
  gap: 7px;
}

.login-form label > span:first-child,
.filter-field > span,
.filter-field legend {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.input-shell,
.query-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within,
.query-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-shell svg,
.query-field svg {
  flex: 0 0 auto;
  margin-left: 13px;
  color: var(--muted);
}

.input-shell input,
.query-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 11px 13px;
  background: transparent;
}

.form-error {
  min-height: 20px;
  margin: -6px 0 -4px;
  color: var(--danger);
  font-size: 12px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button {
  min-height: 42px;
  gap: 9px;
  padding: 0 18px;
  font-weight: 700;
}

.button-primary {
  color: var(--on-accent);
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}

.button-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover,
.icon-button:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.login-submit {
  width: 100%;
}

.login-submit svg {
  margin-left: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--scrim);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.25);
}

.topbar-inner {
  width: min(var(--page-width), 100%);
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.wordmark-icon {
  position: relative;
  width: 23px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--accent);
}
.wordmark-icon::before, .wordmark-icon::after { content: ""; position: absolute; top: 2px; width: 8px; background: currentColor; border-radius: 2px; }
.wordmark-icon::before { left: 0; height: 25px; }
.wordmark-icon::after { right: 0; height: 11px; opacity: 0.7; }

.wordmark > span:last-child {
  display: grid;
  line-height: 1.1;
}

.wordmark strong {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.035em;
}
.wordmark strong > span { color: var(--accent); }

.wordmark small {
  margin-top: 3px;
  color: var(--muted);
  font: 9px var(--font-mono);
  letter-spacing: 0.16em;
}

.topbar-actions,
.account-controls,
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-actions { margin-left: auto; }
.account-controls { padding-left: 10px; border-left: 1px solid var(--line); }
.theme-control { display: flex; align-items: center; gap: 5px; padding: 0 8px; min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--secondary); background: var(--surface); }
.theme-control > svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.theme-control select { width: 145px; min-width: 0; min-height: 36px; border: 0; background: transparent; font-size: 11px; cursor: pointer; }
.theme-control:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-control select:focus { outline: none; }

.primary-nav {
  display: flex;
  align-self: stretch;
  gap: 3px;
  margin-left: 18px;
}

.primary-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.primary-nav-item::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 240ms var(--ease);
}

.primary-nav-item.active {
  color: var(--ink);
}

.primary-nav-item.active::after {
  transform: scaleX(1);
}
.primary-nav-item:hover { color: var(--accent); background: var(--bloom); }

.primary-nav-item svg {
  width: 16px;
  height: 16px;
}

.account-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  text-decoration: none;
}

.workspace {
  width: min(var(--page-width), 100%);
  margin: 0 auto;
  padding: 52px var(--gutter) 72px;
}

.page-description { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

.topbar, .login-panel, .chart-panel, .overview-kpi, .results-list,
.site-footer, .filter-menu, .filter-dropdown > summary,
.viewer-dialog, .docs-dialog, .key-dialog {
  transition: background-color 200ms ease, border-color 200ms ease, color 160ms ease;
}

.search-view,
.keys-page,
.overview-page {
  min-width: 0;
  animation: enter-panel 280ms ease-out both;
}

.overview-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
}

.overview-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
}

.storage-breakdown.overview-kpis {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.overview-kpi {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 104px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: enter-row 340ms ease-out both;
}

.overview-kpi-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 50%;
}

.overview-kpi-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.overview-kpi-label,
.overview-kpi-note {
  color: var(--muted);
  font-size: 11px;
}

.overview-kpi-value {
  margin: 1px 0;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-panel {
  min-width: 0;
  min-height: 280px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.chart-panel-wide {
  grid-column: span 2;
}

.chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.chart-heading .eyebrow {
  margin-bottom: 4px;
}

.chart-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 550;
}

.chart-heading > span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.dataset-bars,
.market-bars {
  display: grid;
  gap: 14px;
}

.dataset-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 190px) minmax(0, 1fr) 58px;
  align-items: center;
  gap: 12px;
  animation: enter-row 360ms var(--bar-delay) ease-out both;
}

.dataset-bar-label,
.dimension-head {
  overflow-wrap: anywhere;
  color: var(--secondary);
  font-size: 12px;
}

.dataset-bar-value,
.dimension-head strong {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 5px;
}

.chart-fill {
  display: block;
  height: 100%;
  min-width: 6px;
  background: var(--accent);
  border-radius: inherit;
  transform-origin: left;
  animation: chart-grow 850ms cubic-bezier(0.22, 1, 0.36, 1) var(--bar-delay) both;
}

.chart-fill-secondary {
  background: var(--blue);
}

.dimension-row {
  display: grid;
  gap: 7px;
  animation: enter-row 360ms var(--bar-delay) ease-out both;
}

.dimension-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 180px;
}

.donut-chart {
  position: relative;
  width: 154px;
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  animation: donut-in 700ms ease-out both;
}

.overview-loading {
  min-height: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  grid-column: 1 / -1;
}

.key-dataset-field {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.key-dataset-field legend {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.key-dataset-options {
  min-height: 0;
  max-height: 116px;
  overflow-y: auto;
  align-items: flex-start;
}

.donut-chart::before {
  content: "";
  position: absolute;
  width: 96px;
  height: 96px;
  background: var(--surface);
  border-radius: 50%;
}

.donut-chart span {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.chart-legend {
  display: grid;
  gap: 9px;
}

.legend-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-label {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.legend-value {
  font-variant-numeric: tabular-nums;
}

.radar-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 0.6fr);
  align-items: center;
  gap: 24px;
}

.radar-chart {
  width: 100%;
  min-height: 215px;
  overflow: visible;
}

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

.radar-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.radar-label {
  fill: var(--muted);
  font-size: 10px;
}

.radar-area {
  fill: var(--chart-area);
  stroke: var(--accent);
  stroke-width: 2;
  transform-origin: center;
  animation: radar-in 700ms ease-out both;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 8px;
}

.radar-legend-item {
  padding: 6px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
}

.overview-updated {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.keys-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
}

.keys-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
}

.keys-summary {
  min-height: 22px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.keys-table-shell {
  position: relative;
  min-height: 210px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.keys-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  text-align: left;
}

.keys-table th,
.keys-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 12px;
}

.keys-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

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

.key-name-cell {
  min-width: 150px;
  font-weight: 700;
}

.key-name-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.key-mask-cell code {
  padding: 0;
  color: var(--secondary);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.key-datasets-cell {
  max-width: 230px;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.45;
}

.key-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.key-status::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
}

.key-status.active::before {
  background: var(--success);
}

.key-status.inactive {
  color: var(--muted);
}

.key-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.key-row-actions .button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
}

.key-row-actions .button span {
  display: none;
}

.danger-button {
  color: var(--danger);
}

.keys-empty {
  position: absolute;
  inset: 44px 0 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
}

.keys-empty span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.keys-empty p {
  margin: 0;
}

.search-region {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h1 {
  font-size: clamp(28px, 3vw, 38px);
}

.mode-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.mode-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-control span {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.mode-control svg {
  width: 15px;
  height: 15px;
}

.mode-control input:checked + span {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.mode-control input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.search-form {
  margin-top: 24px;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.query-field {
  min-height: 50px;
  border-radius: var(--radius);
}

.query-field input {
  font-size: 15px;
}

.search-submit {
  min-width: 112px;
  min-height: 50px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.7fr) minmax(320px, 1.4fr);
  gap: 14px;
  margin-top: 17px;
  align-items: end;
}

.filter-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-field input[type="datetime-local"],
.filter-field input[type="date"],
.filter-field input[type="text"],
.filter-field input:not([type]),
.filter-field input[type="number"],
.filter-field select {
  width: 100%;
  height: 39px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  padding: 0 10px;
  background: var(--surface);
}

.filter-dropdown { position: relative; }
.filter-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 39px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.filter-dropdown > summary::-webkit-details-marker { display: none; }
.filter-dropdown > summary svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.filter-dropdown[open] > summary { border-color: var(--accent); }
.filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: 230px;
  max-width: calc(100vw - 48px);
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.filter-menu-datasets { width: 460px; }
.filter-menu-options { display: grid; gap: 3px; }
.filter-menu-datasets .filter-menu-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-menu-heading { display: flex; justify-content: space-between; padding: 4px 8px 10px; color: var(--muted); font-size: 12px; }
.filter-menu-heading button { padding: 0; color: var(--accent-dark); background: none; border: 0; cursor: pointer; }
.filter-menu .choice span { width: 100%; height: 36px; border-color: transparent; font-size: 13px; }
.filter-menu .choice span::before { content: ""; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 3px; margin-right: 9px; flex-shrink: 0; }
.filter-menu .choice input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--surface); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.date-range { display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.date-range > input { min-width: 0; min-inline-size: 0; }
.date-range > span { text-align: center; }
.date-range > span, .filter-hint { color: var(--muted); }
.filter-hint { margin: 9px 0 0; font-size: 12px; }
.subtype-section { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.subtype-section legend { float: left; width: 100%; margin-bottom: 8px; }
.subtype-section legend small { margin-left: 6px; font-weight: 400; color: var(--muted); }
#subtype-options { clear: both; display: grid; gap: 7px; }
.subtype-group { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.subtype-label { min-width: 100px; }
.advanced-filters { margin-top: 14px; }
.advanced-filters > summary { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; }
.advanced-filters > summary svg { width: 14px; height: 14px; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 180px)); gap: 14px; margin-top: 12px; }

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.choice-row {
  min-height: 39px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.subtype-group {
  margin: 4px 0;
}

.subtype-label {
  color: var(--muted);
  font-size: 12px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.choice input:checked + span {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.results-region {
  margin-top: 31px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.results-toolbar h2 {
  margin: 0;
  font-size: 16px;
}

.results-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pagination span {
  min-width: 58px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.results-list {
  min-height: 310px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.initial-state { padding: 28px; text-align: center; background: radial-gradient(ellipse at center, var(--bloom), transparent 68%); }
.initial-state h3 { margin: 4px 0 0; color: var(--ink); font: 400 23px/1.4 var(--font-display); }
.initial-state p { max-width: 32em; font-size: 13px; }
.empty-hints { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 14px; font-size: 11px; }
.empty-hints svg { width: 13px; height: 13px; color: var(--accent); }

.initial-state,
.empty-state,
.loading-state {
  min-height: 310px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.initial-state > span,
.empty-state > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.initial-state p,
.empty-state p {
  margin: 0;
}

.loading-line {
  width: 100%;
  height: 104px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.loading-line::after {
  content: "";
  position: absolute;
  inset: 20px;
  background: var(--surface-soft);
  animation: pulse 1s ease-in-out infinite alternate;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 19px 18px 17px;
  border-bottom: 1px solid var(--line);
  transition: background-color 150ms ease;
  animation: enter-row 220ms ease-out both;
}

.result-row:hover {
  background: var(--surface-hover);
}

.result-main {
  min-width: 0;
}

.result-kicker,
.result-meta,
.result-snippet {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.result-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.result-kicker span:first-child {
  color: var(--accent-dark);
  font-weight: 750;
}

.result-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 550;
  line-height: 1.35;
}

.result-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.result-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 7px;
  color: var(--line-strong);
}

.result-snippet {
  margin-top: 10px;
  color: var(--secondary);
  font-size: 12px;
}

.result-snippet p {
  max-width: 980px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-score {
  color: var(--sage);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.result-actions .button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.drawer-backdrop {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: var(--backdrop);
  animation: fade-in 180ms ease-out;
}

.detail-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
}

.detail-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header,
.viewer-dialog > header,
.docs-dialog > header,
.key-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2,
.viewer-dialog h2,
.docs-dialog h2,
.key-dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 550;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 25px 22px 42px;
}

.detail-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 550;
  line-height: 1.35;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0;
}

.detail-actions .button:first-child:last-child,
.detail-actions .button-structured {
  grid-column: 1 / -1;
}

.detail-section {
  padding: 19px 0;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.representation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.representation-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--line);
  text-align: center;
}

.representation-item.available {
  color: var(--sage);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.representation-item.unavailable {
  color: var(--muted);
  background: var(--surface-soft);
}

.representation-item span {
  font-size: 11px;
  font-weight: 700;
}

.representation-item small {
  font-size: 10px;
}

.detail-section p {
  margin: 0;
  color: var(--secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 18px;
  margin: 0;
}

.metadata-grid div {
  min-width: 0;
}

.metadata-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.metadata-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.viewer-dialog,
.docs-dialog,
.key-dialog {
  width: calc(100vw - 40px);
  height: calc(100vh - 40px);
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.viewer-dialog[open],
.docs-dialog[open],
.key-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: enter-panel 180ms ease-out;
}

.viewer-dialog::backdrop,
.docs-dialog::backdrop,
.key-dialog::backdrop {
  background: var(--backdrop);
}

.viewer-content {
  min-height: 0;
  overflow: auto;
  background: var(--surface-soft);
}

.viewer-content.native-content {
  overflow: hidden;
}

.native-document-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
}

.viewer-content iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.native-document-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  pointer-events: none;
}

.native-document-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 780ms linear infinite;
}

.viewer-text {
  width: min(1080px, calc(100% - 40px));
  min-height: calc(100% - 40px);
  margin: 20px auto;
  padding: 30px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  font: 13px/1.8 var(--font-mono);
}

.docs-dialog {
  width: min(1040px, calc(100vw - 40px));
}

.key-dialog {
  width: min(680px, calc(100vw - 40px));
  height: auto;
  max-width: none;
  max-height: calc(100vh - 40px);
}

.key-content {
  overflow: auto;
  padding: 26px 28px 30px;
}

.key-form {
  display: grid;
  gap: 18px;
}

.key-form label {
  display: grid;
  gap: 7px;
}

.key-form label > span:first-child {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
}

.key-form input,
.key-form select {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
}

.key-form input:focus,
.key-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.key-limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.key-warning {
  margin: 0 0 22px;
  color: var(--danger);
  font-weight: 700;
}

.secret-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.secret-field > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.secret-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.secret-row code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  background: transparent;
  padding: 0;
}

.key-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 18px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.key-meta div {
  min-width: 0;
}

.key-meta dt {
  color: var(--muted);
  font-size: 11px;
}

.key-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.key-help {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.docs-content {
  min-height: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
}

.docs-content > nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 24px 18px;
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
}

.docs-content > nav a {
  padding: 8px 9px;
  color: var(--muted);
  border-radius: 4px;
  text-decoration: none;
}

.docs-content > nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.docs-content article {
  min-width: 0;
  overflow: auto;
  padding: 8px 34px 40px;
}

.docs-content section {
  padding-top: 26px;
}

.docs-content h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 550;
}

.docs-content p {
  color: var(--secondary);
}

.docs-content pre {
  margin: 14px 0;
  padding: 15px 16px;
  overflow: auto;
  color: var(--code-ink);
  background: var(--code-bg);
  border-radius: var(--radius);
}

.docs-content pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  line-height: 1.65;
}

code {
  padding: 2px 5px;
  background: var(--surface-soft);
  border-radius: 3px;
  font: 12px var(--font-mono);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.docs-content th,
.docs-content td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.docs-content th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.docs-content dl {
  margin: 0;
}

.docs-content dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.docs-content dd {
  margin: 0;
  color: var(--secondary);
}

.docs-boundary {
  margin-top: 32px;
  padding: 14px;
  color: var(--accent-dark) !important;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 15px;
  color: var(--canvas);
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: toast-in 180ms ease-out;
}

/* Shared brand chrome stays available before and after authentication. */
.site-footer { border-top: 1px solid var(--line); background: var(--footer); color: var(--secondary); }
.footer-inner { width: min(var(--page-width), 100%); margin: auto; padding: 34px var(--gutter) 20px; }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-brand { font: 400 25px var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.035em; }
.footer-brand > span { color: var(--accent); }
.footer-main p { margin: 7px 0 0; font-size: 12px; }
.footer-label { font: 10px var(--font-mono); letter-spacing: 0.16em; }
.footer-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; text-decoration: none; }
.footer-link svg { width: 15px; height: 15px; transition: transform 200ms var(--ease); }
.footer-link:hover { color: var(--accent); }
.footer-link:hover svg { transform: translate(2px, -2px); }
.footer-base { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 24px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 10px; }
.footer-base > span:last-child { font-family: var(--font-mono); text-align: right; }
.footer-filing { text-decoration: none; white-space: nowrap; }
.footer-filing:hover { text-decoration: underline; }

@keyframes enter-panel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes enter-row {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes chart-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes donut-in {
  from { transform: rotate(-18deg) scale(0.82); opacity: 0; }
  to { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes radar-in {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 1180px) {
  .account-name { max-width: 80px; }
  .topbar-inner { gap: 14px; }
  .primary-nav { margin-left: 0; }
  .primary-nav-item { padding-inline: 10px; }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-date-field { grid-column: 1 / -1; max-width: 540px; }

  .filter-wide {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .topbar-inner { display: grid; grid-template-columns: auto 1fr; min-height: 74px; gap: 0 14px; padding-block: 12px; }
  body[data-session="authenticated"] .topbar-inner { padding-bottom: 0; }
  .topbar-actions { display: contents; }
  .theme-control { grid-column: 2; grid-row: 1; justify-self: end; }
  .theme-control select { width: 135px; font-size: 10px; }
  .account-controls { grid-column: 2; grid-row: 2; justify-self: end; gap: 2px; padding-left: 6px; z-index: 1; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; padding-right: 90px; min-height: 47px; }
  .primary-nav-item { flex: 1; justify-content: center; white-space: nowrap; }
  .wordmark strong { font-size: 22px; }
  .wordmark-icon { width: 21px; }
  .account-name { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .auth-layout { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 30px; padding-block: 38px 44px; }
  .login-story { max-width: 430px; width: 100%; margin-inline: auto; }
  .login-story h1 { font-size: clamp(40px, 9vw, 56px); }
  .login-story .eyebrow { margin-bottom: 18px; }
  .login-lede { margin-top: 20px; font-size: 16px; }
  .login-description { font-size: 13px; }
  .source-collection, .login-caption { display: none; }
  .login-panel { justify-self: center; }
  .footer-main { flex-wrap: wrap; gap: 24px; }
  .footer-note { display: none; }
  .footer-link { margin-left: auto; }
  .footer-base { display: flex; flex-wrap: wrap; justify-content: center; }
  .primary-nav-item {
    padding: 0 9px;
  }

  .primary-nav-item::after {
    right: 8px;
    left: 8px;
  }

  .workspace {
    padding: 32px var(--gutter) 48px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .keys-header {
    align-items: stretch;
    flex-direction: column;
  }

  .keys-header .button {
    align-self: flex-start;
  }

  .section-heading h1 {
    font-size: 27px;
  }

  .mode-control {
    width: 100%;
  }

  .mode-control span {
    justify-content: center;
  }

  .query-row {
    grid-template-columns: 1fr;
  }

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

  .filter-wide {
    grid-column: 1 / -1;
  }

  .result-row {
    grid-template-columns: 1fr;
    padding: 17px 12px;
  }

  .result-actions {
    justify-content: flex-end;
  }

  .detail-drawer {
    width: 100vw;
  }

  .viewer-dialog,
  .docs-dialog,
  .key-dialog {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .docs-content {
    grid-template-columns: 1fr;
  }

  .docs-content > nav {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .docs-content article {
    padding: 0 18px 32px;
  }

  .viewer-text {
    width: calc(100% - 20px);
    margin: 10px;
    padding: 18px;
  }

  .key-content {
    padding: 22px 18px 28px;
  }

  .key-meta {
    grid-template-columns: 1fr;
  }

  .key-limit-grid {
    grid-template-columns: 1fr;
  }

  .overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .chart-panel-wide {
    grid-column: auto;
  }

  .radar-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  :root { --gutter: 16px; }
  .topbar-inner { gap: 0 10px; }
  .wordmark { gap: 8px; }
  .wordmark strong { font-size: 20px; }
  .wordmark small { font-size: 8px; }
  .theme-control { padding-inline: 6px; gap: 3px; }
  .theme-control select { width: 112px; }
  .theme-control > svg { width: 13px; height: 13px; }
  .primary-nav { padding-right: 82px; gap: 0; }
  .primary-nav-item { padding-inline: 5px; font-size: 11px; }
  .account-controls .icon-button { width: 34px; }
  .footer-inner { padding-block: 28px 18px; }
  .footer-link { margin-left: 0; }
  .login-panel {
    padding: 28px 22px;
  }

  .primary-nav-item svg {
    display: none;
  }

  .filter-grid,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .filter-wide {
    grid-column: auto;
  }

  .advanced-filter-grid { grid-template-columns: 1fr; }
  .filter-menu-datasets .filter-menu-options { grid-template-columns: 1fr; }
  .filter-menu { width: 100%; }

  .choice-row {
    align-items: flex-start;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions .button {
    grid-column: auto;
  }

  .overview-kpis {
    grid-template-columns: 1fr;
  }

  .dataset-bar-row {
    grid-template-columns: minmax(86px, 1fr) minmax(0, 1.4fr) 48px;
    gap: 8px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chart-legend {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
