:root {
  --ink: #17212b;
  --ink-soft: #34414d;
  --muted: #687481;
  --muted-strong: #53606c;
  --canvas: #f3f5f6;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-tint: #edf3f4;
  --line: #dbe1e5;
  --line-strong: #c7d0d6;
  --brand: #17324d;
  --brand-strong: #10263b;
  --brand-contrast: #ffffff;
  --accent: #2e6f75;
  --accent-soft: #dbeaec;
  --positive: #28734e;
  --positive-soft: #e5f2eb;
  --warning: #9a6514;
  --warning-soft: #f8edda;
  --critical: #a63c3c;
  --critical-soft: #f8e5e5;
  --neutral: #727b84;
  --neutral-soft: #eceff1;
  --shadow: 0 1px 2px rgba(20, 35, 48, 0.05), 0 10px 30px rgba(20, 35, 48, 0.04);
  --radius: 14px;
  --radius-small: 9px;
  --content-width: 1440px;
  --focus: #1677ff;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  min-height: 42px;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.header-main {
  display: flex;
  width: min(100% - 40px, var(--content-width));
  min-height: 78px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.03em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-name {
  font-weight: 680;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.control-field {
  display: grid;
  min-width: 132px;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.control-field-wide {
  width: 100%;
}

.control-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 520;
}

.control-field select:hover {
  border-color: #aab6bd;
}

.button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
}

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

.button-secondary:hover {
  background: var(--surface-soft);
}

.auth-gate {
  width: min(680px, calc(100% - 32px));
  margin: 42px auto;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-field {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-error {
  color: var(--critical);
}

.auth-boundary {
  color: var(--muted);
  font-size: 0.875rem;
}

body.auth-required .site-header,
body.auth-required #main-content,
body.auth-required .site-footer {
  display: none;
}

.view-nav {
  display: flex;
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 45px;
  padding: 8px 13px 10px;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
}

.nav-button::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

.nav-button:hover {
  color: var(--brand);
}

.nav-button.is-active {
  color: var(--brand);
}

.nav-button.is-active::after {
  background: var(--accent);
}

.system-banner {
  display: flex;
  width: min(100% - 40px, var(--content-width));
  min-height: 46px;
  margin: 14px auto 0;
  padding: 10px 13px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
}

.system-banner.is-warning {
  border-color: #e4c893;
  background: var(--warning-soft);
}

.system-banner.is-error {
  border-color: #e3b1b1;
  background: var(--critical-soft);
}

.system-banner.is-success {
  border-color: #b5d8c5;
  background: var(--positive-soft);
}

.system-banner-dot,
.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neutral);
}

.system-banner.is-warning .system-banner-dot,
.status-warning {
  background: var(--warning);
}

.system-banner.is-error .system-banner-dot,
.status-critical {
  background: var(--critical);
}

.system-banner.is-success .system-banner-dot,
.status-positive {
  background: var(--positive);
}

.status-neutral {
  background: var(--neutral);
}

.banner-action {
  min-height: 30px;
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.content {
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
  padding: 35px 0 48px;
}

.screen {
  display: grid;
  gap: 18px;
}

.page-heading {
  display: flex;
  min-height: 72px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--ink);
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 690;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.35;
}

.page-intro {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.freshness,
.view-stat,
.health-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel,
.metric-card,
.performance-card,
.health-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: 19px;
}

.section-heading {
  display: flex;
  min-height: 34px;
  margin-bottom: 13px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.count-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
}

.metric-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--line-strong);
  content: "";
}

.metric-card.metric-warning::before {
  background: var(--warning);
}

.metric-card.metric-critical::before {
  background: var(--critical);
}

.metric-card.metric-positive::before {
  background: var(--positive);
}

.metric-label {
  display: block;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 630;
}

.metric-value {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 38px);
  font-variant-numeric: tabular-nums;
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.metric-note {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.opening-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.stack-list,
.movement-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.attention-item:first-child,
.movement-item:first-child {
  padding-top: 4px;
  border-top: 0;
}

.attention-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-link,
.text-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 690;
  text-align: left;
  text-decoration: none;
}

.task-link:hover,
.text-button:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button {
  font-size: 12px;
  white-space: nowrap;
}

.item-reason {
  margin: 5px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
}

