:root {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-muted: #f7f8fa;
  --line: #d8dee6;
  --line-strong: #bcc6d2;
  --text: #182230;
  --muted: #647184;
  --accent: #245b91;
  --accent-dark: #19466f;
  --accent-soft: #e8f0f8;
  --success: #23704b;
  --warning: #8a5b12;
  --danger: #9b3131;
  --topbar: 48px;
  --statusbar: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 13px; overflow: hidden; }
button, input, select { font: inherit; }
button, summary, select, input[type="checkbox"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #68a0d5; outline-offset: 1px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.app-shell { min-height: 100vh; display: grid; grid-template: var(--topbar) minmax(0, 1fr) var(--statusbar) / minmax(0, 1fr); }
.topbar { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 0 12px; background: #202b38; color: #f7f9fb; border-bottom: 1px solid #101820; }
.product-id { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.product-id div { display: grid; line-height: 1.1; }
.product-id small { color: #9faebe; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.product-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 3px; background: #2f6da8; color: white; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.topnav { align-self: stretch; display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 12px; }
.nav-item { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #b9c6d3; font-size: 11px; text-decoration: none; white-space: nowrap; }
.nav-item span { color: #718499; font: 9px ui-monospace, monospace; }
.nav-item:hover { background: #2a3948; color: #fff; }
.nav-item.active { background: #31465a; border-color: #50677d; color: #fff; }
.topbar-status { display: flex; align-items: center; gap: 14px; min-width: 0; margin-left: auto; color: #c9d3dd; font-size: 11px; white-space: nowrap; }
.access-summary { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.environment-label { padding: 3px 7px; border: 1px solid #7993aa; border-radius: 3px; color: #eaf1f8; font: 700 10px ui-monospace, monospace; letter-spacing: .08em; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #50bb82; box-shadow: 0 0 0 2px #2b4c42; }
.quiet-button { border: 0; background: transparent; color: #dce5ee; text-decoration: underline; }
.account-link { display: inline-flex; align-items: center; min-height: 28px; }

.workspace { grid-row: 2; min-width: 0; min-height: 0; overflow: auto; }
.view { min-height: 100%; padding: 12px 14px 20px; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.breadcrumb { margin: 0 0 3px; color: var(--muted); font-size: 11px; }
h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.015em; }
.view-help { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.45; text-align: right; }

.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); margin: 0 0 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.kpi-strip div { padding: 10px 14px; border-right: 1px solid var(--line); }
.kpi-strip div:last-child { border: 0; }
.kpi-strip dt { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-strip dd { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.query-toolbar { display: flex; gap: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 4px 0 0; }
.query-field { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 220px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 3px; background: white; color: var(--muted); }
.query-field input { width: 100%; min-height: 34px; border: 0; outline: 0; color: var(--text); }
.primary-button, .secondary-button { min-height: 34px; padding: 0 13px; border-radius: 3px; font-weight: 650; }
.primary-button { border: 1px solid var(--accent-dark); background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; color: #334154; }
.secondary-button:hover { background: #f0f3f6; }

.catalog-grid { min-height: 580px; background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 4px 4px; }
.filter-panel { display: grid; grid-template-columns: repeat(9, minmax(145px, 1fr)); align-items: stretch; background: var(--panel-muted); border-bottom: 1px solid var(--line-strong); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.panel-title span { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.panel-title .ok-state { color: var(--success); }
.filter-heading { grid-column: 1 / -1; min-height: 31px; padding-block: 5px; }
.quality-filter-strip { grid-column: 1 / -1; display: grid; grid-template-columns: 108px repeat(6, minmax(112px, 1fr)); align-items: end; gap: 5px; padding: 5px 8px 6px; border-bottom: 1px solid var(--line-strong); background: #f2f5f8; }
.quality-filter-intro { align-self: center; display: grid; gap: 1px; color: #2e3d50; }
.quality-filter-intro strong { font-size: 11px; }
.quality-filter-intro span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.quality-filter-strip label { display: grid; gap: 2px; min-width: 0; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.quality-filter-strip select, .quality-filter-strip input { width: 100%; min-height: 25px; padding: 2px 5px; border: 1px solid var(--line-strong); border-radius: 2px; background: #fff; color: var(--text); font-size: 10px; text-transform: none; letter-spacing: 0; }
.quality-filter-strip :disabled { cursor: not-allowed; background: #e7ebef; color: #8994a1; }
.taxonomy-status { grid-column: 1 / -1; margin: 0; padding: 6px 9px; border-bottom: 1px solid var(--line-strong); font-size: 10px; line-height: 1.35; }
.taxonomy-status.is-curated { color: #17633a; background: #eef8f2; }
.taxonomy-status.is-unreviewed { color: #7a4b00; background: #fff7e6; }
.filter-group { min-width: 0; padding: 0 0 4px; border-right: 1px solid var(--line); }
.filter-group:last-child { border-right: 0; }
.filter-group-wide { grid-column: span 2; }
.filter-group h2 { margin: 0; padding: 6px 8px 4px; color: #2e3d50; font-size: 11px; line-height: 1.2; }
.filter-subgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
details { border-bottom: 1px solid var(--line); }
summary { position: relative; padding: 9px 28px 9px 12px; font-weight: 650; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 12px; color: var(--muted); }
details[open] summary::after { content: "−"; }
.filter-options { display: grid; max-height: 110px; overflow: auto; padding: 0 5px 4px; scrollbar-width: thin; }
.check-option { display: grid; grid-template-columns: 14px minmax(0,1fr) auto; align-items: center; gap: 4px; min-height: 21px; padding: 1px 3px; color: #354253; font-size: 11px; }
.check-option:hover { background: #e9eef3; }
.check-option input { margin: 0; accent-color: var(--accent); }
.check-option small { color: #8793a2; font-variant-numeric: tabular-nums; }
.check-option-row { display: grid; grid-template-columns: minmax(0, 1fr) 19px; align-items: center; gap: 2px; }
.compound-info-button { display: inline-grid; place-items: center; width: 18px; height: 18px; min-width: 18px; padding: 0; border: 1px solid #9bb0c4; border-radius: 50%; background: #fff; color: var(--accent-dark); font: 700 10px/1 Georgia, serif; }
.compound-info-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.compound-info-button:focus-visible, .detail-tab:focus-visible, .dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-label { margin: 1px 6px 3px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 5px; padding: 0 6px 5px; }
.range-grid label { display: grid; grid-template-columns: 1fr 40px; align-items: center; gap: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.range-grid input, select, .control-panel select, .login-card input { min-height: 32px; width: 100%; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--text); }
.range-grid input { min-height: 24px; padding: 2px 4px; font-size: 10px; }
.compound-filter-list { display: grid; max-height: 110px; overflow: auto; padding: 0 5px 4px; scrollbar-width: thin; }
.compound-filter-row { display: grid; grid-template-columns: minmax(58px, 1fr) 35px 35px 19px; align-items: center; gap: 3px; min-height: 23px; border-bottom: 1px solid #e5eaf0; }
.compound-filter-row:last-child { border-bottom: 0; }
.compound-filter-row.is-reference-only { background: #f1f3f5; color: #7d8792; }
.compound-filter-row.is-reference-only .compound-presence strong { font-weight: 500; }
.compound-filter-row :disabled { cursor: not-allowed; opacity: .55; }
.compound-presence { display: grid; grid-template-columns: 13px minmax(0, 1fr) auto; align-items: center; gap: 4px; min-width: 0; font-size: 10px; }
.compound-presence strong { overflow: hidden; text-overflow: ellipsis; }
.compound-presence small { color: var(--muted); font-size: 8px; }
.compound-filter-row input[type="number"] { width: 35px; min-height: 21px; padding: 1px 2px; border: 1px solid var(--line-strong); border-radius: 2px; font-size: 9px; }

.results-panel { min-width: 0; display: flex; flex-direction: column; }
.results-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 54px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.results-toolbar > label { display: flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.results-toolbar select { width: 150px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.filter-chip, .signal-chip { display: inline-flex; padding: 2px 6px; border-radius: 2px; background: var(--accent-soft); color: #31577a; font-size: 10px; }
.table-wrap { min-width: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 7px 9px; background: #edf1f5; border-bottom: 1px solid var(--line-strong); color: #526073; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { height: 50px; padding: 7px 9px; border-bottom: 1px solid #e6eaf0; vertical-align: middle; color: #334154; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover, .data-table tbody tr:focus { background: #edf5fc; outline: none; }
.data-table tbody tr[data-source-status="missing"], .data-table tbody tr[data-source-status="unavailable"], .data-table tbody tr[data-source-status="error"] { background: #faf7f5; }
.data-table tbody tr[data-source-status="missing"] td, .data-table tbody tr[data-source-status="unavailable"] td, .data-table tbody tr[data-source-status="error"] td { color: #727b86; }
.data-table tbody tr[data-no-reviews="true"] .review-count strong { color: var(--muted); }
.data-table th:nth-child(1) { width: 17%; }.data-table th:nth-child(2) { width: 10%; }.data-table th:nth-child(3), .data-table th:nth-child(4) { width: 7%; }.data-table th:nth-child(5) { width: 10%; }.data-table th:nth-child(6) { width: 20%; }.data-table th:nth-child(7) { width: 7%; }.data-table th:nth-child(8) { width: 14%; }.data-table th:nth-child(9) { width: 8%; }
.profile-cell { display: grid; gap: 2px; }
.profile-cell strong { color: #173f67; }
.profile-cell small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.signals-cell { display: flex; flex-wrap: wrap; gap: 3px; max-height: 34px; overflow: hidden; }
.signal-chip { background: #edf0f3; color: #4c5b6c; }
.quality-cell { overflow: visible !important; }
.quality-badges { display: flex; flex-wrap: wrap; gap: 3px; align-content: center; }
.quality-badge { display: inline-flex; align-items: center; min-height: 18px; padding: 1px 5px; border: 1px solid #cbd3dc; border-radius: 2px; background: #f4f6f8; color: #526073; font: 700 9px ui-monospace, monospace; white-space: nowrap; cursor: help; }
.quality-badge[data-tone="good"] { border-color: #9ecab1; background: #edf8f1; color: var(--success); }
.quality-badge[data-tone="info"] { border-color: #aac5de; background: #eef5fb; color: var(--accent-dark); }
.quality-badge[data-tone="warn"] { border-color: #d9bf89; background: #fff8e8; color: var(--warning); }
.quality-badge[data-tone="bad"] { border-color: #d8aaaa; background: #fff1f1; color: var(--danger); }
.quality-badge[data-tone="muted"] { border-color: #d7dce2; background: #f3f4f6; color: #737e8b; }
.review-count { display: grid; gap: 1px; justify-items: end; }
.review-count small { color: var(--muted); font-size: 8px; }
.empty-state { margin: 28px; padding: 24px; border: 1px dashed var(--line-strong); background: #fafbfc; color: var(--muted); text-align: center; }
.loading-row td { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); }

.analysis-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; }
.control-panel, .analysis-output, .ops-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.control-panel { display: grid; align-content: start; gap: 12px; padding-bottom: 14px; }
.control-panel > label, .control-panel > small, .control-panel > button { margin: 0 12px; }
.control-panel label { display: grid; gap: 5px; color: #445267; font-weight: 600; }
.control-panel select[multiple] { min-height: 220px; }
.control-panel small { color: var(--muted); }
.analysis-output { min-width: 0; min-height: 540px; padding: 14px; }
.analysis-head { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.analysis-head h2 { margin: 0 0 3px; font-size: 17px; }.analysis-head p { margin: 0; color: var(--muted); }
.cohort-badge { min-width: 112px; padding: 7px 10px; background: var(--accent-soft); border: 1px solid #c7daeb; text-align: right; }
.cohort-badge strong { display: block; font-size: 18px; }.cohort-badge span { color: var(--muted); font-size: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin: 14px 0; border: 1px solid var(--line); }
.metric { display: grid; gap: 3px; padding: 10px; border-right: 1px solid var(--line); }.metric:last-child { border: 0; }
.metric span, .metric small { color: var(--muted); font-size: 10px; }.metric strong { font-size: 16px; }.metric .positive { color: var(--success); }.metric .negative { color: var(--danger); }
.associations h3 { margin: 18px 0 8px; font-size: 13px; }
.association-row { display: grid; grid-template-columns: 110px minmax(130px, .8fr) minmax(140px, 1fr) 52px; align-items: center; gap: 10px; min-height: 32px; border-bottom: 1px solid #e7ebef; }
.association-kind { color: var(--muted); font-size: 10px; text-transform: uppercase; }.association-track { height: 6px; background: #e5e9ee; }.association-track i { display: block; height: 100%; background: #5f89b1; }.association-lift { text-align: right; font-variant-numeric: tabular-nums; }
.insight-caveat { margin: 18px 0 0; padding: 9px; background: #fff8e8; border-left: 3px solid #c8993b; color: #665636; }

.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ops-card { min-height: 220px; }.ops-card > p { padding: 4px 14px; color: #49576a; line-height: 1.6; }
.definition-list { margin: 0; }.definition-list div { display: grid; grid-template-columns: 150px 1fr; padding: 8px 12px; border-bottom: 1px solid #e7ebef; }.definition-list dt { color: var(--muted); }.definition-list dd { margin: 0; font-weight: 600; }
.rule-list { margin: 0; padding: 10px 14px 10px 30px; color: #435166; line-height: 1.8; }

.statusbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: #e5e9ee; border-top: 1px solid var(--line-strong); color: #667386; font: 10px ui-monospace, monospace; }

.detail-dialog { width: min(1080px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #8f9dad; border-radius: 5px; box-shadow: 0 24px 70px #17253666; }
.detail-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.detail-dialog::backdrop, .compound-info-dialog::backdrop { background: #18263499; backdrop-filter: blur(1px); }
.detail-dialog > header { z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #f2f5f8; border-bottom: 1px solid var(--line); }
.detail-dialog h2 { margin: 2px 0 0; font-size: 19px; }.detail-dialog header small { color: var(--muted); }
.dialog-close { width: 32px; height: 32px; border: 1px solid var(--line-strong); background: white; border-radius: 3px; font-size: 20px; }
.detail-content { min-height: 0; padding: 14px 16px 24px; overflow-y: auto; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; border: 1px solid var(--line); }
.detail-meta div { padding: 9px; border-right: 1px solid var(--line); }.detail-meta div:last-child { border: 0; }.detail-meta span { display: block; color: var(--muted); font-size: 10px; }.detail-meta strong { display: block; margin-top: 3px; }
.quality-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -5px 0 14px; border: 1px solid var(--line); background: #f8fafb; }
.quality-summary > div { min-width: 0; padding: 8px 9px; border-right: 1px solid var(--line); }
.quality-summary > div:last-child { border-right: 0; }
.quality-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.quality-summary strong { display: block; font-size: 11px; }
.quality-summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.quality-summary .quality-badges { margin-top: 5px; }
.detail-section { margin-top: 16px; }.detail-section h3 { margin: 0 0 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.detail-tabs { margin-top: 12px; }
.detail-tab-list { position: sticky; top: -14px; z-index: 1; display: flex; gap: 2px; padding: 7px 0; background: #fff; border-bottom: 1px solid var(--line-strong); }
.detail-tab { min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #47576a; font-weight: 650; }
.detail-tab:hover { background: #f0f4f7; }
.detail-tab[aria-selected="true"] { border-color: #9fb5c9; background: var(--accent-soft); color: var(--accent-dark); }
.detail-tab-panel { padding: 2px 1px 10px; }
.detail-context-note, .detail-empty { margin: 12px 0 0; padding: 8px 10px; border-left: 3px solid #86a4bf; background: #f3f7fa; color: #4b5d70; line-height: 1.5; }
.compound-detail-table { width: 100%; border-collapse: collapse; }
.compound-detail-table th, .compound-detail-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.compound-detail-table th { background: #f3f6f8; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .035em; }
.compound-detail-table td:nth-child(2), .compound-detail-table td:nth-child(3) { width: 150px; }
.compound-detail-table td:last-child { width: 55px; text-align: center; }
.compound-detail-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.review-disclosure { border: 1px solid var(--line); }
.source-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); }
.source-facts div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; padding: 8px 9px; border-bottom: 1px solid var(--line); }
.source-facts dt { color: var(--muted); font-size: 10px; }.source-facts dd { margin: 0; overflow-wrap: anywhere; }
.source-narrative { margin-top: 14px; border: 1px solid var(--line); }
.source-warning { margin: 0; padding: 9px 12px; border-top: 1px solid #ead6a6; border-bottom: 1px solid #ead6a6; background: #fff9ea; color: #6b5629; line-height: 1.5; }
.source-narrative-body { max-height: 430px; padding: 5px 12px 14px; overflow: auto; }
.source-narrative-body p { margin: 10px 0 0; line-height: 1.65; overflow-wrap: anywhere; }
.review-signal-table { width: 100%; border-collapse: collapse; }.review-signal-table th, .review-signal-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }.review-signal-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.review-excerpt { padding: 9px 0; border-bottom: 1px solid var(--line); }.review-excerpt p { margin: 5px 0 0; line-height: 1.5; }.review-excerpt small { color: var(--muted); }
.review-excerpt .review-reply { margin-left: 18px; padding-left: 9px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; }
.property-grid div { display: grid; grid-template-columns: minmax(110px, .45fr) 1fr; gap: 8px; padding: 6px 7px; border: 1px solid var(--line); }
.property-grid dt { color: var(--muted); font-size: 10px; }.property-grid dd { margin: 0; overflow-wrap: anywhere; }

.compound-info-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #8f9dad; border-radius: 5px; background: #fff; box-shadow: 0 24px 70px #17253666; }
.compound-info-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.compound-info-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f2f5f8; }
.compound-info-dialog h2 { margin: 2px 0 0; font-size: 19px; }.compound-info-dialog header small { color: var(--muted); }
.compound-info-content { min-height: 0; padding: 14px 16px 18px; overflow-y: auto; }
.compound-observation { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 11px; border: 1px solid #a9c8b6; background: #f1faf5; color: #245a3e; }
.compound-observation span { color: #4f6c5d; font-size: 11px; text-align: right; }
.compound-observation.is-unmeasured { align-items: flex-start; border-color: #dfc98f; background: #fff9e9; color: #735313; }
.compound-observation.is-unmeasured span { color: #6b5d3c; }
.compound-info-intro p { margin: 12px 0 0; line-height: 1.6; }
.compound-evidence { padding: 8px 10px; border-left: 3px solid var(--accent); background: #f2f6fa; }
.compound-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.compound-info-section { padding: 10px 11px; border: 1px solid var(--line); background: #fff; }
.compound-info-section h3, .compound-health-note h3 { margin: 0 0 6px; color: #2d4156; font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.compound-info-section ul { margin: 0; padding-left: 18px; }.compound-info-section li { margin: 4px 0; line-height: 1.45; }
.compound-health-note { margin-top: 10px; padding: 10px 11px; border-left: 3px solid #c28a2d; background: #fff9e9; }.compound-health-note p { margin: 0; line-height: 1.55; }
.compound-sources { margin-top: 10px; background: #f8fafb; }.compound-sources a { color: var(--accent-dark); overflow-wrap: anywhere; }
.compound-notice { margin: 12px 0 0; padding: 9px 11px; border: 1px solid #d5b9b9; background: #fff5f5; color: #6e3c3c; font-size: 10px; line-height: 1.5; }

.login-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #1c2733f5; }
.login-card { width: min(390px, calc(100vw - 32px)); display: grid; gap: 14px; padding: 26px; background: white; border: 1px solid #aeb9c5; box-shadow: 0 18px 60px #0005; }
.login-card h1 { font-size: 19px; }.login-card p { margin: 0; color: var(--muted); line-height: 1.5; }.login-card label { display: grid; gap: 5px; font-weight: 650; }.error-text { min-height: 18px; color: var(--danger) !important; }.error-text.success-text { color: var(--success) !important; }
.page-loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: #152231b8; backdrop-filter: blur(1px); }
.page-loader-card { display: flex; align-items: center; gap: 13px; min-width: 250px; padding: 16px 18px; border: 1px solid #9eacba; border-radius: 4px; background: #fff; box-shadow: 0 16px 48px #0c162366; }
.page-loader-card div { display: grid; gap: 3px; }
.page-loader-card strong { color: var(--text); font-size: 13px; }
.page-loader-card small { color: var(--muted); font-size: 11px; }
.page-loader-spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 3px solid #cbd5df; border-top-color: var(--accent); border-radius: 50%; animation: page-loader-spin .8s linear infinite; }
body[aria-busy="true"] { cursor: progress; }
@keyframes page-loader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-loader-spinner { animation: none; border-top-color: var(--accent); border-right-color: var(--accent); } }
.link-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; text-decoration: none; }
.card-action { padding: 0 14px 12px; }
.admin-body { overflow: auto; background: var(--bg); }
.admin-shell { width: min(980px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 50px; }
.admin-shell-wide { width: min(1240px, calc(100% - 28px)); }
.admin-card { margin-top: 14px; min-height: 0; }
.admin-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
.admin-form label { display: grid; gap: 5px; color: var(--muted); }
.admin-form input { min-height: 36px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 3px; }
.commit-form { display: flex; align-items: center; gap: 12px; padding: 14px; }
.commit-form small { color: var(--muted); }
.admin-message { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); background: white; }
.success-message { border-color: #9bc8ad; background: #eff9f3; color: var(--success); }
.warning-message { border-color: #d9bf89; background: #fff8e8; color: #6f4b11; line-height: 1.5; }
.error-message { border-color: #d5a2a2; background: #fff3f3; color: var(--danger); }
.account-shell { width: min(720px, calc(100% - 28px)); }
.setup-form small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.35; }

/* Compact account administration */
.users-card { min-height: 0; overflow: hidden; }
.users-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.users-table-toolbar > div { display: grid; gap: 3px; }
.users-table-toolbar small { color: var(--muted); font-size: 10px; }
.users-search { display: flex; align-items: center; gap: 7px; width: min(310px, 40vw); padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--muted); }
.users-search input { width: 100%; min-height: 32px; border: 0; outline: 0; background: transparent; color: var(--text); }
.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: auto; }
.users-table th { padding: 7px 10px; background: #f2f5f8; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 9px; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.users-table td { height: 48px; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #f8fafc; }
.users-table th:last-child, .users-table td:last-child { text-align: right; }
.user-identity { display: grid; gap: 1px; }
.user-identity strong { color: #173f67; }
.user-identity small, .users-date { color: var(--muted); font-size: 10px; }
.role-badge, .password-state { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border: 1px solid #ccd4dd; border-radius: 999px; background: #f5f7f9; color: #526073; font-size: 10px; white-space: nowrap; }
.role-badge.role-admin { border-color: #94b3cf; background: #edf5fb; color: var(--accent-dark); font-weight: 700; }
.password-state.is-temporary { border-color: #dbc28e; background: #fff8e8; color: var(--warning); }
.account-state-control { display: inline-flex; align-items: center; gap: 7px; }
.account-state-control small { min-width: 58px; color: var(--muted); font-size: 10px; }
.account-switch { position: relative; width: 34px; height: 19px; padding: 0; border: 1px solid #9ba8b6; border-radius: 999px; background: #c6cdd5; transition: background .16s ease, border-color .16s ease; }
.account-switch span { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .16s ease; }
.account-switch[aria-checked="true"] { border-color: #23704b; background: #2d825c; }
.account-switch[aria-checked="true"] span { transform: translateX(15px); }
.account-switch:disabled { cursor: not-allowed; opacity: .58; }
.row-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.table-action { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: #334154; font-size: 10px; font-weight: 650; text-decoration: none; }
.table-action:hover:not(:disabled) { border-color: #8da6be; background: #edf4fa; color: #173f67; }
.table-action:disabled { cursor: not-allowed; opacity: .48; }
.table-action-danger { border-color: #c99595; color: var(--danger); }
.table-action-danger:hover:not(:disabled) { border-color: var(--danger); background: #fff1f1; color: #7f2626; }
.users-empty, .users-no-results { padding: 28px; color: var(--muted); text-align: center; }
.users-empty p { margin: 0 0 12px; }

.user-dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: hidden; border: 1px solid #99a7b6; border-radius: 5px; background: #fff; color: var(--text); box-shadow: 0 22px 70px #101b2866; }
.user-dialog-small { width: min(500px, calc(100vw - 28px)); }
.user-dialog::backdrop { background: #14223199; backdrop-filter: blur(1px); }
.user-dialog form { display: flex; max-height: calc(100vh - 30px); flex-direction: column; }
.user-dialog header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f3f6f8; }
.user-dialog header div { display: grid; gap: 2px; }
.user-dialog header small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.user-dialog h2 { margin: 0; font-size: 17px; }
.user-dialog-content { display: grid; gap: 14px; padding: 16px; overflow-y: auto; }
.user-dialog footer { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--line); background: #f8fafb; }
.dialog-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.dialog-field-grid > label:last-child { grid-column: 1 / -1; }
.user-dialog label { display: grid; gap: 5px; color: #48566a; font-size: 11px; font-weight: 650; }
.user-dialog label small { color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.4; }
.user-dialog input:not([type="checkbox"]), .user-dialog select { width: 100%; min-height: 37px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--text); }
.user-dialog input:disabled, .user-dialog select:disabled { cursor: not-allowed; background: #eef1f4; color: #697587; }
.dialog-intro, .state-confirmation { margin: 0; color: #455367; line-height: 1.55; }
.delete-warning { margin: 0; padding: 10px 12px; border-left: 3px solid var(--danger); background: #fff1f1; color: #6e2b2b; line-height: 1.5; }
[data-delete-match] { color: var(--muted); }
[data-delete-match][data-state="success"] { color: var(--success); }
.generated-password-block { display: grid; gap: 9px; padding: 12px; border: 1px solid #bfd0df; background: #f5f9fc; }
.generated-password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.generated-password-row input { font: 700 14px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .025em; }
.generated-password-row .secondary-button { min-height: 37px; }
.copy-confirm { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 7px !important; color: #334154 !important; }
.copy-confirm input { flex: 0 0 auto; margin: 2px 0 0; }
[data-copy-status] { color: var(--muted); font-size: 10px; }
[data-copy-status][data-state="success"] { color: var(--success); }
[data-copy-status][data-state="warning"] { color: var(--warning); }
[data-copy-status][data-state="error"] { color: var(--danger); }
.admin-confirm-field { padding-top: 13px; border-top: 1px solid var(--line); }
.admin-confirm-field input { max-width: 360px; }
.role-transfer-warning, .inline-note { margin: 0; padding: 9px 11px; border-left: 3px solid #c8993b; background: #fff8e8; color: #665636; font-size: 11px; line-height: 1.5; }
.inline-note { border-left-color: #7695b2; background: #f0f6fb; color: #3f566d; }
.dialog-error { margin: 0; }
.danger-button { border-color: #7f2626 !important; background: var(--danger) !important; }
.danger-button:hover { background: #7f2626 !important; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .48; }
.auto-sync-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.auto-sync-controls { display: grid; align-content: start; gap: 12px; padding: 14px; border-right: 1px solid var(--line); }
.auto-sync-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.auto-sync-controls small { color: var(--muted); line-height: 1.5; }
.auto-sync-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.view-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.auto-sync-progress { min-width: 0; padding: 14px; }
.auto-sync-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.auto-sync-progress progress { width: 100%; height: 14px; margin: 8px 0 12px; accent-color: var(--accent); }
.auto-sync-stats { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); margin: 0; border: 1px solid var(--line); }
.auto-sync-stats div { padding: 8px 10px; border-right: 1px solid var(--line); }
.auto-sync-stats div:last-child { border: 0; }
.auto-sync-stats dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.auto-sync-stats dd { margin: 3px 0 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.taxonomy-repair-stats { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
.taxonomy-evidence-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.taxonomy-evidence-legend div { padding: 9px 12px; border-right: 1px solid var(--line); }
.taxonomy-evidence-legend div:last-child { border-right: 0; }
.taxonomy-evidence-legend dt { margin-bottom: 3px; color: #31465a; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.taxonomy-evidence-legend dd { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.auto-sync-message { min-height: 34px; margin: 10px 0 0; padding: 8px 10px; background: #f5f7f9; border-left: 3px solid var(--accent); color: #39485a; line-height: 1.45; }
.cycle-mode { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); background: #f7f9fb; }
.cycle-mode strong { font-size: 13px; }
.cycle-mode span { color: var(--muted); font-size: 11px; }
.cycle-stats { grid-template-columns: repeat(6, minmax(105px, 1fr)); }
.cycle-stats div { border-bottom: 1px solid var(--line); }
.cycle-stats div:nth-child(6n) { border-right: 0; }
.cycle-stats div:nth-last-child(-n+5) { border-bottom: 0; }
.health-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.health-grid div { display: block; min-width: 0; border-right: 1px solid var(--line); }
.health-grid div:last-child { border-right: 0; }
.health-grid dd { overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; }
.health-ok { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--success); background: #f4fbf6; }
.health-card-error { border-color: #d9a5a5; }
.health-issues { padding: 10px 12px; border-top: 1px solid #e2b7b7; color: var(--danger); background: #fff5f5; }
.health-issues ul { margin: 5px 0 0; padding-left: 18px; }
.cycle-history { border-top: 1px solid var(--line); }
.cycle-history-table { min-width: 760px; }
.cycle-history-table th:nth-child(3), .cycle-history-table th:nth-child(4), .cycle-history-table td:nth-child(3), .cycle-history-table td:nth-child(4) { text-align: right; }
.cycle-profile-cell { display: grid; gap: 2px; max-width: 440px; }
.cycle-profile-cell small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cycle-history-table td[data-state="done"] { color: var(--success); font-weight: 700; }
.cycle-history-table td[data-state="skipped"] { color: #8b5e00; font-weight: 700; }
.cycle-history-table td[data-state="review"] { color: var(--accent); font-weight: 700; }
.cycle-history-table td[data-state="error"] { color: var(--danger); font-weight: 700; }
.cleanup-table form, .archived-profiles form { margin: 0; }
.cleanup-table td:last-child, .archived-profiles td:last-child { width: 130px; text-align: right; }
.cleanup-bulk-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 10px; padding: 8px 10px; border: 1px solid #c9d6e2; background: #f7fafc; }
.cleanup-bulk-action small { color: var(--muted); }
.archived-profiles { margin-top: 8px; border-top: 1px solid var(--line); }
.archived-profiles > summary { background: #f6f8fa; }

.setup-body { overflow: auto; background: #e9edf1; }
.setup-shell { width: min(820px, calc(100% - 28px)); margin: 0 auto; padding: 30px 0 60px; }
.setup-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.setup-header h1 { margin: 0 0 4px; font-size: 22px; }
.setup-header p, .setup-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.setup-card { margin-top: 12px; padding: 18px; border: 1px solid var(--line-strong); background: white; box-shadow: 0 2px 8px #2030400d; }
.setup-card h2 { margin: 0 0 12px; font-size: 15px; }
.setup-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.setup-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.setup-form input, .setup-form select { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line-strong); background: white; border-radius: 3px; }
.setup-form button, .setup-form label:first-of-type:last-of-type { grid-column: 1 / -1; }
.setup-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--line); }
.setup-facts div { padding: 10px 12px; border-right: 1px solid var(--line); }.setup-facts div:last-child { border: 0; }
.setup-facts dt { color: var(--muted); font-size: 11px; }.setup-facts dd { margin: 4px 0 0; font-weight: 700; }
.setup-progress { margin: 16px 0 12px; }.setup-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; }
.setup-progress progress { width: 100%; height: 15px; accent-color: var(--accent); }.setup-progress p { margin-top: 6px; font-size: 12px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-message { margin: 10px 0; padding: 11px 13px; border: 1px solid var(--line-strong); background: white; }
.setup-error { border-color: #d5a2a2; color: var(--danger); }.setup-success { border-color: #9bc8ad; color: var(--success); }

@media (max-width: 1500px) {
  .filter-panel { grid-template-columns: repeat(6, minmax(145px, 1fr)); }
  .quality-filter-strip { grid-template-columns: repeat(6, minmax(108px, 1fr)); }
  .quality-filter-intro { display: none; }
}

@media (max-width: 1000px) {
  .filter-panel { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
  .quality-filter-strip { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .topbar-status .access-summary { display: none; }
  .kpi-strip { grid-template-columns: repeat(5, 140px); overflow-x: auto; }
}

@media (max-width: 900px) {
  .auto-sync-layout { grid-template-columns: 1fr; }
  .auto-sync-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .auto-sync-stats { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .cycle-stats { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .cycle-stats div:nth-child(6n) { border-right: 1px solid var(--line); }
  .cycle-stats div:nth-last-child(-n+5) { border-bottom: 1px solid var(--line); }
  .cycle-stats div:nth-child(3n) { border-right: 0; }
  .cycle-stats div:nth-last-child(-n+2) { border-bottom: 0; }
  .health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .taxonomy-evidence-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .taxonomy-evidence-legend div { border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  body { overflow: auto; }.app-shell { display: block; }.topbar { position: sticky; top: 0; z-index: 5; }.topbar-status > span:not(.environment-label) { display: none; }
  .product-id div, .topbar-status .environment-label { display: none; }.topnav { margin-left: 0; flex: 1; overflow-x: auto; scrollbar-width: thin; }.nav-item { flex: 0 0 auto; justify-content: center; padding-inline: 7px; }.nav-item span { display: none; }
  .workspace { overflow: visible; }.view { padding: 12px; }.view-header { align-items: flex-start; flex-direction: column; }.view-help { text-align: left; }
  .filter-panel { grid-template-columns: repeat(2, minmax(140px, 1fr)); }.quality-filter-strip { grid-template-columns: repeat(2, minmax(125px, 1fr)); }.filter-group-wide { grid-column: span 2; }.analysis-grid, .operations-grid { grid-template-columns: 1fr; }.table-wrap { overflow-x: auto; }.data-table { min-width: 980px; }
  .query-toolbar { flex-wrap: wrap; }.query-field { flex-basis: 100%; }.metrics-grid { grid-template-columns: repeat(2, 1fr); }.statusbar { display: none; }
  .setup-form, .setup-facts, .auto-sync-layout { grid-template-columns: 1fr; }.setup-facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .auto-sync-controls { border-right: 0; border-bottom: 1px solid var(--line); }.auto-sync-stats { grid-template-columns: repeat(2, 1fr); }.auto-sync-stats div { border-bottom: 1px solid var(--line); }
  .cycle-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cycle-stats div:nth-child(3n) { border-right: 1px solid var(--line); }
  .cycle-stats div:nth-child(2n) { border-right: 0; }
  .cycle-stats div:nth-last-child(-n+1) { border-bottom: 0; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-dialog, .compound-info-dialog { width: calc(100vw - 12px); max-width: none; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  .detail-dialog { height: calc(100vh - 12px); height: calc(100dvh - 12px); }
  .detail-dialog > header, .compound-info-dialog > header { padding: 10px 11px; }
  .detail-content, .compound-info-content { padding: 10px 11px 16px; }
  .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-meta div { border-bottom: 1px solid var(--line); }
  .detail-meta div:nth-child(2n) { border-right: 0; }
  .detail-meta div:nth-last-child(-n+2) { border-bottom: 0; }
  .detail-tab-list { top: -10px; overflow-x: auto; scrollbar-width: thin; }
  .detail-tab { flex: 0 0 auto; }
  .compound-detail-section { overflow-x: auto; }
  .compound-detail-table { min-width: 650px; }
  .review-signal-table th, .review-signal-table td { overflow-wrap: anywhere; }
  .source-facts, .property-grid, .compound-info-grid { grid-template-columns: 1fr; }
  .source-facts div { grid-template-columns: 100px minmax(0, 1fr); }
  .compound-observation { align-items: flex-start; flex-direction: column; gap: 5px; }
  .compound-observation span { text-align: left; }
  .quality-summary { grid-template-columns: 1fr; }
  .quality-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .quality-summary > div:last-child { border-bottom: 0; }
  .taxonomy-evidence-legend { grid-template-columns: 1fr; }
  .taxonomy-evidence-legend div { border-right: 0; }
  .admin-shell-wide { width: min(100% - 20px, 1240px); padding-top: 14px; }
  .admin-shell-wide .view-header-actions { width: 100%; justify-content: flex-start; }
  .users-table-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .users-search { width: 100%; }
  .users-table { min-width: 0; }
  .users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tbody { display: grid; gap: 9px; padding: 9px; }
  .users-table tbody tr { display: grid; padding: 5px 10px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
  .users-table td { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; min-height: 35px; height: auto; padding: 5px 0; text-align: left !important; }
  .users-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .row-actions { justify-content: flex-start; }
  .user-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .user-dialog form { max-height: calc(100vh - 18px); }
  .dialog-field-grid { grid-template-columns: 1fr; }
  .dialog-field-grid > label:last-child { grid-column: auto; }
  .generated-password-row { grid-template-columns: 1fr 1fr; }
  .generated-password-row input { grid-column: 1 / -1; }
  .user-dialog footer .primary-button, .user-dialog footer .secondary-button { flex: 1; }
}

@media (max-width: 480px) {
  .detail-meta { grid-template-columns: 1fr; }
  .detail-meta div, .detail-meta div:nth-child(2n), .detail-meta div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-meta div:last-child { border-bottom: 0; }
}
