:root {
  color-scheme: light;
  --ink: #182130;
  --muted: #5f6d80;
  --quiet: #8994a6;
  --line: #d9e0eb;
  --line-soft: #e8edf5;
  --surface: #fbfcff;
  --surface-raised: #fbfcff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f7f9fc;
  --surface-disabled: #f7f8fa;
  --surface-gradient-mid: #eef3f8;
  --surface-gradient-end: #f6f8fb;
  --panel: oklch(99.7% 0.003 255);
  --wash: #f1f5fa;
  --blue: #2f6fed;
  --blue-text: #245fcf;
  --green: #0d8b72;
  --green-text: #08705c;
  --amber: #b66a12;
  --amber-text: #7a4609;
  --red: #bc3a3a;
  --red-text: #982f2f;
  --purple: #7c5cc4;
  --fallback-accent: #536173;
  --fallback-accent-text: #364256;
  --hover-line: #b7c1d2;
  --focus-ring: #245fcf;
  --bar-track: #e9eef6;
  --bar-fill: #526783;
  --axis-line: #e1e7f0;
  --axis-baseline: #d8e0ec;
  --axis-text: #627086;
  --marker: #7d8ca2;
  --chart-surface-top: oklch(99.2% 0.006 255);
  --chart-surface-bottom: oklch(97.3% 0.012 255);
  --chart-plot-bg: oklch(99.5% 0.004 255);
  --chart-grid-major: oklch(89.8% 0.018 255);
  --chart-grid-minor: oklch(94.6% 0.012 255);
  --chart-frame: oklch(87.5% 0.022 255);
  --chart-label-bg: oklch(99.3% 0.004 255);
  --chart-delta-up: #08705c;
  --chart-delta-down: #982f2f;
  --chart-delta-flat: #758196;
  --code-ink: #2e394b;
  --body-copy: #526176;
  --meta-chip-bg: #eef3fa;
  --meta-chip-ink: #5c6a7c;
  --summary-link: #536a87;
  --log-severity-bg: #f4f7fb;
  --sample-ink: #2f3b4d;
  --ok-text: #09664f;
  --ok-bg: #e4f5ef;
  --warn-text: #8a530c;
  --warn-bg: #fff1d7;
  --bad-text: #982f2f;
  --bad-bg: #fde5e5;
  --toast-text: #16382f;
  --toast-bg: #e5f4ef;
  --toast-border: #b9ddcf;
  --toast-error-text: #7a2929;
  --toast-error-bg: #fde8e8;
  --toast-error-border: #efbbbb;
  --shadow: 0 1px 2px rgb(20 31 47 / 4%), 0 6px 18px rgb(36 52 79 / 5%);
  --touch-target: 44px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--surface-subtle) 0, var(--surface-gradient-mid) 360px, var(--surface-gradient-end) 100%);
}

button,
select {
  font: inherit;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.product-mark {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 9px 22px rgb(24 33 48 / 13%);
}

h1,
h2,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}

