:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111714;
  --surface: #19211d;
  --surface-raised: #202a24;
  --ink: #e7eee9;
  --muted: #a7b4ac;
  --line: #34423a;
  --brand: #63d0a8;
  --on-brand: #10251d;
  --brand-soft: #20362d;
  --green: #7bd2a4;
  --green-soft: #20382d;
  --red: #ff8a8a;
  --red-soft: #3a2324;
  --amber: #f0bd70;
  --amber-soft: #3a3020;
  --purple: #b69be4;
  --slate: #91a199;
  --chart-track: #2c3932;
  font-family: "Segoe UI Variable", "Segoe UI", Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f3f7f4;
  --surface: #ffffff;
  --surface-raised: #f7faf8;
  --ink: #1d2922;
  --muted: #64746a;
  --line: #dce6df;
  --brand: #197b5c;
  --on-brand: #ffffff;
  --brand-soft: #e8f3ed;
  --green: #137750;
  --green-soft: #e6f4eb;
  --red: #aa4245;
  --red-soft: #faeceb;
  --amber: #8c641d;
  --amber-soft: #fbf2df;
  --purple: #7651ad;
  --slate: #78887f;
  --chart-track: #e1eae4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 "Segoe UI Variable", "Segoe UI", Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, summary { outline-offset: 4px; }
