:root {
  color-scheme: dark;
  --black: #050505;
  --panel: #0a0a0a;
  --panel-2: #101010;
  --white: #f5f5f2;
  --silver: #aaa9a4;
  --muted: #777772;
  --line: #2c2c2a;
  --line-bright: #5f5f5b;
  --live: #d7ff48;
  --warn: #ffd35a;
  --lost: #ff6969;
  --radius: 2px;
  --max: 1560px;
  --home-calendar-width: 380px;
  --rainbow-hue: 0;
}

@property --rainbow-hue {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --hue-offset {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --h {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  min-width: 280px;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.07), transparent 32rem),
    var(--black);
  color: var(--white);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font: inherit;
  font-weight: 700;
}

a { color: inherit; }

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

.header-inner {
  width: min(100%, var(--max));
  min-height: 70px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 42px);
  display: flex;
  align-items: center;
  gap: 16px 24px;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark,
.section-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  transform: rotate(45deg);
}

.brand-mark::after,
.section-mark::after {
  content: "+";
  transform: rotate(-45deg);
  font-size: 18px;
  line-height: 1;
  color: var(--silver);
}

.header-nav::-webkit-scrollbar { display: none; }

.nav-link,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.nav-link:hover,
.button:hover {
  border-color: var(--line-bright);
  background: #141414;
}

.nav-link.is-active {
  color: var(--live);
  border-color: rgba(215, 255, 72, .35);
  background: rgba(215, 255, 72, .06);
}

.nav-badge {
  min-width: 1.4em;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(215, 255, 72, .4);
  color: var(--live);
  font-size: .62rem;
  letter-spacing: .06em;
}

.access-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 18px;
  width: min(100%, var(--max));
  padding: 12px 16px;
  border: 1px solid rgba(215, 255, 72, .35);
  background: rgba(215, 255, 72, .08);
  color: var(--live);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

.header-nav-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 2px;
}

.header-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
  padding-left: 4px;
}

.header-account-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  transform: rotate(45deg);
}

.header-account-mark::after {
  content: "+";
  transform: rotate(-45deg);
  font-size: 13px;
  line-height: 1;
  color: var(--silver);
}

.header-account-id {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.header-account-name {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.header-account-role {
  color: var(--muted);
  font-size: .52rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.header-account-role.is-admin {
  color: var(--live);
}

.header-logout {
  min-height: 36px;
}

.button:active { transform: translateY(1px); }
.button.primary { background: var(--white); color: #050505; border-color: var(--white); }
.button.danger { border-color: #723d3d; color: #ffb3b3; }
.button.small { min-height: 36px; padding: 0 12px; font-size: .68rem; }

.page-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(22px, 3vw, 48px) clamp(16px, 3vw, 42px) 80px;
}

.section {
  scroll-margin-top: 90px;
  margin-top: clamp(42px, 7vw, 96px);
}

.section:first-child { margin-top: 0; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-mark { width: 20px; height: 20px; }
.section-mark::after { font-size: 14px; }

.section-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 900;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.section-kicker,
.telemetry-label,
.mini-label,
.form-label {
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: clamp(.68rem, 1.5vw, .82rem);
  line-height: 1.3;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 78vh;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 45%),
    #000;
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.video-idle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  background: radial-gradient(circle, rgba(255,255,255,.035), transparent 42%);
  transition: opacity .25s ease;
}
.video-idle.hidden { opacity: 0; }

.idle-title {
  margin: 0;
  font-size: clamp(1.4rem, 5vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -.065em;
  text-transform: uppercase;
}

.idle-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(.8rem, 2vw, 1rem);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.video-toolbar,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.status-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #0a0a0a;
  border-radius: 99px;
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .7rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(255,255,255,.035);
}
.status-pill.live { color: var(--live); border-color: rgba(215,255,72,.35); }
.status-pill.live .status-dot { background: var(--live); box-shadow: 0 0 14px rgba(215,255,72,.75); }
.status-pill.delayed { color: var(--warn); border-color: rgba(255,211,90,.35); }
.status-pill.delayed .status-dot { background: var(--warn); }
.status-pill.lost { color: var(--lost); border-color: rgba(255,105,105,.35); }
.status-pill.lost .status-dot { background: var(--lost); }
.status-pill.standby { color: var(--silver); border-color: var(--line); }
.status-pill.standby .status-dot { background: var(--muted); }

.hidden { display: none !important; }

body[data-page="home"] .header-inner { min-height: 56px; }

body[data-page="home"] .page-shell.home-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: clamp(10px, 1.4vw, 18px);
  padding-bottom: clamp(16px, 2vw, 28px);
}

body[data-page="home"] .section {
  margin-top: 0;
  scroll-margin-top: 72px;
}

body[data-page="home"] .footer {
  margin-top: clamp(16px, 2vw, 24px);
}

.home-dashboard {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: var(--home-calendar-width) minmax(0, 1fr);
  grid-template-areas: "cal main";
  align-items: start;
  gap: clamp(12px, 1.8vw, 18px);
  min-height: 0;
  animation: home-rainbow-drift 720s linear infinite;
}

@keyframes home-rainbow-drift {
  from { --rainbow-hue: 0; }
  to { --rainbow-hue: 360; }
}

@media (prefers-reduced-motion: reduce) {
  .home-dashboard {
    animation: none;
  }
}

.home-dashboard:not(:has(.home-calendar-section:not(.hidden))) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

.home-calendar-section {
  grid-area: cal;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 88px);
}

.home-right {
  grid-area: main;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  align-self: start;
  gap: clamp(10px, 1.4vw, 14px);
  min-width: 0;
  min-height: 0;
  height: auto;
}

.home-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.4vw, 14px);
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.home-tools:not(:has(.home-pomodoro-panel:not(.hidden))),
.home-tools:not(:has(.home-arcade-panel:not(.hidden))) {
  grid-template-columns: minmax(0, 1fr);
}

.home-tools:not(:has(.home-pomodoro-panel:not(.hidden), .home-arcade-panel:not(.hidden))) {
  display: none;
}

.home-uas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 14px);
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.home-tools > * {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.home-uas > * {
  min-width: 0;
  min-height: 0;
  height: auto;
}

@media (max-width: 720px) {
  .home-dashboard,
  .home-dashboard:not(:has(.home-calendar-section:not(.hidden))) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "cal"
      "main";
  }

  .home-right {
    grid-template-rows: auto auto auto;
  }

  .home-tools,
  .home-tools:not(:has(.home-arcade-panel:not(.hidden))) {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-calendar-panel,
  .home-pomodoro-panel,
  .home-arcade-panel,
  .home-notes-bar {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .home-uas {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  .home-clocks-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-clocks-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .home-clocks-grid {
    grid-template-columns: 1fr;
  }
}

.home-clocks-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 12px);
}

.home-clock {
  --h: calc(var(--rainbow-hue) + var(--hue-offset, 0));
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.3);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 42%),
    linear-gradient(160deg, rgba(255,255,255,.04), transparent 58%),
    var(--panel);
}