h2 {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

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

select,
button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

select {
  min-width: 76px;
  padding: 0 10px;
}

button {
  padding: 0 14px;
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: var(--hover-line);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
select:focus-visible,
summary:focus-visible,
.chart-shell:focus-visible,
.usage-chart-frame:focus-visible,
.site-layout:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  color: var(--quiet);
  background: var(--surface-disabled);
  transform: none;
}

.dashboard {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.health-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.health-card {
  display: grid;
  gap: 8px;
  height: auto;
  min-height: 126px;
  padding: 14px 15px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.health-card.is-active {
  outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 1px;
}

@media (hover: hover) {
  .health-card:hover {
    box-shadow: 0 1px 2px rgb(20 31 47 / 6%), 0 12px 34px rgb(36 52 79 / 10%);
  }
}

.health-topline,
.mini-metrics,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chart-controls {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.chart-controls button {
  width: 32px;
  min-width: 32px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.chart-controls button:last-child {
  border-right: 0;
}

.chart-controls button:hover:not(:disabled) {
  background: var(--surface-muted);
}

.chart-controls button:disabled {
  color: var(--quiet);
  background: var(--surface-disabled);
}

.health-topline strong {
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  color: var(--ok-text);
  background: var(--ok-bg);
}

.status-pill.warn {
  color: var(--warn-text);
  background: var(--warn-bg);
}

.status-pill.bad {
  color: var(--bad-text);
  background: var(--bad-bg);
}

.health-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: 0;
}

.health-caption,
.mini-metrics,
.section-heading span,
.plan-code,
.quota-label span,
.usage-main span {
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics {
  justify-content: flex-start;
  gap: 8px;
}

.mini-metrics span {
  padding: 3px 7px;
  background: var(--wash);
  border-radius: 5px;
}

.workbench,
.metric-panel,
.primary-pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workbench {
  overflow: hidden;
  margin-bottom: 18px;
}

.site-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.site-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 180px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.site-tabs button.is-active {
  color: var(--accent-text);
  background: var(--panel);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
  align-items: start;
  gap: 0;
}

.primary-pane,
.side-pane {
  min-width: 0;
}

.primary-pane {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 18px;
}

.side-pane {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--line);
}

.side-pane .metric-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.side-pane .metric-panel + .metric-panel {
  border-top: 1px solid var(--line);
}

.metric-panel[hidden] {
  display: none;
}

.section-heading {
  min-height: 26px;
  margin-bottom: 12px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 11px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 720;
}

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

.plan-name {
  display: block;
  font-weight: 760;
}

.quota-bar,
.quota-bar {
  position: relative;
  display: block;
  overflow: hidden;
  height: 7px;
  background: var(--bar-track);
  border-radius: 999px;
}

.quota-bar span,
.quota-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--bar-fill);
  border-radius: inherit;
}

.available-value {
  font-weight: 820;
}

.account-daily-board {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.account-daily-shell {
  max-height: 420px;
}

.account-id {
  display: block;
  font-weight: 760;
}

.account-label {
  display: block;
  overflow: hidden;
  max-width: 220px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-count {
  font-weight: 820;
}

.metric-panel {
  padding: 16px;
}

.quota-list,
.usage-list {
  display: grid;
  gap: 10px;
}

.quota-row,
.usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-raised);
}

.quota-label,
.usage-main {
  min-width: 0;
}

.quota-label strong,
.usage-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.usage-count {
  display: grid;
  justify-items: end;
  min-width: 68px;
  color: var(--ink);
}

.usage-count span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.usage-count strong {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1;
  font-weight: 820;
}

.quota-value {
  text-align: right;
}

.quota-value span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quota-value strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
}

.quota-bar {
  grid-column: 1 / -1;
}

.quota-bar span {
  background: var(--green);
}

.quota-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.quota-row.is-unsupported {
  color: var(--muted);
  background: var(--surface-disabled);
}

.quota-row.is-unsupported .quota-bar span {
  width: 0;
}

.log-board {
  margin-bottom: 18px;
}

.log-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.log-brief {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--wash));
}

.log-brief-lead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
}

.log-brief-lead strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-brief-lead p {
  grid-column: 2;
  color: var(--body-copy);
  font-size: 13px;
  line-height: 1.45;
}

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

.log-total-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: inset 3px 0 0 var(--accent);
}

.log-total-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.log-total-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.log-total-card small {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.log-site-card {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-raised);
}

.log-site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.log-site-head span {
  overflow: hidden;
  max-width: 58%;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-site-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.log-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
  gap: 12px;
  margin-top: 14px;
}

.log-patterns,
.log-samples {
  min-width: 0;
}

#log-patterns,
#log-samples {
  display: grid;
  gap: 8px;
}

.log-pattern,
.log-sample,
.log-insight,
.log-evidence {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-raised);
}

.log-pattern-meta,
.log-sample > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.log-pattern-meta span,
.log-sample > div span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.log-pattern-meta i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 50%;
}

.log-pattern pre,
.log-sample pre,
.log-evidence pre {
  overflow: auto;
  max-height: 112px;
  margin: 0;
  color: var(--code-ink);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-insight,
.log-evidence {
  border-color: var(--line-soft);
}

.log-insight.critical,
.log-evidence.critical {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line-soft));
  background: color-mix(in srgb, var(--red) 4%, var(--surface-raised));
}

.log-insight.warning,
.log-evidence.warning {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line-soft));
  background: color-mix(in srgb, var(--amber) 5%, var(--surface-raised));
}

.log-insight-head,
.log-evidence-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.log-insight-head strong,
.log-evidence-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-insight-head b {
  color: var(--ink);
  font-size: 18px;
}

.log-severity {
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--log-severity-bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.log-insight.critical .log-severity,
.log-evidence.critical .log-severity {
  color: var(--red-text);
  background: color-mix(in srgb, var(--red) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--red) 30%, var(--line-soft));
}

.log-insight.warning .log-severity,
.log-evidence.warning .log-severity {
  color: var(--amber-text);
  background: color-mix(in srgb, var(--amber) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line-soft));
}

.log-insight p,
.log-evidence p {
  margin: 8px 0 0;
  color: var(--body-copy);
  font-size: 13px;
  line-height: 1.45;
}