button { cursor: pointer; }
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 10px 14px; background: var(--surface); color: var(--ink); }
.skip-link:focus { left: 12px; }
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface); }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 28px; padding: 0 38px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 700; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 16px; font-weight: 800; }
.brand-name, .brand-sub { display: block; }
.brand-sub { margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.header-label, .eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mode-pill > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.mode-pill.live > span { background: var(--green); }
.theme-toggle { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--brand); border-radius: 22px; padding: 7px 14px; background: var(--brand-soft); color: var(--ink); font-size: 12px; font-weight: 650; white-space: nowrap; }
.theme-toggle:hover, .button-secondary:hover, .nav-item:hover { border-color: var(--brand); }
.theme-icon { color: var(--brand); font-size: 18px; line-height: 1; }
.theme-label { display: inline; }
.main-nav { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 38px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.nav-item { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; border-bottom: 2px solid transparent; padding: 0 12px; color: var(--muted); font-size: 13px; text-decoration: none; }
.nav-item:hover { color: var(--ink); text-decoration: none; }
.nav-item.active { border-bottom-color: var(--brand); color: var(--ink); font-weight: 650; }
.nav-count { min-width: 19px; border-radius: 12px; padding: 1px 6px; background: var(--red-soft); color: var(--red); font-size: 11px; text-align: center; }

main { width: min(1760px, 100%); margin: 0 auto; padding: 36px 38px 28px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; scroll-margin-top: 140px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); }
h1 { margin: 0 0 7px; font-size: 30px; font-weight: 600; line-height: 1.25; letter-spacing: -1px; }
.lede, .subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.heading-side { display: grid; justify-items: end; gap: 13px; }
.stamp { color: var(--muted); font-size: 12px; text-align: right; }
.actions { display: flex; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 5px; padding: 8px 14px; font-size: 12px; font-weight: 650; }
.button-primary { background: var(--brand); color: var(--on-brand); }
.button-primary:hover:not(:disabled) { filter: brightness(.94); }
.button-secondary { border-color: var(--line); background: var(--surface-raised); color: var(--ink); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; background: var(--surface); }
.notice-icon { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.notice strong { display: block; font-size: 13px; }
.notice p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.setup-notice { align-items: center; }
.setup-notice > div { flex: 1; }
.setup-notice > a { align-self: center; font-size: 12px; font-weight: 650; white-space: nowrap; }

.dashboard-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.view-toggle, .profile-toggle { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 7px; padding: 3px; background: var(--surface-raised); }
.view-toggle button, .profile-toggle button { min-height: 34px; border: 1px solid transparent; border-radius: 5px; padding: 6px 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.view-toggle button[aria-pressed="true"], .profile-toggle button[aria-pressed="true"] { border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0002; }
.view-toggle button:focus-visible, .profile-toggle button:focus-visible { outline: 2px solid var(--brand); }
.configure-link { color: var(--brand); font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.configure-link:hover { text-decoration: underline; }
.dashboard-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 14px; margin-bottom: 22px; }
.dashboard-layout > [data-dashboard-block] { min-width: 0; margin: 0; }
.dashboard-layout > [data-dashboard-block][data-width="quarter"] { grid-column: span 3; }
.dashboard-layout > [data-dashboard-block][data-width="half"] { grid-column: span 6; }
.dashboard-layout > [data-dashboard-block][data-width="full"] { grid-column: span 12; }
.dashboard-layout > .panel { margin-top: 0; }
.dashboard-layout > .coverage-alert { grid-column: 1 / -1; }
.dashboard-block[hidden] { display: none !important; }
:root[data-dashboard-mode="basic"] .advanced-column { display: none; }
.metric, .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric { min-height: 126px; display: flex; flex-direction: column; gap: 7px; padding: 18px 21px; color: var(--muted); font-size: 12px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { color: var(--ink); font-size: 31px; font-weight: 650; line-height: 1.2; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.metric-value .unit { margin-left: 2px; color: var(--muted); font-size: 15px; }
.metric-foot { color: var(--muted); font-size: 11px; }
.metric.good .metric-value { color: var(--green); }
.metric.alert .metric-value { color: var(--red); }
.coverage-track { height: 4px; overflow: hidden; border-radius: 5px; background: var(--chart-track); }
.coverage-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.coverage-alert { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; border: 1px solid var(--amber); border-radius: 6px; padding: 11px 14px; background: var(--amber-soft); color: var(--ink); }
.coverage-alert > span { width: 20px; height: 20px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--amber); color: var(--on-brand); font-weight: 700; }
.coverage-alert p { flex: 1; margin: 0; font-size: 12px; }
.coverage-alert a { font-size: 12px; font-weight: 650; }

.panel { overflow: hidden; margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chart-panel { min-width: 0; }
.chart-panel .panel-head { min-height: 90px; align-items: flex-start; }
.chart-panel .panel-head .eyebrow { margin: 0 0 5px; font-size: 9px; }
.chart-tag { flex: 0 0 auto; border-radius: 5px; padding: 4px 8px; background: var(--surface-raised); color: var(--muted); font-size: 10px; }
.donut-content { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(130px, 1fr); align-items: center; gap: 20px; min-height: 210px; padding: 18px 22px; }
.donut-wrap { position: relative; width: min(100%, 190px); aspect-ratio: 1; justify-self: center; }
.donut-svg { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.donut-track, .donut-segment { fill: none; stroke-width: 14; }
.donut-track { stroke: var(--chart-track); }
.donut-segment { stroke-linecap: butt; }
.donut-pass { stroke: var(--green); }
.donut-fail, .donut-critical, .donut-high { stroke: var(--red); }
.donut-unknown, .donut-medium { stroke: var(--amber); }
.donut-error { stroke: var(--purple); }
.donut-exempt, .donut-not-applicable, .donut-low { stroke: var(--slate); }
.legend-swatch { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 2px; background: currentColor; }
.legend-swatch.donut-pass { color: var(--green); }
.legend-swatch.donut-fail, .legend-swatch.donut-critical, .legend-swatch.donut-high { color: var(--red); }
.legend-swatch.donut-unknown, .legend-swatch.donut-medium { color: var(--amber); }
.legend-swatch.donut-error { color: var(--purple); }
.legend-swatch.donut-exempt, .legend-swatch.donut-not-applicable, .legend-swatch.donut-low { color: var(--slate); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { color: var(--ink); font-size: clamp(27px, 3vw, 36px); font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.chart-legend { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; color: var(--ink); font-size: 12px; }
.chart-legend strong { min-width: 20px; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.scope-chart-list { display: grid; gap: 19px; margin: 0; padding: 23px 22px 26px; list-style: none; }
.scope-chart-list li { display: grid; gap: 7px; min-width: 0; }
.scope-chart-label { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; color: var(--ink); font-size: 12px; }
.scope-chart-label > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-chart-label .scope-type { margin: 0; color: var(--muted); font-size: 10px; }
.scope-chart-label strong { min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.scope-bar-track { height: 7px; overflow: hidden; border-radius: 8px; background: var(--chart-track); }
.scope-bar-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.scope-bar-fill.severity-critical, .scope-bar-fill.severity-high { background: var(--red); }
.scope-bar-fill.severity-medium { background: var(--amber); }
.scope-bar-fill.severity-low { background: var(--green); }
.chart-empty { margin: 0; padding: 25px 22px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 820px; border-collapse: collapse; text-align: left; }
th { border-bottom: 1px solid var(--line); padding: 11px 15px; background: var(--surface-raised); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { border-bottom: 1px solid var(--line); padding: 13px 15px; color: var(--ink); font-size: 12px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.finding-id { color: var(--brand); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scope-name, .scope-type { display: block; }
.scope-name { font-weight: 600; }
.scope-type { margin-top: 2px; color: var(--muted); font-size: 11px; }
.status, .severity { font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-pass, .severity-low { color: var(--green); }
.status-fail, .severity-high { color: var(--red); }
.status-unknown, .status-error, .severity-medium { color: var(--amber); }
.status-exempt, .status-not_applicable { color: var(--muted); }
details { position: relative; }
details summary { color: var(--brand); cursor: pointer; font-size: 11px; white-space: nowrap; }
.finding-detail { position: absolute; right: 0; z-index: 3; width: min(360px, 80vw); margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 13px; background: var(--surface-raised); color: var(--muted); box-shadow: 0 12px 30px #0004; line-height: 1.55; }
.finding-detail p { margin: 0 0 8px; }
.finding-detail strong { color: var(--ink); }
.finding-detail a { font-weight: 600; }
.empty-state { padding: 26px 18px; color: var(--muted); text-align: center; }
.provider-list { padding: 0 18px; }
.provider-row { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; min-height: 58px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.provider-row:last-child { border-bottom: 0; }
.provider-mark { width: 24px; height: 24px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.provider-name { flex: 1; }
.provider-name strong, .provider-name small { display: block; }
.provider-name strong { font-size: 12px; font-weight: 600; }
.provider-name small, .provider-message { color: var(--muted); font-size: 11px; }
.provider-status { border-radius: 16px; padding: 4px 9px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 650; }
.provider-status.partial, .provider-status.permission_denied, .provider-status.error { background: var(--amber-soft); color: var(--amber); }
.provider-message { flex-basis: 100%; margin: -5px 0 0 35px; }
.messages { margin-bottom: 14px; }
.message { margin: 0 0 7px; border: 1px solid var(--line); border-radius: 5px; padding: 10px 13px; font-size: 12px; }
.message.info { background: var(--brand-soft); color: var(--ink); }
.message.success { background: var(--green-soft); color: var(--green); }
.message.error { background: var(--red-soft); color: var(--red); }
footer { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0 4px; color: var(--muted); font-size: 11px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.settings-page { max-width: 1180px; }
.settings-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.settings-card { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); }
.settings-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.settings-card > p { margin: 6px 0 16px; color: var(--muted); font-size: 12px; }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.settings-card-heading > div:first-child > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.settings-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.settings-explanation, .settings-footnote, .settings-status { color: var(--muted); font-size: 12px; }
.settings-explanation { margin: 9px 0 14px; }
.settings-footnote { margin: 14px 0 0; }
.settings-status { min-height: 18px; margin: 8px 0 0; }
.module-settings { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.module-settings > li { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: var(--surface-raised); }
.module-visibility { display: flex; flex: 1; align-items: flex-start; gap: 11px; min-width: 0; cursor: pointer; }
.module-visibility input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.module-visibility strong, .module-visibility small { display: block; }
.module-visibility strong { font-size: 13px; }
.module-visibility small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.module-position { display: flex; align-items: center; gap: 12px; }
.module-position > label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.module-position select { min-height: 36px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 25px 5px 9px; background: var(--surface); color: var(--ink); font-size: 11px; }
.move-controls { display: flex; align-items: center; gap: 5px; }
.move-controls .button { min-height: 34px; padding: 5px 10px; }
.move-controls .button:disabled { opacity: .4; cursor: not-allowed; }
.module-settings-loading { color: var(--muted); font-size: 12px; }
.settings-callout code, .redirect-uri, .connection-vars code { overflow-wrap: anywhere; font-size: 11px; }
.connection-badge { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 18px; padding: 6px 10px; color: var(--amber); font-size: 11px; font-weight: 650; }
.connection-badge.ready { color: var(--green); }
.connect-action { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 20px 0; }
.connect-action p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; }
.connect-action form { flex: 0 0 auto; }
.connect-action .button { min-width: 170px; }
.connection-setup { margin-top: 2px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); }
.connection-setup > summary { font-size: 12px; font-weight: 650; }
.connection-setup .connection-steps { margin-top: 10px; }
.connection-notice { margin-bottom: 16px; }
.connection-steps { display: grid; gap: 0; }
.connection-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding: 16px 0; }
.connection-step > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.connection-step h3 { margin: 0; font-size: 13px; font-weight: 650; }
.connection-step p { margin: 4px 0 8px; color: var(--muted); font-size: 12px; }
.connection-step a { display: inline-block; margin: 2px 14px 2px 0; font-size: 11px; font-weight: 650; }
.redirect-uri { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; color: var(--ink); background: var(--surface-raised); }
.connection-vars { margin-top: 10px; }
.connection-next { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced-configuration { margin: 18px 0; color: var(--muted); font-size: 12px; }
.advanced-configuration > summary { cursor: pointer; font-weight: 650; }
.advanced-configuration .settings-card { margin-top: 12px; }
.settings-heading { align-items: flex-end; }
.setting-list { margin: 0; padding: 0; list-style: none; }
.setting-row { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 12px 0; }
.setting-row dt { font-size: 12px; font-weight: 600; }
.setting-row dd { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.setting-state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.setting-state::before { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); content: ""; }
.setting-state.ready::before { background: var(--green); }
.settings-callout { margin-top: 16px; border: 1px solid var(--line); border-radius: 6px; padding: 13px 15px; background: var(--surface-raised); color: var(--muted); font-size: 12px; }
.settings-callout strong { color: var(--ink); }
.settings-card a { font-size: 12px; font-weight: 600; }

@media (max-width: 1050px) {
  .topbar, .main-nav { padding-right: 24px; padding-left: 24px; }
  main { padding-right: 24px; padding-left: 24px; }
  .dashboard-layout { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dashboard-layout > [data-dashboard-block][data-width="full"] { grid-column: span 6; }
  .dashboard-layout > [data-dashboard-block][data-width="half"] { grid-column: span 6; }
  .dashboard-layout > [data-dashboard-block][data-width="quarter"] { grid-column: span 3; }
}
@media (max-width: 700px) {
  .topbar { min-height: 66px; gap: 12px; padding: 9px 15px; }
  .header-label { display: none; }
  .brand { font-size: 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-sub { max-width: 190px; font-size: 8px; letter-spacing: .03em; }
  .topbar-actions { gap: 7px; }
  .mode-pill { gap: 6px; padding: 5px 8px; font-size: 10px; }
  .theme-toggle { min-height: 40px; padding: 6px 10px; }
  .theme-label { display: inline; }
  .main-nav { min-height: 44px; gap: 0; padding: 0 8px; }
  .nav-item { min-height: 44px; padding: 0 10px; font-size: 12px; }
  main { padding: 26px 15px 22px; }
  .heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .heading-side { width: 100%; justify-items: stretch; }
  .stamp { text-align: left; }
  .actions { width: 100%; }
  .actions form { flex: 1; }
  .button { width: 100%; padding-right: 8px; padding-left: 8px; }
  .setup-notice { align-items: flex-start; flex-wrap: wrap; }
  .setup-notice > a { margin-left: 34px; }
  .panel-head { align-items: flex-start; }
  .table-wrap { overflow-x: auto; }
  footer { display: block; line-height: 1.8; }
  .dashboard-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout > [data-dashboard-block][data-width="full"],
  .dashboard-layout > [data-dashboard-block][data-width="half"] { grid-column: span 2; }
  .dashboard-layout > [data-dashboard-block][data-width="quarter"] { grid-column: span 1; }
  .dashboard-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .settings-card-heading { flex-direction: column; }
  .connect-action { align-items: stretch; flex-direction: column; gap: 14px; }
  .connect-action form, .connect-action .button { width: 100%; }
  .profile-toggle { max-width: 100%; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .mode-pill { display: none; }
  .topbar-actions { margin-left: auto; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  .dashboard-layout > [data-dashboard-block][data-width="quarter"],
  .dashboard-layout > [data-dashboard-block][data-width="half"],
  .dashboard-layout > [data-dashboard-block][data-width="full"] { grid-column: 1; }
  .module-settings > li { align-items: flex-start; flex-direction: column; }
  .module-position { width: 100%; justify-content: space-between; }
  .metric { min-height: 112px; padding: 14px; }
  .metric-value { font-size: 26px; }
  .metric-label, .metric-foot { font-size: 10px; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .site-header { position: static; }
  .main-nav, .actions, .theme-toggle, .setup-notice { display: none !important; }
  body { background: #fff; color: #111; }
  main { max-width: none; padding: 15px; }
  .metric, .panel, .settings-card { break-inside: avoid; box-shadow: none; }
}