.home-clock-city {
  color: var(--silver);
  font-size: clamp(.52rem, 1vw, .62rem);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.home-clock-time {
  color: hsl(var(--h) 82% 68%);
  font-size: clamp(.95rem, 1.8vw, 1.28rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.home-clock-meta {
  color: var(--muted);
  font-size: clamp(.46rem, .8vw, .54rem);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.home-clock-kuwait { --hue-offset: 0; }
.home-clock-zulu { --hue-offset: 72; }
.home-clock-sumter { --hue-offset: 144; }
.home-clock-omaha { --hue-offset: 216; }
.home-clock-socal { --hue-offset: 288; }

.home-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  align-items: stretch;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
  color: var(--white);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.home-card:hover {
  border-color: var(--line-bright);
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), transparent 55%),
    #121212;
  transform: translateY(-2px);
}

.home-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.home-card-heading {
  min-width: 0;
}

.home-card-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  transform: rotate(45deg);
}

.home-card-mark::after {
  content: "+";
  transform: rotate(-45deg);
  font-size: 20px;
  line-height: 1;
  color: var(--silver);
}

.home-card-label {
  min-width: 0;
  margin: 0;
  display: block;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: uppercase;
}

.home-card-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.45;
}

.home-card-launch,
.home-card-orange,
.home-card-purple,
.home-card-cyan {
  --h: calc(var(--rainbow-hue) + var(--hue-offset, 0));
  border-color: hsl(var(--h) 72% 54% / 0.32);
  background:
    radial-gradient(circle at 20% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
}

.home-card-launch { --hue-offset: 180; }
.home-card-orange { --hue-offset: 120; }
.home-card-purple { --hue-offset: 240; }
.home-card-cyan { --hue-offset: 300; }

.home-card-launch:hover,
.home-card-orange:hover,
.home-card-purple:hover,
.home-card-cyan:hover {
  border-color: hsl(var(--h) 78% 60% / 0.52);
  background:
    radial-gradient(circle at 20% 0%, hsl(var(--h) 90% 52% / 0.2), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.06), transparent 55%),
    #121212;
}

.home-card-launch .home-card-label,
.home-card-orange .home-card-label,
.home-card-purple .home-card-label,
.home-card-cyan .home-card-label {
  color: hsl(var(--h) 82% 66%);
}

.home-card-launch .home-card-mark,
.home-card-orange .home-card-mark,
.home-card-purple .home-card-mark,
.home-card-cyan .home-card-mark {
  border-color: hsl(var(--h) 72% 54% / 0.45);
}