.log-insight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.log-insight-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--meta-chip-bg);
  color: var(--meta-chip-ink);
  font-size: 12px;
}

.log-insight-samples {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.log-insight-samples li {
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--sample-ink);
}

.log-insight-samples pre {
  overflow: auto;
  max-height: 140px;
  margin: 0;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-insight-details {
  margin-top: 9px;
}

.log-insight-details summary {
  cursor: pointer;
  color: var(--summary-link);
  font-size: 12px;
  font-weight: 720;
}

.log-insight-details[open] summary {
  margin-bottom: 8px;
}

.log-evidence-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-evidence details {
  margin-top: 8px;
}

.log-evidence summary {
  cursor: pointer;
  color: var(--summary-link);
  font-size: 12px;
}

.log-evidence details[open] summary {
  margin-bottom: 8px;
}

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

.log-metric,
.warranty-metric {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-raised);
}

.log-metric span,
.warranty-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.log-metric strong,
.warranty-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1;
}

.log-metric.warn strong,
.warranty-metric.warn strong {
  color: var(--amber-text);
}

.log-metric.danger strong,
.warranty-metric.danger strong {
  color: var(--red-text);
}

.warranty-metric.ok strong {
  color: var(--green-text);
}

.global-trend-board {
  margin-bottom: 18px;
}

.site-usage-board {
  margin-bottom: 18px;
}

.usage-chart-shell {
  position: relative;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.usage-chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-shell {
  position: relative;
}

.usage-chart-frame {
  position: relative;
}

.trend-board canvas,
.usage-chart-shell canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  border: 1px solid var(--chart-frame);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--chart-surface-top), var(--chart-surface-bottom));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), 0 1px 0 rgb(24 33 48 / 3%);
}

.trend-board canvas {
  height: 300px;
}

.usage-chart-shell canvas {
  height: 240px;
}

.chart-marker {
  position: absolute;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--marker) 14%, var(--marker) 86%, transparent);
  opacity: 0.72;
}

.chart-marker::before {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--panel);
  border: 1px solid var(--marker);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(24 33 48 / 15%);
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  width: min(280px, calc(100% - 16px));
  min-width: 172px;
  padding: 10px 11px;
  pointer-events: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 22px rgb(24 33 48 / 10%);
}

.chart-tooltip time {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chart-tooltip .chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.chart-tooltip .chart-row + .chart-row {
  margin-top: 6px;
}

.chart-tooltip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

.chart-tooltip i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-tooltip strong {
  min-width: 28px;
  text-align: right;
  font-size: 13px;
}

.chart-tooltip em {
  min-width: 36px;
  color: var(--chart-delta-flat);
  font-size: 11px;
  font-style: normal;
  font-weight: 720;
  text-align: right;
}

.chart-tooltip em.is-up {
  color: var(--chart-delta-up);
}

.chart-tooltip em.is-down {
  color: var(--chart-delta-down);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--surface-subtle) 76%, var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 8%, transparent);
}

.empty-row {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 7px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 12px;
  color: var(--toast-text);
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 7px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-error {
  color: var(--toast-error-text);
  background: var(--toast-error-bg);
  border-color: var(--toast-error-border);
}

@media (max-width: 1100px) {
  .health-strip,
  .site-layout,
  .log-total-grid,
  .log-summary-grid,
  .log-detail-grid {
    grid-template-columns: 1fr;
  }

  .side-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 920px), (pointer: coarse) {
  button,
  select {
    min-height: var(--touch-target);
  }

  .log-evidence summary {
    display: flex;
    align-items: center;
    min-height: var(--touch-target);
  }
}

@media (max-width: 920px) {
  .table-shell {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead,
  thead tr,
  thead th {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: var(--surface-raised);
  }

  td {
    min-width: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  td:first-child,
  td:nth-child(4) {
    grid-column: 1 / -1;
  }

}

@media (max-width: 720px) {
  .shell-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button,
  .header-actions select {
    flex: 1;
  }

  .dashboard {
    padding: 14px;
  }

  .site-tabs {
    overflow-x: visible;
  }

  .site-tabs button {
    flex: 1;
    min-width: 0;
    gap: 8px;
    padding: 0 12px;
  }

  .health-card {
    min-height: 148px;
  }

  .log-brief-lead {
    grid-template-columns: 1fr;
  }

  .log-brief-lead p {
    grid-column: 1;
  }

  .log-site-metrics,
  .warranty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trend-board canvas {
    height: 300px;
  }

  .usage-chart-shell canvas {
    height: 230px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .toast,
  button,
  select,
  .health-card {
    transition: none;
  }
}