.item-meta {
  display: flex;
  margin-top: 9px;
  gap: 7px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.attention-action {
  display: grid;
  max-width: 220px;
  align-content: center;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.next-action {
  color: var(--ink-soft);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.chip-critical {
  border-color: #efc6c6;
  background: var(--critical-soft);
  color: #843030;
}

.chip-warning {
  border-color: #ecd6ad;
  background: var(--warning-soft);
  color: #765018;
}

.chip-positive {
  border-color: #c4dfd0;
  background: var(--positive-soft);
  color: #205f40;
}

.chip-neutral {
  border-color: #d7dde0;
  background: var(--neutral-soft);
  color: #59626b;
}

.movement-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.movement-title {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 620;
}

.movement-detail,
.movement-time {
  color: var(--muted);
  font-size: 12px;
}

.chart-panel {
  padding-bottom: 13px;
}

.trend-root {
  min-height: 250px;
}

.trend-figure {
  margin: 0;
}

.trend-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.trend-svg {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: inherit;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-point:focus {
  stroke: var(--focus);
  stroke-width: 5;
}

.trend-caption {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trend-data {
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 12px;
}

.trend-data summary,
.definition-details summary {
  cursor: pointer;
  font-weight: 650;
}

.metric-task-list {
  display: flex;
  gap: 7px 12px;
  flex-wrap: wrap;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  padding-top: 8px;
  border-top: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.table-primary {
  min-width: 180px;
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-cell {
  white-space: nowrap;
}

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.75fr);
  gap: 18px;
  align-items: start;
}

.task-picker-panel {
  position: sticky;
  top: 146px;
}

.helper-text {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.timeline-panel {
  min-height: 320px;
}

.task-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.task-summary-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.task-summary-heading h2 {
  font-size: 22px;
}

.task-summary-grid,
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.summary-field {
  min-width: 0;
  padding: 10px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.summary-label,
.health-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 730;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.summary-value,
.health-value {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 630;
  overflow-wrap: anywhere;
}

.timeline-section {
  margin-top: 22px;
}

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

.timeline-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 13px;
  padding-bottom: 20px;
}

.timeline-event:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  margin-top: 3px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.event-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.event-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.event-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.event-summary {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.event-meta {
  display: flex;
  margin-top: 9px;
  gap: 6px 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.event-source {
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 11px;
  overflow-wrap: anywhere;
}

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

.record-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.record-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.performance-card {
  display: grid;
  min-height: 230px;
  padding: 18px;
  align-content: start;
}

.performance-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.performance-value {
  display: block;
  margin: 10px 0 4px;
  color: var(--ink);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  font-weight: 690;
  letter-spacing: -0.04em;
}

.sample-line {
  color: var(--muted);
  font-size: 12px;
}

.definition-details {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 12px;
}

.definition-details p {
  margin: 9px 0 0;
}

.coverage-panel {
  margin-top: 2px;
}

.coverage-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1.4fr);
  gap: 18px;
}

.coverage-emphasis {
  padding: 15px;
  border-radius: 10px;
  background: var(--surface-tint);
}

.coverage-emphasis strong {
  display: block;
  color: var(--brand);
  font-size: 22px;
}

.coverage-emphasis span {
  color: var(--muted-strong);
  font-size: 12px;
}

.coverage-notes {
  color: var(--muted-strong);
  font-size: 13px;
}

.coverage-notes p {
  margin: 0 0 8px;
}

.health-grid {
  margin-top: 0;
}

.health-card {
  min-height: 120px;
  padding: 16px;
}

.health-value {
  margin-top: 9px;
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.health-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-grid {
  margin-top: 0;
}

.key-value-list {
  display: grid;
  margin: 0;
}

.key-value-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.key-value-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.key-value-row dt {
  color: var(--muted);
  font-size: 12px;
}

.key-value-row dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warning-item {
  padding: 10px 11px;
  border-left: 3px solid var(--warning);
  border-radius: 7px;
  background: var(--warning-soft);
  color: #624613;
  font-size: 12px;
}

.empty-state,
.error-state,
.loading-state {
  display: grid;
  min-height: 170px;
  padding: 30px 18px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.compact-empty {
  min-height: 275px;
}

.empty-state h2,
.empty-state h3,
.error-state h2,
.error-state h3 {
  margin: 8px 0 4px;
}

.empty-state p,
.error-state p,
.loading-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--accent);
  font-size: 20px;
  font-weight: 650;
}

.retry-button {
  min-height: 38px;
  margin-top: 13px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.loading-state {
  min-height: 120px;
}

.loading-bars {
  display: flex;
  margin-bottom: 12px;
  align-items: end;
  gap: 5px;
}

.loading-bars span {
  display: block;
  width: 5px;
  height: 17px;
  border-radius: 4px;
  background: var(--accent);
  animation: loading-pulse 1s ease-in-out infinite alternate;
}

.loading-bars span:nth-child(2) {
  height: 25px;
  animation-delay: 0.15s;
}

.loading-bars span:nth-child(3) {
  height: 12px;
  animation-delay: 0.3s;
}

.site-footer {
  display: flex;
  width: min(100% - 40px, var(--content-width));
  min-height: 66px;
  margin: 0 auto;
  padding: 18px 0 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 14px;
  border: 1px solid #e3b1b1;
  border-radius: 10px;
  background: var(--critical-soft);
  color: #772b2b;
  text-align: center;
}

@keyframes loading-pulse {
  from {
    opacity: 0.35;
    transform: scaleY(0.75);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 1050px) {
  .opening-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .movement-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .movement-item:nth-child(2) {
    padding-top: 4px;
    border-top: 0;
  }

  .task-summary-grid,
  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .site-header {
    position: relative;
  }

  .header-main {
    min-height: 0;
    padding: 14px 0 12px;
    align-items: start;
  }

  .dashboard-controls {
    flex-wrap: wrap;
  }

  .control-field {
    min-width: 122px;
  }

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

  .metric-card {
    min-height: 112px;
  }

  .metric-value {
    font-size: 32px;
  }

  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .task-picker-panel {
    position: static;
  }

  .performance-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .header-main,
  .view-nav,
  .content,
  .site-footer,
  .system-banner {
    width: min(100% - 24px, var(--content-width));
  }

  .header-main {
    display: grid;
    gap: 12px;
  }

  .dashboard-controls {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .install-button {
    grid-column: 1 / -1;
  }

  .content {
    padding-top: 25px;
  }

  .page-heading {
    display: grid;
    align-items: start;
  }

  .freshness,
  .view-stat,
  .health-pill {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .panel {
    padding: 15px;
  }

  .section-heading {
    align-items: start;
  }

  .attention-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .attention-action {
    max-width: none;
    justify-items: start;
    text-align: left;
  }

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

  .movement-item:nth-child(2) {
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .task-summary-heading,
  .event-topline {
    display: grid;
  }

  .event-time {
    white-space: normal;
  }

  .task-summary-grid,
  .health-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .key-value-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .site-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .system-banner,
  .install-button,
  .text-button,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  .panel,
  .metric-card,
  .performance-card,
  .health-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