.home-card-launch .home-card-mark::after,
.home-card-orange .home-card-mark::after,
.home-card-purple .home-card-mark::after,
.home-card-cyan .home-card-mark::after {
  color: hsl(var(--h) 82% 66%);
}

.home-notes-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  height: auto;
  padding: 10px 14px;
}

.home-notes-bar .home-card-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.home-notes-bar .home-card-note {
  margin: 0;
}

.home-notes-bar .home-card-mark {
  margin-top: 0;
}

.home-card:not(:has(.home-card-fleet)) {
  grid-template-rows: auto minmax(0, 1fr);
}

.home-card-fleet-empty {
  visibility: hidden;
  pointer-events: none;
}

.home-card-fleet {
  width: 100%;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.home-card-fleet .fleet-mini-scroll {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  overflow: visible;
}

.fleet-mini-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.fleet-mini-table th,
.fleet-mini-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-mini-table th:first-child,
.fleet-mini-table td:first-child {
  width: 42%;
}

.fleet-mini-table th:last-child,
.fleet-mini-table td:last-child {
  width: 58%;
}

.fleet-mini-table th {
  color: var(--muted);
  font-size: .56rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.fleet-mini-more,
.fleet-empty {
  flex-shrink: 0;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dingo-fleet-mini {
  border: 1px solid hsl(var(--h) 72% 54% / 0.2);
  border-radius: var(--radius);
  padding: 10px;
  background: hsl(var(--h) 80% 50% / 0.04);
}

.dingo-fleet-mini .fleet-mini-table th,
.dingo-fleet-mini .fleet-mini-table td {
  font-size: .64rem;
}

.platform-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.platform-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--silver);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.platform-tab.active {
  color: #ffd64a;
  border-color: rgba(255, 214, 74, .35);
  background: rgba(255, 214, 74, .06);
}

.platform-tab-panel { display: none; }
.platform-tab-panel.active { display: block; }

.wiki-shell {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(14px, 2vw, 22px);
}

.wiki-sidebar {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.wiki-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .56rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.wiki-nav {
  display: grid;
  gap: 4px;
}

.wiki-nav a {
  display: block;
  padding: 8px 10px;
  border: 1px solid transparent;
  color: var(--silver);
  text-decoration: none;
  font-size: .72rem;
  letter-spacing: .04em;
}

.wiki-nav a:hover,
.wiki-nav a.is-active {
  border-color: var(--line-bright);
  background: #101010;
  color: var(--white);
}

.wiki-nav a.is-active {
  color: var(--live);
  border-color: rgba(215, 255, 72, .35);
  background: rgba(215, 255, 72, .06);
}

.wiki-nav a.is-shared {
  color: var(--muted);
}

.wiki-empty {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wiki-article {
  min-width: 0;
}

.wiki-article-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.wiki-article-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wiki-article-status {
  margin: 0;
  color: var(--muted);
  font-size: .56rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wiki-body {
  color: var(--silver);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.55;
}

.wiki-body h1,
.wiki-body h2,
.wiki-body h3,
.wiki-body h4 {
  color: var(--white);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wiki-body h1 { font-size: 1.3rem; }
.wiki-body h2 { font-size: 1.1rem; margin-top: 1.4em; }
.wiki-body h3 { font-size: .95rem; margin-top: 1.2em; }

.wiki-body p { margin: 0 0 0.9em; }
.wiki-body ul,
.wiki-body ol { margin: 0 0 0.9em; padding-left: 1.2em; }
.wiki-body li { margin: 0.25em 0; }
.wiki-body a { color: var(--live); }
.wiki-body code,
.wiki-body pre {
  background: #080808;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82em;
  font-weight: 500;
}
.wiki-body code { padding: 0.1em 0.35em; }
.wiki-body pre { padding: 12px 14px; overflow: auto; }
.wiki-body pre code { border: 0; padding: 0; }
.wiki-body blockquote {
  margin: 0 0 0.9em;
  padding: 8px 12px;
  border-left: 2px solid var(--line-bright);
  color: var(--muted);
}
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
}
.wiki-table th,
.wiki-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  font-size: .78rem;
}
.wiki-table th {
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .wiki-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-sidebar {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.platform-fleet-panel {
  display: grid;
  gap: 18px;
}

.home-card-yellow {
  min-height: clamp(240px, 34vw, 320px);
  border-color: rgba(255, 214, 74, .24);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 214, 74, .1), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
}

.home-card-yellow:hover {
  border-color: rgba(255, 214, 74, .48);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 214, 74, .14), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.06), transparent 55%),
    #121212;
}

.home-card-yellow .home-card-label { color: #ffd64a; }
.home-card-yellow .home-card-mark { border-color: rgba(255, 214, 74, .45); }
.home-card-yellow .home-card-mark::after { color: #ffd64a; }

.home-calendar-section {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-calendar-panel {
  --hue-offset: 0;
  --h: calc(var(--rainbow-hue) + var(--hue-offset));
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid hsl(var(--h) 72% 54% / 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
}

.home-calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 6px 6px 10px 4px;
  border-bottom: 1px solid hsl(var(--h) 70% 55% / 0.2);
  flex-shrink: 0;
  overflow: visible;
}

.home-calendar-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  overflow: visible;
}

.home-calendar-label {
  margin: 0 0 3px;
  color: hsl(var(--h) 82% 66%);
  font-family: Arial, Helvetica, "Helvetica Neue", sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  font-synthesis: none;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: none;
}

.home-calendar-open {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid hsl(var(--h) 72% 54% / 0.38);
  border-radius: var(--radius);
  background: hsl(var(--h) 80% 50% / 0.06);
  color: hsl(var(--h) 82% 66%);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.home-calendar-open:hover {
  color: hsl(var(--h) 85% 78%);
  border-color: hsl(var(--h) 78% 60% / 0.55);
  background: hsl(var(--h) 80% 50% / 0.12);
  transform: translateY(-1px);
}

.home-calendar-open-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.home-calendar-panel .home-card-mark {
  flex-shrink: 0;
  margin-top: 4px;
  border-color: hsl(var(--h) 72% 54% / 0.45);
  overflow: visible;
}

.home-calendar-panel .home-card-mark::after { color: hsl(var(--h) 82% 66%); }

.calendar-connect {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  flex-shrink: 0;
}

.calendar-connect-copy {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.calendar-connect .form-input {
  min-height: 42px;
  font-size: .82rem;
}

.calendar-connect-note {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .04em;
}

.calendar-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
}

.home-pomodoro-panel {
  --hue-offset: 60;
  --h: calc(var(--rainbow-hue) + var(--hue-offset));
  min-width: 0;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
}

.home-pomodoro-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 2px 2px 8px 0;
  border-bottom: 1px solid hsl(var(--h) 70% 55% / 0.2);
  flex-shrink: 0;
}

.home-pomodoro-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.home-pomodoro-label {
  margin: 0 0 3px;
  color: hsl(var(--h) 82% 66%);
  font-family: Arial, Helvetica, "Helvetica Neue", sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  font-synthesis: none;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: none;
}

.home-pomodoro-panel .home-card-mark {
  flex-shrink: 0;
  margin-top: 4px;
  border-color: hsl(var(--h) 72% 54% / 0.45);
}

.home-pomodoro-panel .home-card-mark::after { color: hsl(var(--h) 82% 66%); }

.home-arcade-panel {
  --hue-offset: 180;
  --h: calc(var(--rainbow-hue) + var(--hue-offset));
  min-width: 0;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.home-arcade-panel:hover {
  border-color: hsl(var(--h) 78% 60% / 0.55);
  transform: translateY(-2px);
}

.home-arcade-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 2px 2px 8px 0;
  border-bottom: 1px solid hsl(var(--h) 70% 55% / 0.2);
  flex-shrink: 0;
}

.home-arcade-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.home-arcade-label {
  margin: 0 0 3px;
  color: hsl(var(--h) 82% 66%);
  font-family: Arial, Helvetica, "Helvetica Neue", sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  font-synthesis: none;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: none;
}

.home-arcade-panel .home-card-mark {
  flex-shrink: 0;
  margin-top: 4px;
  border-color: hsl(var(--h) 72% 54% / 0.45);
}

.home-arcade-panel .home-card-mark::after { color: hsl(var(--h) 82% 66%); }

.arcade-highscore {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.arcade-board {
  list-style: none;
  margin: 0;
  padding: 2px 0 4px;
  display: grid;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
}

.arcade-board-row {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.arcade-board-rank {
  color: hsl(var(--h) 70% 62% / 0.7);
  font-variant-numeric: tabular-nums;
}

.arcade-board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: hsl(var(--h) 70% 78%);
}

.arcade-board-score {
  color: hsl(var(--h) 82% 70%);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.arcade-board-row.is-empty .arcade-board-name,
.arcade-board-row.is-empty .arcade-board-score {
  color: var(--muted);
  opacity: .55;
}

.arcade-board-row:first-child:not(.is-empty) .arcade-board-name,
.arcade-board-row:first-child:not(.is-empty) .arcade-board-score {
  color: hsl(var(--h) 82% 66%);
}

.arcade-play-cue {
  margin: 8px 0 0;
  color: hsl(var(--h) 82% 66%);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-page="arcade"] {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-page="arcade"] .site-header {
  flex-shrink: 0;
}

.arcade-shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: none;
}

.arcade-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}

.arcade-modes-back.is-hidden {
  display: none;
}

.arcade-bar-title {
  margin: 0;
  color: var(--white);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.arcade-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #1a140c;
}

.arcade-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.arcade-modes {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px;
  background: rgba(8, 6, 4, 0.46);
  z-index: 2;
}

.arcade-modes.is-hidden {
  display: none;
}

.arcade-mode-card {
  --hue-offset: 180;
  --h: calc(var(--rainbow-hue) + var(--hue-offset));
  width: min(280px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 16px 16px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.38);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--h) 88% 52% / 0.16), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.arcade-mode-card[data-mode="owa"] {
  --hue-offset: 28;
}

.arcade-mode-card:hover,
.arcade-mode-card:focus-visible {
  border-color: hsl(var(--h) 78% 60% / 0.7);
  outline: none;
}

.arcade-mode-name {
  color: hsl(var(--h) 82% 66%);
  font-family: Arial, Helvetica, "Helvetica Neue", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.arcade-mode-copy {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.45;
}

.pomodoro-status {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pomodoro-mode-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pomodoro-mode {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  cursor: pointer;
}

.pomodoro-mode.is-active {
  border-color: hsl(var(--h) 72% 54% / 0.45);
  color: hsl(var(--h) 82% 66%);
  background: hsl(var(--h) 80% 50% / 0.08);
}

.pomodoro-clock-wrap {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 4px auto 8px;
}

.pomodoro-ring {
  width: 124px;
  height: 124px;
  transform: rotate(-90deg);
}

.pomodoro-ring-track,
.pomodoro-ring-progress {
  fill: none;
  stroke-width: 6;
}

.pomodoro-ring-track {
  stroke: hsl(var(--h) 72% 54% / 0.18);
}

.pomodoro-ring-progress {
  stroke: hsl(var(--h) 82% 66%);
  stroke-linecap: square;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
}

.pomodoro-clock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.pomodoro-clock time {
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pomodoro-clock span {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pomodoro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pomodoro-actions .button {
  min-height: 32px;
  padding: 0 12px;
  font-size: .68rem;
}

#pomodoro-toggle {
  border-color: hsl(var(--h) 72% 54% / 0.42);
  color: hsl(var(--h) 82% 66%);
}

.pomodoro-sessions {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-widget-status {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-day-track {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid hsl(var(--h) 70% 55% / 0.2);
  flex-shrink: 0;
}

.calendar-day-rail {
  position: relative;
  height: 10px;
  border: 1px solid hsl(var(--h) 70% 55% / 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  overflow: visible;
}

.calendar-day-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: hsl(var(--h) 75% 55% / 0.38);
  pointer-events: none;
}

.calendar-day-segment {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 999px;
  background: hsl(var(--h) 75% 55% / 0.24);
  pointer-events: none;
}

.calendar-day-now {
  position: absolute;
  top: 50%;
  left: 0;
  width: 2px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: hsl(var(--h) 82% 66%);
  pointer-events: none;
}

.calendar-day-now span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  color: hsl(var(--h) 82% 66%);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calendar-day-bounds {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-day-bounds span:nth-child(2) {
  color: hsl(var(--h) 82% 66%);
  text-align: center;
}

.calendar-day-bounds span:last-child { text-align: right; }

.calendar-day-hours {
  position: relative;
  height: 16px;
  margin-top: 6px;
}

.calendar-day-hour {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calendar-day-hour.is-now {
  color: hsl(var(--h) 82% 66%);
}

.calendar-all-day {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-all-day-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid hsl(var(--h) 70% 55% / 0.22);
  border-radius: var(--radius);
  background: hsl(var(--h) 80% 50% / 0.06);
}

.calendar-all-day-label {
  flex-shrink: 0;
  color: hsl(var(--h) 82% 66%);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.calendar-all-day-title {
  color: var(--white);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
}

.calendar-agenda {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.calendar-agenda-item {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr);
  gap: 8px 14px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.calendar-agenda-item-past { opacity: .4; }

.calendar-agenda-item-current {
  margin: 4px 0;
  padding: 12px 10px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.32);
  border-radius: var(--radius);
  background: hsl(var(--h) 80% 50% / 0.08);
  opacity: 1;
}

.calendar-agenda-item-current .calendar-agenda-time,
.calendar-agenda-item-current .calendar-agenda-title {
  color: hsl(var(--h) 82% 66%);
}

.calendar-agenda-now {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: hsl(var(--h) 82% 66%);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  scroll-margin: 80px;
}

.calendar-agenda-now::before,
.calendar-agenda-now::after {
  content: "";
  flex: 1;
  height: 1px;
  background: hsl(var(--h) 72% 54% / 0.3);
}

.calendar-agenda-time {
  color: hsl(var(--h) 82% 66%);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calendar-agenda-title {
  color: var(--white);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-transform: none;
}

.calendar-agenda-duration {
  grid-column: 2;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
}

.calendar-agenda-gap {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr);
  gap: 8px 14px;
  padding: 6px 0;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .55;
}

.calendar-agenda-gap span:last-child {
  text-transform: none;
  letter-spacing: .02em;
}

.maintenance-refreshed {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.maintenance-platforms {
  display: grid;
  gap: 18px;
}

.maintenance-platform {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.maintenance-platform-dingo {
  border-color: rgba(215, 255, 72, .2);
  background:
    radial-gradient(circle at 10% 0%, rgba(215, 255, 72, .07), transparent 38%),
    var(--panel);
}

.maintenance-platform-k1000 {
  border-color: rgba(180, 140, 255, .22);
  background:
    radial-gradient(circle at 10% 0%, rgba(180, 140, 255, .08), transparent 38%),
    var(--panel);
}

.maintenance-platform-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.maintenance-platform-title {
  margin: 0 0 4px;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.maintenance-platform-meta {
  margin: 0;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.maintenance-platform-link {
  flex-shrink: 0;
  color: var(--silver);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}

.maintenance-platform-link:hover { color: var(--white); }

.maintenance-table-block + .maintenance-table-block { margin-top: 18px; }

.maintenance-table-title {
  margin: 0 0 10px;
  color: var(--silver);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.maintenance-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.maintenance-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.maintenance-table th,
.maintenance-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: left;
  vertical-align: top;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
}

.maintenance-table th {
  color: var(--silver);
  font-size: .64rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .03);
}

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

.maintenance-status.status-ready { color: var(--live); }
.maintenance-status.status-work { color: #ff9f43; }
.maintenance-status.status-waiting { color: #9eb8ff; }
.maintenance-status.status-test { color: #ffd64a; }
.maintenance-status.status-nmc { color: var(--lost); }
.maintenance-status.status-monitor { color: var(--warn); }

.maintenance-error {
  margin: 0;
  color: var(--lost);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: none;
}

.muted-text {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .03em;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.telemetry-card {
  min-height: clamp(150px, 15vw, 235px);
  padding: clamp(18px, 2.6vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), transparent 48%),
    var(--panel);
}

.telemetry-card.wide { grid-column: span 2; }
.telemetry-card.full { grid-column: 1 / -1; }

.telemetry-value {
  margin-top: 22px;
  font-size: clamp(2.35rem, 5.8vw, 5.9rem);
  line-height: .92;
  font-weight: 900;
  letter-spacing: -.075em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.telemetry-value.medium { font-size: clamp(2rem, 4.8vw, 4.5rem); }
.telemetry-value.mgrs { font-size: clamp(1.75rem, 4.5vw, 4.25rem); letter-spacing: -.055em; }
.telemetry-subvalue {
  margin-top: 12px;
  color: var(--silver);
  font-size: clamp(.82rem, 1.6vw, 1rem);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.wp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
  align-items: end;
  margin-top: 26px;
}

.wp-value {
  display: block;
  font-size: clamp(1.9rem, 4.6vw, 4.2rem);
  line-height: .92;
  font-weight: 900;
  letter-spacing: -.065em;
  font-variant-numeric: tabular-nums;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-bottom: 22px;
}

.stat-card {
  min-height: 128px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.stat-value {
  margin-top: 18px;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}

.active-flight {
  margin-bottom: 22px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(120deg, rgba(215,255,72,.045), transparent 50%),
    var(--panel);
}

.active-flight.hidden { display: none; }
.active-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 24px;
  align-items: end;
}
.active-duration {
  margin-top: 12px;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}

.flight-list { display: grid; gap: 10px; }

.flight-card {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(160px, 1fr) minmax(130px, .7fr) minmax(180px, 1.2fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.flight-card:hover { border-color: var(--line-bright); }
.flight-primary { font-size: 1.05rem; font-weight: 900; text-transform: uppercase; }
.flight-secondary { margin-top: 5px; color: var(--muted); font-size: .76rem; letter-spacing: .04em; }
.flight-duration { font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.flight-notes { color: var(--silver); font-size: .86rem; line-height: 1.4; }
.empty-state {
  padding: 32px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.form-panel {
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  background: var(--panel);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-field { display: grid; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #050505;
  color: var(--white);
  outline: none;
}
.form-input:focus { border-color: var(--line-bright); }
textarea.form-input { min-height: 116px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.login-shell {
  width: min(100%, 520px);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 3vw, 42px) 80px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.login-card {
  --hue-offset: 18;
  --h: calc(var(--rainbow-hue) + var(--hue-offset));
  width: 100%;
  padding: 22px 22px 24px;
  border: 1px solid hsl(var(--h) 72% 54% / 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, hsl(var(--h) 88% 52% / 0.14), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.04), transparent 55%),
    var(--panel);
  animation: home-rainbow-drift 720s linear infinite;
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsl(var(--h) 70% 55% / 0.2);
}

.login-title {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.05;
  text-transform: uppercase;
}

.login-copy {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-card .home-card-mark {
  margin-top: 4px;
  border-color: hsl(var(--h) 72% 54% / 0.45);
}

.login-card .home-card-mark::after {
  color: hsl(var(--h) 82% 66%);
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
}

.login-switch {
  margin: 16px 0 0;
  text-align: center;
}

.login-text-btn {
  border: 0;
  background: none;
  color: var(--silver);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .68rem;
  cursor: pointer;
}

.login-text-btn:hover { color: var(--white); }

.login-ok {
  margin: 0;
  color: var(--live);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.account-card.is-pending {
  border-color: rgba(255, 214, 74, .35);
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.account-card-name {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.account-card-who,
.account-card-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.account-pomodoro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.login-error {
  margin: 0;
  color: #ffb3b3;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
}
.admin-flight-list { display: grid; gap: 8px; margin-top: 20px; }
.admin-flight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #080808;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 18px;
  border: 1px solid var(--line-bright);
  background: #0a0a0a;
  color: var(--white);
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .76rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.footer {
  margin-top: 72px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
}

@media (max-width: 960px) {
  .header-inner { min-height: auto; padding-top: 12px; padding-bottom: 12px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .header-nav { width: 100%; justify-content: flex-start; }
  .header-account { width: 100%; padding-left: 0; }
  .telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telemetry-card.wide { grid-column: span 2; }
  .active-grid { grid-template-columns: 1fr 1fr; }
  .active-grid > :first-child { grid-column: 1 / -1; }
  .flight-card { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .page-shell { padding-left: 12px; padding-right: 12px; }
  .section { margin-top: 54px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .nav-link { min-height: 44px; padding: 0 14px; }
  .video-frame { width: calc(100% + 24px); margin-left: -12px; border-left: 0; border-right: 0; }
  .video-toolbar { align-items: stretch; }
  .video-toolbar .button { width: 100%; min-height: 50px; }
  .telemetry-card { min-height: 164px; padding: 18px; }
  .telemetry-value { font-size: clamp(2.6rem, 15vw, 4.8rem); }
  .telemetry-value.medium { font-size: clamp(2.15rem, 12vw, 4rem); }
  .telemetry-value.mgrs { font-size: clamp(1.7rem, 9vw, 3rem); line-height: 1.02; }
  .wp-layout { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .wp-layout > :first-child { grid-column: 1 / -1; }
  .wp-value { font-size: clamp(2.1rem, 12vw, 3.7rem); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 108px; }
  .active-grid { grid-template-columns: 1fr; }
  .active-grid > :first-child { grid-column: auto; }
  .flight-card { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .admin-flight-row { align-items: flex-start; flex-direction: column; }
  .admin-flight-row .button { width: 100%; }
}

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

/* Mission navigation ------------------------------------------------------ */
.navigation-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.target-selector-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: clamp(18px, 2.8vw, 32px);
  border-bottom: 1px solid var(--line);
}

.target-selector { max-width: 760px; }
.shared-target {
  min-height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  white-space: nowrap;
}
.shared-target.active {
  color: var(--live);
  border-color: rgba(215,255,72,.35);
}

.nav-metrics {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.nav-metric {
  min-height: 145px;
  padding: clamp(18px, 2.5vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.02), transparent 52%), #080808;
}
.nav-metric:last-child { border-right: 0; }
.nav-metric strong {
  display: block;
  margin-top: 20px;
  font-size: clamp(1.65rem, 3.7vw, 3.65rem);
  line-height: .95;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.nav-metric:first-child strong { font-size: clamp(1.35rem, 3vw, 2.8rem); text-transform: uppercase; }
.nav-metric small { font-size: .42em; letter-spacing: .02em; color: var(--silver); }

.route-status-row {
  min-height: 52px;
  padding: 12px clamp(18px, 2.5vw, 30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--silver);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}
.route-status-row span:last-child { color: var(--muted); white-space: nowrap; }

.mission-map-shell {
  padding: clamp(10px, 2vw, 22px);
  background: #040404;
}
.mission-map {
  width: 100%;
  height: auto;
  min-height: 320px;
  display: block;
  border: 1px solid var(--line);
  background: #060606;
  touch-action: manipulation;
}
.map-background { fill: #060606; }
.map-grid line { stroke: #161616; stroke-width: 1; }
.map-empty {
  fill: var(--muted);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.mission-route {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.mission-route.full { stroke: #383836; stroke-width: 6; }
.mission-route.remaining { stroke: var(--white); stroke-width: 8; }
.target-geometry { cursor: pointer; }
.target-geometry polyline {
  fill: none;
  stroke: #878782;
  stroke-width: 5;
  stroke-dasharray: 14 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.target-geometry circle { fill: #090909; stroke: #878782; stroke-width: 5; }
.target-geometry text,
.crossing-marker text,
.draw-point text {
  fill: var(--silver);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  paint-order: stroke;
  stroke: #050505;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.target-geometry.selected polyline,
.target-geometry.selected circle { stroke: var(--live); stroke-width: 8; }
.target-geometry.selected text { fill: var(--live); }
.waypoint { cursor: pointer; }
.waypoint circle { fill: #070707; stroke: #aaa9a4; stroke-width: 4; }
.waypoint .wp-number {
  fill: var(--white);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
}
.waypoint .wp-label {
  fill: var(--muted);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #050505;
  stroke-width: 5px;
  pointer-events: none;
}
.waypoint.active circle { stroke: var(--white); stroke-width: 8; }
.waypoint.selected circle { stroke: var(--live); fill: rgba(215,255,72,.08); stroke-width: 8; }
.waypoint.selected .wp-label { fill: var(--live); }
.aircraft-marker path { fill: var(--white); stroke: #050505; stroke-width: 4; }
.aircraft-marker circle { fill: var(--live); }
.crossing-marker circle { fill: #050505; stroke: var(--live); stroke-width: 5; }
.crossing-marker line { stroke: var(--live); stroke-width: 4; }
.crossing-marker text { fill: var(--live); }
.draw-point circle { fill: #050505; stroke: var(--warn); stroke-width: 6; }
.draw-point text { fill: var(--warn); }
.draw-line { fill: none; stroke: var(--warn); stroke-width: 6; stroke-dasharray: 8 8; }

.map-legend {
  padding: 13px clamp(18px, 2.5vw, 30px) 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .66rem;
}
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend i { display: inline-block; width: 24px; height: 4px; background: var(--white); }
.map-legend .legend-aircraft { width: 10px; height: 14px; clip-path: polygon(50% 0, 100% 100%, 50% 70%, 0 100%); }
.map-legend .legend-target { background: var(--live); }
.map-legend .legend-border { background: #878782; background-image: repeating-linear-gradient(90deg, #878782 0 6px, transparent 6px 10px); }

.form-help {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
  letter-spacing: .03em;
}
.coordinate-input { min-height: 150px !important; font-family: Consolas, "Courier New", monospace; font-weight: 700; }
.draw-status,
.pin-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .7rem;
}
.pin-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  justify-content: flex-start;
}

@media (max-width: 960px) {
  .nav-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-metric:nth-child(2) { border-right: 0; }
  .nav-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .target-selector-row { grid-template-columns: 1fr; }
  .target-selector { max-width: none; }
  .shared-target { width: 100%; min-height: 50px; white-space: normal; text-align: center; }
  .nav-metrics { grid-template-columns: 1fr 1fr; }
  .nav-metric { min-height: 132px; padding: 17px; }
  .nav-metric strong { font-size: clamp(1.65rem, 9.5vw, 2.8rem); }
  .nav-metric:first-child strong { font-size: clamp(1.25rem, 7vw, 2.2rem); }
  .route-status-row { align-items: flex-start; flex-direction: column; }
  .mission-map-shell { width: calc(100% + 2px); margin-left: -1px; padding: 0; }
  .mission-map { min-height: 290px; border-left: 0; border-right: 0; }
  .map-legend { display: grid; grid-template-columns: 1fr 1fr; }
  .pin-actions .button { width: 100%; min-height: 50px; }
}

/* Local country-border basemap ------------------------------------------- */
.country-borders { pointer-events: none; }
.country-border {
  fill: none;
  stroke: #30302e;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.map-legend .legend-country {
  height: 2px;
  background: #30302e;
}

/* Operational-data sanitization ----------------------------------------- */
.hidden { display: none !important; }
.sanitize-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid #5b3030;
  background: linear-gradient(145deg, rgba(255,105,105,.045), transparent 52%), #090707;
}
.sanitize-title {
  margin-bottom: 10px;
  color: #ffb3b3;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: clamp(1.15rem, 2.6vw, 2rem);
}
.sanitize-copy {
  max-width: 900px;
  margin: 8px 0 0;
  color: var(--silver);
  font-size: .86rem;
  line-height: 1.65;
  letter-spacing: .01em;
}
.sanitize-copy.muted { color: var(--muted); }
.sanitize-actions {
  min-width: min(100%, 280px);
  display: grid;
  gap: 10px;
}
.sanitize-button {
  min-height: 58px;
  padding: 0 22px;
}
.sanitize-button.armed {
  color: #050505;
  border-color: var(--lost);
  background: var(--lost);
  animation: sanitize-pulse .8s steps(2, end) infinite;
}
.sanitize-button:disabled { opacity: .35; cursor: not-allowed; }
@keyframes sanitize-pulse { 50% { opacity: .62; } }

@media (max-width: 760px) {
  .sanitize-panel { grid-template-columns: 1fr; }
  .sanitize-actions { width: 100%; }
  .sanitize-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sanitize-button.armed { animation: none; }
}
