:root {
  color-scheme: dark;
  --bg: #0a0d26;
  --surface: #12163a;
  --surface-inset: #070a1e;
  --border: #272c58;
  --border-strong: #3b4184;
  --text: #e8e9f4;
  --text-bright: #f6f4ee;
  --text-muted: #a0a5cf;
  --heading: #c3befd;
  --accent: #8b85d6;
  --accent-fill: #5e58a8;
  --focus: #8b85d6;
  --ok: #3fb950;
  --warn: #f0a24e;
  --danger: #f38aa1;
  --radius: 10px;
  --radius-large: 16px;
  --shadow: 0 14px 36px -28px rgba(20, 25, 70, 0.9);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #faf8fd;
  --surface: #ffffff;
  --surface-inset: #f1eefa;
  --border: #ded9f4;
  --border-strong: #c3befd;
  --text: #141946;
  --text-bright: #0e1135;
  --text-muted: #585c7d;
  --heading: #141946;
  --accent: #5e58a8;
  --accent-fill: #7069bc;
  --focus: #5e58a8;
  --ok: #1a7f37;
  --warn: #b35c00;
  --danger: #bb5471;
  --shadow: 0 14px 36px -28px rgba(112, 105, 188, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
}

[hidden] {
  display: none !important;
}

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

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

a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 120ms ease;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner,
.page-shell {
  width: min(100% - 2rem, 82rem);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.brand-name {
  color: var(--text-bright);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand-context {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fleet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.fleet-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  color: var(--text-muted);
  font-weight: 650;
  text-decoration: none;
}

.fleet-nav a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.fleet-nav a[aria-current="page"] {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: #ffffff;
}

.page-shell {
  padding-block: 2.25rem 4rem;
}

.page-heading,
.section-heading,
.filter-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.page-heading {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

h2 {
  margin: 0;
  font-size: 1.2rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.page-intro,
.section-meta {
  color: var(--text-muted);
}

.page-intro {
  max-width: 44rem;
  margin: 0.45rem 0 0;
}

.section-meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.text-link {
  align-self: center;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.message,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--surface-inset);
  color: var(--text-muted);
}

.message {
  margin-block: 1.25rem;
}

.error-message {
  border-color: var(--danger);
  color: var(--danger);
}

.page-section {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 1rem;
}

.summary-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
}

.summary-card,
.detail-item,
.cell-list > li,
.reason-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-inset);
  padding: 0.9rem 1rem;
}

.summary-card h3,
.detail-item dt,
.detail-item dd {
  margin: 0;
}

.summary-card h3,
.detail-item dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-value,
.detail-item dd {
  margin-top: 0.35rem;
  color: var(--text-bright);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.summary-detail,
.cell-secondary {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.cell-list,
.reason-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cell-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 0.75rem;
}

.cell-primary {
  margin: 0;
  color: var(--text-bright);
  font-size: 1rem;
  font-weight: 750;
}

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

table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
}

caption {
  padding: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: left;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

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

.filter-section {
  align-items: end;
}

.select-field {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 18rem);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  background: var(--surface-inset);
  color: var(--text);
  font: inherit;
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.compact-grid,
.reason-panel {
  margin-top: 1rem;
}

.reason-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.reason-list li {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.state-ok {
  color: var(--ok);
}

.state-warn {
  color: var(--warn);
}

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

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

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
    padding-block: 1rem;
  }

  .fleet-nav {
    width: 100%;
  }

  .fleet-nav a {
    flex: 1;
    text-align: center;
  }

  .page-shell {
    padding-block: 1.5rem 3rem;
  }

  .page-section {
    padding: 1rem;
  }

  .filter-section,
  .select-field {
    width: 100%;
  }
}
