/* Энергогород: industrial control room × blueprint atlas */
:root {
  color-scheme: light;
  --graphite-950: #0b1117;
  --graphite-900: #101820;
  --graphite-850: #16212b;
  --graphite-800: #1d2a34;
  --graphite-700: #31404b;
  --graphite-600: #4d5c66;
  --graphite-300: #a9b2b8;
  --paper-50: #fbfaf4;
  --paper-100: #f2f1e9;
  --paper-150: #e9e9e1;
  --paper-200: #ddded7;
  --blue-700: #004ba8;
  --blue-600: #0065d5;
  --blue-500: #1485f5;
  --blue-300: #72b9ff;
  --blue-100: #d9edff;
  --orange-700: #9a3d00;
  --orange-600: #c65308;
  --orange-500: #f47721;
  --orange-200: #ffc08f;
  --green-700: #076139;
  --green-600: #087949;
  --green-500: #18a66a;
  --green-200: #9ae0bf;
  --stop-700: #8e0e1c;
  --stop-600: #bd1729;
  --stop-500: #df2638;
  --focus: #6b3f00;
  --ink: #17242d;
  --ink-muted: #4b5a64;
  --line: #bec5c6;
  --white: #ffffff;
  --font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Trebuchet MS", sans-serif;
  --font-body: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "Lucida Console", monospace;
  --header-height: 4.75rem;
  --rail-width: 6.25rem;
  --content-max: 92rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --shadow-low: 0 0.25rem 0.75rem rgb(8 17 24 / 14%);
  --shadow-high: 0 1.25rem 3.5rem rgb(5 12 18 / 24%);
  --radius-small: 0.375rem;
  --radius-medium: 0.75rem;
  --radius-large: 1.25rem;
  --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

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

html {
  min-width: 20rem;
  min-height: 100%;
  background: var(--graphite-950);
  font-size: 100%;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 20rem;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--graphite-950);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  accent-color: var(--blue-600);
}

body.large-text,
body.is-large-text {
  font-size: 1.25rem;
}

body.dialog-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin-block-start: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-stretch: condensed;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

button,
[role="button"],
a,
input,
select,
textarea,
summary,
[tabindex]:not([tabindex="-1"]) {
  outline: 0 solid transparent;
}

:focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #ffe47a !important;
}

::selection {
  background: var(--blue-600);
  color: var(--white);
}

[hidden],
.is-hidden {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: calc(var(--safe-top) + 0.75rem);
  left: calc(var(--safe-left) + 0.75rem);
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  border: 2px solid var(--focus);
  border-radius: var(--radius-small);
  background: var(--graphite-950);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--transition);
}

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

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: calc(var(--header-height) + var(--safe-top)) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--paper-100);
}

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(13.5rem, 1fr) auto minmax(20rem, 1fr);
  align-items: center;
  min-height: calc(var(--header-height) + var(--safe-top));
  padding: var(--safe-top) max(1rem, var(--safe-right)) 0 max(1rem, var(--safe-left));
  border-bottom: 1px solid #34434f;
  background:
    linear-gradient(90deg, rgb(20 133 245 / 12%) 1px, transparent 1px) 0 0 / 3rem 100%,
    linear-gradient(180deg, #16232d, var(--graphite-900));
  color: var(--white);
  box-shadow: 0 0.375rem 1.5rem rgb(0 0 0 / 18%);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--blue-500) 0 24%, transparent 24% 78%, var(--orange-500) 78% 92%, var(--green-500) 92%);
  opacity: 0.75;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 3rem;
  color: var(--white);
  text-decoration: none;
}

.brand__mark {
  position: relative;
  display: grid;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: 0.75rem;
  place-items: center;
  transform: rotate(45deg);
  border: 2px solid var(--blue-300);
  background: #0d2f4d;
  box-shadow: inset 0 0 0 4px var(--graphite-900), 0 0 1.25rem rgb(20 133 245 / 28%);
}

.brand__mark::before,
.brand__mark::after {
  position: absolute;
  width: 0.35rem;
  height: 0.35rem;
  content: "";
  border-radius: 50%;
  background: var(--blue-300);
}

.brand__mark::before {
  top: 0.2rem;
  left: 0.2rem;
}

.brand__mark::after {
  right: 0.2rem;
  bottom: 0.2rem;
}

.brand__bolt {
  position: relative;
  width: 0.72rem;
  height: 1.35rem;
  transform: rotate(-45deg) skew(-8deg);
  background: var(--focus);
  clip-path: polygon(55% 0, 100% 0, 68% 42%, 100% 42%, 25% 100%, 40% 56%, 0 56%);
}

.brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1;
}

.brand__text strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-stretch: condensed;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.brand__text span {
  margin-top: 0.35rem;
  color: #aebdca;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar__readout {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  border: 1px solid #3d4e5a;
  border-radius: var(--radius-small);
  background: #0a1219;
  box-shadow: inset 0 0.15rem 0.5rem rgb(0 0 0 / 35%);
  color: #c5d2db;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.readout-label {
  padding-right: 0.65rem;
  color: #81919d;
}

.network-state {
  display: inline-flex;
  align-items: center;
  padding-right: 0.75rem;
  color: var(--green-200);
  font-weight: 700;
}

.network-state__lamp {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border: 1px solid #b4f2d3;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0.7rem var(--green-500);
}

.is-offline .network-state,
[data-network="offline"] .network-state {
  color: var(--orange-200);
}

.is-offline .network-state__lamp,
[data-network="offline"] .network-state__lamp {
  border-color: #ffe1c6;
  background: var(--orange-500);
  box-shadow: 0 0 0.7rem var(--orange-500);
}

.topbar__clock {
  min-width: 4.25rem;
  padding: 0.3rem 0.55rem;
  border-left: 1px solid #3d4e5a;
  color: var(--blue-300);
  text-align: center;
}

.topbar__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.utility-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #435564;
  border-radius: var(--radius-small);
  background: #1a2833;
  color: #dce6ed;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.utility-button[aria-checked="true"],
.utility-button.is-active {
  border-color: var(--blue-300);
  background: #063c6a;
  color: var(--white);
}

.utility-button--curator {
  border-color: #6a644c;
  color: #ffe9a3;
}

.utility-button__icon {
  position: relative;
  display: inline-block;
  flex: 0 0 1.2rem;
  width: 1.2rem;
  height: 1.2rem;
}

.utility-button__label {
  display: none;
  margin-left: 0.5rem;
}

.icon-download::before {
  position: absolute;
  top: 0.08rem;
  left: 0.48rem;
  width: 0.24rem;
  height: 0.7rem;
  content: "";
  background: currentColor;
}

.icon-download::after {
  position: absolute;
  inset: 0.18rem 0.18rem 0.08rem;
  content: "";
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  clip-path: polygon(0 48%, 35% 48%, 35% 0, 65% 0, 65% 48%, 100% 48%, 50% 88%);
  background: currentColor;
}

.icon-signal::before {
  position: absolute;
  inset: 0.1rem;
  content: "";
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-135deg);
}

.icon-signal::after {
  position: absolute;
  bottom: 0.05rem;
  left: 0.48rem;
  width: 0.28rem;
  height: 0.28rem;
  content: "";
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -0.42rem 0 -0.06rem currentColor;
}

.icon-expand::before,
.icon-expand::after {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  content: "";
  border-color: currentColor;
  border-style: solid;
}

.icon-expand::before {
  top: 0.08rem;
  left: 0.08rem;
  border-width: 2px 0 0 2px;
  box-shadow: 0.6rem 0.6rem 0 -2px currentColor;
}

.icon-expand::after {
  right: 0.08rem;
  bottom: 0.08rem;
  border-width: 0 2px 2px 0;
}

.icon-key::before {
  position: absolute;
  top: 0.1rem;
  left: 0.05rem;
  width: 0.62rem;
  height: 0.62rem;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-key::after {
  position: absolute;
  width: 0.72rem;
  height: 0.22rem;
  top: 0.72rem;
  left: 0.52rem;
  content: "";
  transform: rotate(43deg);
  border-right: 0.25rem solid currentColor;
  background: currentColor;
}

/* Desktop route rail */
.rail {
  position: sticky;
  z-index: 40;
  top: calc(var(--header-height) + var(--safe-top));
  grid-column: 1;
  grid-row: 2;
  display: flex;
  width: var(--rail-width);
  height: calc(100dvh - var(--header-height) - var(--safe-top));
  min-height: 31rem;
  flex-direction: column;
  overflow: hidden auto;
  border-right: 1px solid #34434f;
  background:
    linear-gradient(90deg, transparent 49%, rgb(114 185 255 / 8%) 50%, transparent 51%) 0 0 / 1.2rem 1.2rem,
    var(--graphite-900);
  color: #d7e2e9;
  scrollbar-width: thin;
}

.rail__caption {
  min-height: 2.2rem;
  padding: 0.7rem 0.25rem 0.35rem;
  color: #7d909e;
  font-family: var(--font-mono);
  font-size: 0.57rem;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
}

.rail-nav {
  display: grid;
  gap: 0.2rem;
  padding: 0.25rem 0.55rem;
}

.rail-nav__link {
  position: relative;
  display: grid;
  min-height: 4.7rem;
  padding: 0.6rem 0.2rem 0.45rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  color: #9dabb5;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.rail-nav__link::after {
  position: absolute;
  top: 50%;
  right: -0.58rem;
  width: 0.28rem;
  height: 1.8rem;
  content: "";
  transform: translateY(-50%) scaleY(0);
  border-radius: 0.2rem 0 0 0.2rem;
  background: var(--blue-500);
  box-shadow: 0 0 1rem var(--blue-500);
  transition: transform var(--transition);
}

.rail-nav__link.is-active,
.rail-nav__link[aria-current="page"] {
  border-color: #3b6d94;
  background: #112c42;
  color: var(--white);
}

.rail-nav__link.is-active::after,
.rail-nav__link[aria-current="page"]::after {
  transform: translateY(-50%) scaleY(1);
}

.rail-nav__code {
  position: absolute;
  top: 0.18rem;
  right: 0.3rem;
  color: #647884;
  font-family: var(--font-mono);
  font-size: 0.54rem;
}

.rail-nav__label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.nav-icon {
  position: relative;
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  color: currentColor;
}

.nav-icon--home::before {
  position: absolute;
  inset: 0.23rem 0.2rem 0.18rem;
  content: "";
  border: 2px solid currentColor;
  clip-path: polygon(50% 0, 100% 37%, 100% 100%, 61% 100%, 61% 62%, 39% 62%, 39% 100%, 0 100%, 0 37%);
  background: currentColor;
}

.nav-icon--safety::before {
  position: absolute;
  inset: 0.08rem 0.22rem;
  content: "";
  border: 2px solid currentColor;
  clip-path: polygon(50% 0, 100% 20%, 90% 72%, 50% 100%, 10% 72%, 0 20%);
}

.nav-icon--safety::after {
  position: absolute;
  inset: 0.22rem 0.22rem 0.32rem;
  display: grid;
  content: "!";
  place-items: center;
  color: currentColor;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.nav-icon--route::before {
  position: absolute;
  inset: 0.15rem;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.24rem var(--graphite-900);
}

.nav-icon--route::after {
  position: absolute;
  top: 0.17rem;
  left: 0.67rem;
  width: 0.18rem;
  height: 1.15rem;
  content: "";
  transform: rotate(32deg);
  background: currentColor;
}

.nav-icon--gallery::before {
  position: absolute;
  inset: 0.18rem;
  content: "";
  border: 2px solid currentColor;
  background:
    linear-gradient(145deg, transparent 53%, currentColor 54% 62%, transparent 63%),
    radial-gradient(circle at 72% 27%, currentColor 0 0.12rem, transparent 0.14rem);
}

.nav-icon--video::before {
  position: absolute;
  inset: 0.22rem 0.1rem;
  content: "";
  border: 2px solid currentColor;
  border-radius: 0.15rem;
}

.nav-icon--video::after {
  position: absolute;
  top: 0.52rem;
  left: 0.65rem;
  content: "";
  border-top: 0.25rem solid transparent;
  border-bottom: 0.25rem solid transparent;
  border-left: 0.4rem solid currentColor;
}

.nav-icon--quiz::before {
  position: absolute;
  inset: 0.1rem 0.3rem 0.35rem;
  content: "?";
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1rem;
  text-align: center;
}

.nav-icon--quiz::after {
  position: absolute;
  bottom: 0.1rem;
  left: 0.67rem;
  width: 0.18rem;
  height: 0.18rem;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.nav-icon--mission::before {
  position: absolute;
  inset: 0.12rem;
  content: "";
  border: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-icon--mission::after {
  position: absolute;
  top: 0.54rem;
  left: 0.54rem;
  width: 0.42rem;
  height: 0.42rem;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.rail__progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem;
  margin: auto 0.7rem 0.6rem;
  padding: 0.65rem;
  border: 1px solid #3a4a55;
  background: #0b141b;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.rail__progress-label {
  color: #8797a3;
  text-transform: uppercase;
}

.rail__progress strong {
  color: var(--blue-300);
}

.rail__progress progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.32rem;
}

.rail__privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin: 0 0.7rem calc(0.7rem + var(--safe-bottom));
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  color: #8597a4;
  cursor: pointer;
  font-size: 0.68rem;
  gap: 0.35rem;
}

.rail__privacy > span:first-child {
  display: grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: serif;
  font-size: 0.68rem;
  font-weight: 800;
}

/* Main blueprint surface */
.app-main {
  position: relative;
  isolation: isolate;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: calc(100dvh - var(--header-height) - var(--safe-top));
  overflow: hidden;
  background:
    linear-gradient(rgb(0 75 168 / 5%) 1px, transparent 1px) 0 0 / 2rem 2rem,
    linear-gradient(90deg, rgb(0 75 168 / 5%) 1px, transparent 1px) 0 0 / 2rem 2rem,
    linear-gradient(rgb(0 75 168 / 2.5%) 1px, transparent 1px) 0 0 / 0.4rem 0.4rem,
    linear-gradient(90deg, rgb(0 75 168 / 2.5%) 1px, transparent 1px) 0 0 / 0.4rem 0.4rem,
    var(--paper-100);
  color: var(--ink);
}

.app-main::before {
  position: fixed;
  z-index: -1;
  top: calc(var(--header-height) + var(--safe-top) + 1rem);
  right: 1rem;
  width: 7rem;
  height: 7rem;
  content: "";
  border: 1px solid rgb(0 101 213 / 13%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.3rem rgb(0 101 213 / 3%), inset 0 0 0 2.5rem rgb(0 101 213 / 3%);
  pointer-events: none;
}

.app-main::after {
  position: fixed;
  z-index: -1;
  right: 4.45rem;
  bottom: 1.25rem;
  width: 1px;
  height: 12rem;
  content: "";
  transform: rotate(45deg);
  transform-origin: bottom;
  background: rgb(0 101 213 / 10%);
  pointer-events: none;
}

.view,
.boot-view {
  width: min(100%, var(--content-max));
  margin-inline: auto;
  padding: clamp(1.1rem, 3vw, 3rem) clamp(1rem, 3.5vw, 4rem) clamp(7rem, 8vw, 8.5rem);
}

.view {
  animation: view-enter 420ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(0.8rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 1.9rem;
  height: 0.25rem;
  margin-right: 0.65rem;
  content: "";
  background: repeating-linear-gradient(90deg, var(--blue-600) 0 0.25rem, transparent 0.25rem 0.4rem);
}

.view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 2rem;
  align-items: end;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.view-title {
  max-width: 16ch;
  margin-bottom: 0.65rem;
  font-size: clamp(2.25rem, 6vw, 5.75rem);
  text-transform: uppercase;
}

.view-title span {
  color: var(--blue-600);
}

.view-lead,
.lead {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.view-header__tools,
.filter-bar,
.control-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

/* Intro dashboard */
.boot-view {
  display: grid;
  grid-template-columns: minmax(17rem, 0.92fr) minmax(22rem, 1.08fr);
  gap: clamp(1.2rem, 4vw, 4rem);
  align-content: center;
  min-height: calc(100dvh - var(--header-height) - var(--safe-top));
}

.boot-view__copy {
  align-self: center;
  animation: boot-copy 650ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes boot-copy {
  from {
    opacity: 0;
    transform: translateX(-1.25rem);
  }
}

.boot-view h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  font-size: clamp(3rem, 6.5vw, 7.1rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.boot-view h1 span {
  color: var(--blue-600);
}

.boot-view__lead {
  max-width: 39rem;
  margin-bottom: 1.8rem;
  color: var(--ink-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.55;
}

.boot-view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.1rem;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.button--primary {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
  box-shadow: 0.28rem 0.28rem 0 var(--graphite-800);
}

.button--secondary {
  border-color: var(--graphite-700);
  background: var(--paper-50);
  color: var(--ink);
}

.button--quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button--orange {
  border-color: var(--orange-700);
  background: var(--orange-600);
  color: var(--white);
}

.button--green {
  border-color: var(--green-700);
  background: var(--green-700);
  color: var(--white);
}

.button--stop {
  border-color: var(--stop-700);
  background: var(--stop-600);
  color: var(--white);
  box-shadow: 0.22rem 0.22rem 0 var(--stop-700);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.55;
}

.button__arrow {
  margin-left: 1.5rem;
  font-size: 1.25rem;
  line-height: 1;
}

.power-map {
  position: relative;
  align-self: center;
  aspect-ratio: 4 / 3;
  min-height: 24rem;
  overflow: hidden;
  border: 1px solid #236493;
  border-radius: var(--radius-medium);
  background:
    radial-gradient(circle at 68% 38%, rgb(20 133 245 / 18%), transparent 32%),
    linear-gradient(145deg, #12334e, #07141e 72%);
  color: var(--white);
  box-shadow: var(--shadow-high), inset 0 0 0 0.35rem #0d1d28;
  animation: map-enter 780ms 100ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes map-enter {
  from {
    opacity: 0;
    transform: scale(0.96) rotate(0.5deg);
  }
}

.power-map::before,
.power-map::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.power-map::before {
  inset: 0.75rem;
  border: 1px solid rgb(114 185 255 / 22%);
  clip-path: polygon(0 0, 42% 0, 42% 1px, 100% 1px, 100% 100%, 58% 100%, 58% calc(100% - 1px), 0 calc(100% - 1px));
}

.power-map::after {
  top: -3rem;
  right: -3rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgb(114 185 255 / 20%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2rem rgb(20 133 245 / 3%), inset 0 0 0 4rem rgb(20 133 245 / 3%);
}

.power-map__grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(114 185 255 / 11%) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(90deg, rgb(114 185 255 / 11%) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    radial-gradient(circle, rgb(114 185 255 / 22%) 0 1px, transparent 1.5px) 0 0 / 0.5rem 0.5rem;
  mask-image: linear-gradient(to bottom, #000, transparent 98%);
}

.power-map__coordinate {
  position: absolute;
  z-index: 3;
  color: var(--blue-300);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.power-map__coordinate--top {
  top: 1.15rem;
  left: 1.25rem;
}

.power-map__coordinate--side {
  top: 50%;
  right: -2.7rem;
  transform: rotate(90deg);
}

.power-map__line {
  position: absolute;
  z-index: 2;
  height: 0.26rem;
  transform-origin: left center;
  background: repeating-linear-gradient(90deg, var(--orange-500) 0 0.8rem, transparent 0.8rem 1.1rem);
  filter: drop-shadow(0 0 0.45rem rgb(244 119 33 / 60%));
}

.power-map__line--one {
  top: 61%;
  left: 22%;
  width: 32%;
  transform: rotate(-22deg);
}

.power-map__line--two {
  top: 49%;
  left: 50%;
  width: 29%;
  transform: rotate(18deg);
}

.power-map__station {
  position: absolute;
  z-index: 4;
  display: grid;
  min-width: 6rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid #4a8abb;
  border-radius: 0.2rem;
  background: rgb(7 20 30 / 88%);
  box-shadow: 0.25rem 0.25rem 0 rgb(0 0 0 / 30%);
}

.power-map__station strong {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
}

.power-map__station small {
  color: var(--blue-300);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.power-map__station--source {
  bottom: 16%;
  left: 9%;
}

.power-map__station--grid {
  top: 29%;
  left: 43%;
}

.power-map__station--city {
  right: 7%;
  bottom: 20%;
}

.power-map__pulse {
  position: absolute;
  top: -0.38rem;
  right: -0.38rem;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid #d0ffe8;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 0 rgb(24 166 106 / 55%);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 0.65rem rgb(24 166 106 / 0%);
  }
}

.power-map__legend {
  position: absolute;
  z-index: 4;
  right: 1rem;
  bottom: 0.8rem;
  left: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  color: #aebdca;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.power-map__legend span {
  display: inline-flex;
  align-items: center;
}

.legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border: 1px solid var(--blue-300);
  border-radius: 50%;
}

.legend-dot--active {
  border-color: var(--orange-200);
  background: var(--orange-500);
}

.boot-status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: rgb(251 250 244 / 88%);
  box-shadow: var(--shadow-low);
  animation: status-enter 520ms 280ms ease-out both;
}

@keyframes status-enter {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}

.instrument {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.8rem;
  min-width: 0;
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.instrument:last-child {
  border-right: 0;
}

.instrument::after {
  position: absolute;
  right: -1.5rem;
  bottom: -2.1rem;
  width: 5.8rem;
  height: 5.8rem;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.15;
}

.instrument--blue {
  color: var(--blue-600);
}

.instrument--orange {
  color: var(--orange-600);
}

.instrument--green {
  color: var(--green-600);
}

.instrument__index {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  opacity: 0.65;
}

.instrument__value {
  grid-row: 1 / 3;
  align-self: center;
  color: currentColor;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.instrument h2 {
  align-self: end;
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.instrument p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.boot-loader {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -0.5rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boot-loader__track {
  position: relative;
  width: 4.5rem;
  height: 0.28rem;
  margin-right: 0.65rem;
  overflow: hidden;
  background: var(--paper-200);
}

.boot-loader__track span {
  position: absolute;
  width: 46%;
  height: 100%;
  background: var(--blue-600);
  animation: boot-load 1.4s ease-in-out infinite;
}

@keyframes boot-load {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(230%);
  }
}

.noscript-panel {
  position: relative;
  width: min(38rem, calc(100% - 2rem));
  margin: -6rem auto 2rem;
  padding: 1.5rem;
  border: 2px solid var(--orange-600);
  background: var(--paper-50);
  box-shadow: var(--shadow-high);
}

.noscript-panel h2 {
  margin-bottom: 0.6rem;
  font-size: 1.75rem;
}

.noscript-panel p {
  margin-bottom: 0;
}

.noscript-panel__code {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: var(--orange-700);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
}

/* Reusable panels, cards and status */
.panel,
.content-panel {
  position: relative;
  padding: clamp(1rem, 2.4vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
  box-shadow: var(--shadow-low);
}

.panel::before,
.content-panel::before,
.card::before,
.route-card::before {
  position: absolute;
  top: 0.38rem;
  left: 0.38rem;
  width: 0.3rem;
  height: 0.3rem;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-100);
}

.panel--dark {
  border-color: #415562;
  background: var(--graphite-850);
  color: #e8f0f5;
  box-shadow: var(--shadow-high);
}

.panel--dark h2,
.panel--dark h3,
.panel--dark h4 {
  color: var(--white);
}

.panel--blue {
  border-color: var(--blue-700);
  background: var(--blue-100);
}

.panel--orange {
  border-color: var(--orange-600);
  background: #fff0e4;
}

.panel--green {
  border-color: var(--green-600);
  background: #e2f7ed;
}

.card-grid,
.route-grid,
.video-grid,
.gallery-grid,
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(0.8rem, 2vw, 1.25rem);
}

.card,
.route-card,
.video-card,
.gallery-card,
.mission-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
  box-shadow: var(--shadow-low);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card__body,
.route-card__body,
.video-card__body,
.gallery-card__body,
.mission-card__body {
  padding: 1.15rem;
}

.card__meta,
.route-card__meta,
.video-card__meta,
.gallery-card__meta,
.mission-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.7rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h2,
.card h3,
.route-card h2,
.route-card h3,
.video-card h2,
.video-card h3,
.gallery-card h2,
.gallery-card h3,
.mission-card h2,
.mission-card h3 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.card p,
.route-card p,
.video-card p,
.gallery-card p,
.mission-card p {
  color: var(--ink-muted);
}

.card.is-locked,
.route-card.is-locked,
.mission-card.is-locked {
  filter: grayscale(0.65);
}

.card.is-locked::after,
.route-card.is-locked::after,
.mission-card.is-locked::after {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  content: "Закрыто";
  border: 1px solid var(--graphite-600);
  border-radius: 999px;
  background: var(--paper-50);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-chip,
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-50);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
}

.status-chip::before {
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.4rem;
  content: "";
  border-radius: 50%;
  background: var(--graphite-600);
}

.status-chip--active {
  border-color: var(--green-600);
  background: #e2f7ed;
  color: var(--green-700);
}

.status-chip--active::before {
  background: var(--green-600);
}

.status-chip--waiting {
  border-color: var(--orange-600);
  background: #fff0e4;
  color: var(--orange-700);
}

.status-chip--waiting::before {
  background: var(--orange-600);
}

.status-chip--info {
  border-color: var(--blue-600);
  background: var(--blue-100);
  color: var(--blue-700);
}

.status-chip--info::before {
  background: var(--blue-600);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: clamp(2rem, 5vw, 4.5rem) 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.8vw, 3.2rem);
  text-transform: uppercase;
}

.section-heading__index {
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state,
.error-state {
  display: grid;
  min-height: 18rem;
  padding: 2rem;
  place-items: center;
  border: 1px dashed var(--graphite-600);
  border-radius: var(--radius-medium);
  background: rgb(251 250 244 / 70%);
  color: var(--ink);
  text-align: center;
}

.error-state {
  border-color: var(--orange-600);
  background: #fff0e4;
}

/* Route atlas */
.route-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.route-card {
  --route-accent: var(--blue-600);
  display: grid;
  min-height: 25rem;
  grid-template-rows: 10rem 1fr auto;
  border-top: 0.35rem solid var(--route-accent);
}

.route-card[data-energy="sun"],
.route-card--sun {
  --route-accent: var(--orange-600);
}

.route-card[data-energy="wind"],
.route-card--wind,
.route-card[data-energy="water"],
.route-card--water {
  --route-accent: var(--blue-600);
}

.route-card[data-energy="bio"],
.route-card--bio {
  --route-accent: var(--green-600);
}

.route-card[data-energy="atom"],
.route-card--atom {
  --route-accent: var(--graphite-700);
}

.route-card__map {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgb(0 101 213 / 12%) 1px, transparent 1px) 0 0 / 1.4rem 1.4rem,
    linear-gradient(90deg, rgb(0 101 213 / 12%) 1px, transparent 1px) 0 0 / 1.4rem 1.4rem,
    var(--blue-100);
}

.route-card__map::before {
  position: absolute;
  top: 50%;
  left: 12%;
  width: 76%;
  height: 0.2rem;
  content: "";
  transform: rotate(-8deg);
  background: repeating-linear-gradient(90deg, var(--route-accent) 0 0.8rem, transparent 0.8rem 1rem);
}

.route-card__map::after {
  position: absolute;
  top: 27%;
  right: 18%;
  width: 2.4rem;
  height: 2.4rem;
  content: "";
  border: 0.45rem double var(--route-accent);
  border-radius: 50%;
  background: var(--paper-50);
  box-shadow: -7.5rem 3.2rem 0 -0.6rem var(--route-accent);
}

.route-card__number {
  position: absolute;
  z-index: 1;
  top: 0.7rem;
  left: 0.85rem;
  color: var(--route-accent);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
}

.route-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--route-accent);
  font-weight: 800;
}

.route-stops {
  position: relative;
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0;
  padding-left: 2.1rem;
  list-style: none;
}

.route-stops::before {
  position: absolute;
  top: 0.65rem;
  bottom: 0.65rem;
  left: 0.73rem;
  width: 0.2rem;
  content: "";
  background: var(--blue-600);
}

.route-stops li {
  position: relative;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--paper-50);
}

.route-stops li::before {
  position: absolute;
  top: 1rem;
  left: -1.82rem;
  width: 0.85rem;
  height: 0.85rem;
  content: "";
  border: 0.2rem solid var(--blue-600);
  border-radius: 50%;
  background: var(--paper-50);
}

.route-stops li.is-complete::before {
  background: var(--green-500);
  border-color: var(--green-700);
}

/* Gallery / atlas */
.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.gallery-card {
  display: flex;
  min-height: 21rem;
  flex-direction: column;
}

.gallery-card__image,
.gallery-card__visual {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 68% 36%, rgb(244 119 33 / 22%), transparent 20%),
    linear-gradient(145deg, var(--blue-100), #b8dbf2);
}

.gallery-card__image img,
.gallery-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card__visual::before {
  width: 42%;
  aspect-ratio: 1;
  content: "";
  border: 0.75rem double var(--blue-700);
  border-radius: 50%;
  box-shadow: 2.8rem 1.6rem 0 -1.2rem var(--orange-600), -3rem 1.7rem 0 -1.45rem var(--green-600);
}

.gallery-card__stamp {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.48rem;
  border: 1px solid var(--graphite-700);
  background: rgb(251 250 244 / 92%);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gallery-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.gallery-card__body .button {
  align-self: flex-start;
  margin-top: auto;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.filter-button {
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-50);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.filter-button.is-active,
.filter-button[aria-pressed="true"] {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
}

/* Video library */
.video-card {
  display: flex;
  flex-direction: column;
}

.video-frame,
.video-card__poster {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid #40525f;
  background:
    linear-gradient(125deg, transparent 0 48%, rgb(20 133 245 / 18%) 48% 53%, transparent 53%),
    radial-gradient(circle at 50% 50%, #1a425e, #07131c 68%);
  color: var(--white);
}

.video-frame video,
.video-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-button {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--blue-700);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 0 0 0.55rem rgb(255 255 255 / 15%);
}

.play-button::before {
  margin-left: 0.25rem;
  content: "";
  border-top: 0.65rem solid transparent;
  border-bottom: 0.65rem solid transparent;
  border-left: 1rem solid currentColor;
}

.video-card__duration {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #566a77;
  border-radius: 0.2rem;
  background: rgb(6 14 20 / 88%);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.video-card__body {
  flex: 1;
}

.video-transcript {
  max-height: 18rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--paper-50);
  scrollbar-color: var(--blue-600) var(--paper-200);
}

/* Quiz */
.quiz-shell,
.quiz {
  width: min(100%, 58rem);
  margin-inline: auto;
}

.quiz__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz__question,
.question-card {
  position: relative;
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  overflow: hidden;
  border: 1px solid #38505e;
  border-radius: var(--radius-large);
  background:
    linear-gradient(90deg, rgb(114 185 255 / 7%) 1px, transparent 1px) 0 0 / 2rem 100%,
    var(--graphite-850);
  color: #dfeaf0;
  box-shadow: var(--shadow-high);
}

.quiz__question::after,
.question-card::after {
  position: absolute;
  top: -4rem;
  right: -4rem;
  width: 11rem;
  height: 11rem;
  content: "?";
  border: 1px solid rgb(114 185 255 / 16%);
  border-radius: 50%;
  color: rgb(114 185 255 / 12%);
  font-family: var(--font-display);
  font-size: 9rem;
  font-weight: 900;
  line-height: 12rem;
  text-align: center;
}

.quiz__question h2,
.question-card h2,
.question-card h3 {
  position: relative;
  z-index: 1;
  max-width: 24ch;
  margin-bottom: 0;
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.answer-grid,
.quiz__answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.answer-card,
.quiz-answer {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  min-height: 5rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.answer-card__letter,
.quiz-answer__letter {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--blue-600);
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-family: var(--font-mono);
}

.answer-card.is-selected,
.quiz-answer[aria-pressed="true"] {
  border-color: var(--blue-700);
  background: var(--blue-100);
}

.answer-card.is-correct,
.quiz-answer.is-correct {
  border-color: var(--green-700);
  background: #e2f7ed;
}

.answer-card.is-correct .answer-card__letter,
.quiz-answer.is-correct .quiz-answer__letter {
  border-color: var(--green-700);
  background: var(--green-700);
  color: var(--white);
}

.answer-card.is-incorrect,
.quiz-answer.is-incorrect {
  border-color: var(--orange-600);
  background: #fff0e4;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-left: 0.35rem solid var(--blue-600);
  background: var(--blue-100);
}

.quiz-feedback.is-correct {
  border-left-color: var(--green-600);
  background: #e2f7ed;
}

.quiz-feedback.is-incorrect {
  border-left-color: var(--orange-600);
  background: #fff0e4;
}

/* Checklists and mission timeline */
.checklist,
.mission-checklist {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.checklist__item,
.mission-checklist li {
  position: relative;
  min-height: 3.25rem;
  padding: 0.8rem 0.9rem 0.8rem 3.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--paper-50);
}

.checklist__item::before,
.mission-checklist li::before {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  content: "";
  transform: translateY(-50%);
  place-items: center;
  border: 2px solid var(--graphite-600);
  border-radius: 0.2rem;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 900;
}

.checklist__item.is-complete,
.mission-checklist li.is-complete {
  border-color: var(--green-600);
  background: #e2f7ed;
}

.checklist__item.is-complete::before,
.mission-checklist li.is-complete::before {
  content: "✓";
  border-color: var(--green-700);
  background: var(--green-700);
}

.mission-timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 65rem;
  margin: 1.5rem auto;
  padding: 0;
  list-style: none;
}

.mission-timeline::before {
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 2rem;
  width: 0.3rem;
  content: "";
  background: var(--paper-200);
  box-shadow: inset 0 0 0 1px var(--line);
}

.mission-timeline__item,
.timeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0 0 1.2rem;
}

.mission-timeline__marker,
.timeline-step__marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 0.25rem solid var(--paper-100);
  border-radius: 50%;
  background: var(--graphite-700);
  color: var(--white);
  box-shadow: 0 0 0 1px var(--graphite-700);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
}

.mission-timeline__item.is-complete .mission-timeline__marker,
.timeline-step.is-complete .timeline-step__marker {
  background: var(--green-700);
  box-shadow: 0 0 0 1px var(--green-700);
}

.mission-timeline__item.is-current .mission-timeline__marker,
.timeline-step.is-current .timeline-step__marker {
  background: var(--blue-700);
  box-shadow: 0 0 0 1px var(--blue-700), 0 0 0 0.5rem var(--blue-100);
}

.mission-timeline__content,
.timeline-step__content {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
}

.mission-timeline__content h3,
.timeline-step__content h3 {
  margin-bottom: 0.45rem;
  font-size: 1.4rem;
}

/* Progress meters */
progress {
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--paper-200);
  color: var(--blue-600);
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--paper-200);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
}

.progress-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 1rem;
  align-items: center;
}

.progress-block progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.65rem;
}

.progress-ring {
  --progress: 18;
  display: grid;
  width: 7rem;
  height: 7rem;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue-600) calc(var(--progress) * 1%), var(--paper-200) 0);
}

.progress-ring::before {
  grid-area: 1 / 1;
  width: 5.2rem;
  height: 5.2rem;
  content: "";
  border-radius: 50%;
  background: var(--paper-50);
}

.progress-ring > span {
  z-index: 1;
  grid-area: 1 / 1;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
}

/* Forms */
.field-label {
  display: block;
  margin: 1rem 0 0.4rem;
  color: var(--ink);
  font-weight: 800;
}

.field-hint,
.form-message {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--graphite-600);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-700);
}

.code-field {
  position: relative;
}

.code-field input {
  position: relative;
  z-index: 1;
  height: 4rem;
  padding: 0.7rem 1rem;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 1rem;
}

.code-field__slots {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: var(--graphite-700);
  font-family: var(--font-mono);
  font-size: 1.9rem;
  letter-spacing: 0.8rem;
  pointer-events: none;
}

.curator-confirmation {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--blue-600);
  border-left-width: 0.35rem;
  background: var(--blue-100);
}

.curator-confirmation strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
}

.curator-confirmation p {
  margin-bottom: 0;
  color: var(--ink-muted);
}

/* Global stop */
.global-stop {
  position: fixed;
  z-index: 240;
  right: calc(max(1rem, var(--safe-right)) + 0.25rem);
  bottom: calc(max(1rem, var(--safe-bottom)) + 0.25rem);
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0.55rem;
  place-content: center;
  border: 0.3rem solid #ffd7db;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, var(--stop-500), var(--stop-700));
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 0 0 0.25rem var(--stop-700), 0 0.6rem 1.7rem rgb(142 14 28 / 38%);
  line-height: 1;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.global-stop::before {
  position: absolute;
  inset: -0.7rem;
  content: "";
  border: 1px dashed var(--stop-600);
  border-radius: 50%;
  opacity: 0.65;
}

.global-stop strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
}

.global-stop > span:last-child {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.global-stop__ring {
  position: absolute;
  inset: 0.26rem;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  pointer-events: none;
}

/* Dialogs */
.app-dialog {
  width: min(35rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: min(46rem, calc(100dvh - 1.5rem));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: var(--radius-large);
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-high);
}

.app-dialog--wide {
  width: min(46rem, calc(100% - 1.5rem));
}

.app-dialog::backdrop {
  background: rgb(4 10 14 / 78%);
  backdrop-filter: blur(0.3rem);
}

.app-dialog[open] {
  animation: dialog-enter 220ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(0.8rem) scale(0.97);
  }
}

.dialog-card {
  position: relative;
  max-height: min(46rem, calc(100dvh - 1.5rem));
  padding: clamp(1.15rem, 4vw, 2rem);
  overflow: auto;
  border: 1px solid #87949c;
  border-radius: var(--radius-large);
  background:
    linear-gradient(rgb(0 75 168 / 5%) 1px, transparent 1px) 0 0 / 1.6rem 1.6rem,
    linear-gradient(90deg, rgb(0 75 168 / 5%) 1px, transparent 1px) 0 0 / 1.6rem 1.6rem,
    var(--paper-50);
  color: var(--ink);
}

.dialog-card::before,
.dialog-card::after {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-100);
}

.dialog-card::before {
  top: 0.45rem;
  left: 0.45rem;
}

.dialog-card::after {
  right: 0.45rem;
  bottom: 0.45rem;
}

.app-dialog--stop .dialog-card {
  border: 0.22rem solid var(--stop-600);
}

.dialog-card__header {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-card__header h2 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.dialog-card__kicker {
  margin-bottom: 0.25rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dialog-card__badge,
.stop-symbol {
  display: grid;
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 2px solid var(--blue-700);
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
}

.dialog-card__badge--info {
  font-family: Georgia, serif;
}

.stop-symbol {
  border-color: var(--stop-700);
  background: var(--stop-600);
  color: var(--white);
}

.dialog-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.stop-check {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper-100);
}

.stop-check span {
  display: flex;
  align-items: center;
}

.stop-check i {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  font-size: 0.72rem;
  font-style: normal;
}

.privacy-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.privacy-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: var(--paper-100);
}

.privacy-list__icon {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid var(--blue-700);
  border-radius: 50%;
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
}

.privacy-list strong {
  display: block;
  color: var(--ink);
}

/* Toast notifications */
.toast-region {
  position: fixed;
  z-index: 500;
  top: calc(var(--header-height) + var(--safe-top) + 0.75rem);
  right: max(0.75rem, var(--safe-right));
  display: grid;
  width: min(24rem, calc(100% - 1.5rem));
  gap: 0.55rem;
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  min-height: 3.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #516574;
  border-left: 0.35rem solid var(--blue-500);
  border-radius: var(--radius-small);
  background: var(--graphite-850);
  color: var(--white);
  box-shadow: var(--shadow-high);
  pointer-events: auto;
  animation: toast-enter 260ms cubic-bezier(.16, 1, .3, 1) both;
}

.toast--success {
  border-left-color: var(--green-500);
}

.toast--warning,
.toast--error {
  border-left-color: var(--orange-500);
}

.toast__icon {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.toast__close {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 1.25rem;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
}

/* Bottom navigation */
.bottom-nav {
  display: none;
}

/* Loading placeholders */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 0.25rem;
  background: var(--paper-200);
  color: transparent !important;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 65%), transparent);
  animation: skeleton-scan 1.35s ease-in-out infinite;
}

@keyframes skeleton-scan {
  to {
    transform: translateX(100%);
  }
}

/* Hover-capable devices */
@media (hover: hover) and (pointer: fine) {
  .utility-button:hover {
    border-color: var(--blue-300);
    background: #243745;
    transform: translateY(-1px);
  }

  .rail-nav__link:hover {
    border-color: #354d5e;
    background: #172733;
    color: var(--white);
    transform: translateX(0.1rem);
  }

  .rail__privacy:hover {
    border-color: #435664;
    color: var(--white);
  }

  .button:not(:disabled):hover {
    transform: translate(-0.08rem, -0.08rem);
    box-shadow: 0.35rem 0.35rem 0 var(--graphite-800);
  }

  .button--secondary:hover,
  .button--quiet:hover {
    border-color: var(--blue-700);
    background: var(--blue-100);
  }

  .button--stop:not(:disabled):hover {
    background: var(--stop-500);
    box-shadow: 0.35rem 0.35rem 0 var(--stop-700);
  }

  .card:hover,
  .route-card:hover,
  .video-card:hover,
  .gallery-card:hover,
  .mission-card:hover {
    transform: translateY(-0.28rem);
    border-color: var(--blue-600);
    box-shadow: 0 1rem 2rem rgb(10 25 35 / 16%);
  }

  .answer-card:hover,
  .quiz-answer:hover {
    transform: translateY(-0.14rem);
    border-color: var(--blue-600);
  }

  .filter-button:hover {
    border-color: var(--blue-600);
  }

  .play-button:hover {
    transform: scale(1.07);
    background: var(--blue-600);
  }

  .global-stop:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 0.3rem var(--stop-700), 0 0.75rem 2rem rgb(142 14 28 / 45%);
  }
}

/* Medium layouts */
@media (min-width: 75rem) {
  .utility-button__label {
    display: inline;
  }

  .topbar {
    grid-template-columns: minmax(15rem, 1fr) auto minmax(30rem, 1fr);
  }
}

@media (max-width: 68rem) {
  .topbar {
    grid-template-columns: minmax(12rem, 1fr) auto;
  }

  .topbar__readout {
    display: none;
  }

  .boot-view {
    grid-template-columns: minmax(16rem, 0.9fr) minmax(19rem, 1.1fr);
  }

  .power-map {
    min-height: 21rem;
  }

  .boot-status {
    grid-template-columns: 1fr;
  }

  .instrument {
    grid-template-columns: 5rem auto 1fr;
    grid-template-rows: auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .instrument:last-child {
    border-bottom: 0;
  }

  .instrument__value {
    grid-row: auto;
  }

  .instrument h2 {
    align-self: center;
  }

  .instrument p {
    justify-self: end;
    text-align: right;
  }
}

@media (max-width: 51rem) {
  :root {
    --header-height: 4rem;
  }

  .app-shell {
    display: block;
    padding-bottom: calc(4.65rem + var(--safe-bottom));
  }

  .topbar {
    position: sticky;
    display: flex;
    min-height: calc(var(--header-height) + var(--safe-top));
    justify-content: space-between;
    padding-inline: max(0.65rem, var(--safe-left)) max(0.65rem, var(--safe-right));
  }

  .brand__mark {
    flex-basis: 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    margin-right: 0.55rem;
  }

  .brand__text strong {
    font-size: 1.05rem;
  }

  .brand__text span {
    display: none;
  }

  .topbar__actions {
    gap: 0.25rem;
  }

  .utility-button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.45rem;
  }

  .rail {
    display: none;
  }

  .app-main {
    min-height: calc(100dvh - var(--header-height) - var(--safe-top) - 4.65rem - var(--safe-bottom));
  }

  .view,
  .boot-view {
    padding-bottom: 7rem;
  }

  .boot-view {
    display: block;
    min-height: auto;
    padding-top: clamp(1.5rem, 7vw, 3.5rem);
  }

  .boot-view h1 {
    max-width: 12ch;
    font-size: clamp(2.65rem, 12vw, 5rem);
  }

  .power-map {
    min-height: 19rem;
    margin-top: 2rem;
  }

  .boot-status {
    margin-top: 1rem;
  }

  .boot-loader {
    margin-top: 0.8rem;
  }

  .bottom-nav {
    position: fixed;
    z-index: 200;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(4.65rem + var(--safe-bottom));
    padding: 0.35rem max(0.25rem, var(--safe-right)) var(--safe-bottom) max(0.25rem, var(--safe-left));
    border-top: 1px solid #3b4b57;
    background: rgb(16 24 32 / 97%);
    color: #aebcc6;
    box-shadow: 0 -0.35rem 1.5rem rgb(5 12 18 / 22%);
    backdrop-filter: blur(0.7rem);
  }

  .bottom-nav__link {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 3.8rem;
    place-items: center;
    align-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    color: inherit;
    font-family: var(--font-display);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
  }

  .bottom-nav__link .nav-icon {
    width: 1.3rem;
    height: 1.3rem;
    margin-bottom: 0.25rem;
  }

  .bottom-nav__link.is-active,
  .bottom-nav__link[aria-current="page"] {
    border-color: #345b79;
    background: #112c42;
    color: var(--white);
  }

  .bottom-nav__link.is-active::before,
  .bottom-nav__link[aria-current="page"]::before {
    position: absolute;
    top: -0.37rem;
    right: 28%;
    left: 28%;
    height: 0.2rem;
    content: "";
    background: var(--blue-500);
    box-shadow: 0 0 0.55rem var(--blue-500);
  }

  .global-stop {
    right: calc(max(0.75rem, var(--safe-right)) + 0.1rem);
    bottom: calc(5.35rem + var(--safe-bottom));
    width: 4.75rem;
    height: 4.75rem;
    border-width: 0.24rem;
  }

  .global-stop strong {
    font-size: 1.1rem;
  }

  .view-header {
    display: block;
  }

  .view-header__tools {
    margin-top: 1rem;
  }

  .answer-grid,
  .quiz__answers {
    grid-template-columns: 1fr;
  }

  .toast-region {
    top: calc(var(--header-height) + var(--safe-top) + 0.5rem);
  }
}

@media (max-width: 38rem) {
  .view,
  .boot-view {
    padding-inline: 0.85rem;
  }

  .boot-view__actions,
  .dialog-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .boot-view__actions .button,
  .dialog-card__actions .button {
    width: 100%;
  }

  .power-map {
    aspect-ratio: auto;
    min-height: 18.5rem;
  }

  .power-map__station {
    min-width: 4.7rem;
    padding: 0.5rem;
  }

  .power-map__station strong {
    font-size: 0.78rem;
  }

  .power-map__station--source {
    left: 5%;
  }

  .power-map__station--grid {
    left: 39%;
  }

  .power-map__station--city {
    right: 4%;
  }

  .power-map__legend {
    display: none;
  }

  .instrument {
    grid-template-columns: 4.2rem 1fr;
    grid-template-rows: auto auto;
    padding: 0.85rem 1rem;
  }

  .instrument__value {
    grid-row: 1 / 3;
    font-size: 2.6rem;
  }

  .instrument p {
    justify-self: start;
    text-align: left;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .mission-timeline::before {
    left: 1.45rem;
  }

  .mission-timeline__item,
  .timeline-step {
    grid-template-columns: 3.1rem 1fr;
    gap: 0.65rem;
  }

  .mission-timeline__marker,
  .timeline-step__marker {
    width: 2.9rem;
    height: 2.9rem;
    font-size: 0.9rem;
  }

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

@media (max-width: 23rem) {
  .brand__mark {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    margin-right: 0.4rem;
  }

  .brand__text strong {
    font-size: 0.88rem;
  }

  .utility-button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .brand__text {
    display: none;
  }

  .utility-button__icon {
    transform: scale(0.88);
  }

  .bottom-nav__link {
    font-size: 0.56rem;
  }

  .bottom-nav__link .nav-icon {
    transform: scale(0.88);
  }

  .global-stop {
    width: 4.35rem;
    height: 4.35rem;
  }
}

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

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

@media (prefers-contrast: more) {
  :root {
    --line: #66727a;
    --ink-muted: #34434c;
  }

  .app-main {
    background: var(--paper-100);
  }

  .card,
  .route-card,
  .video-card,
  .gallery-card,
  .mission-card,
  .panel,
  .content-panel {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  :root {
    --focus: Highlight;
  }

  .brand__mark,
  .power-map,
  .global-stop,
  .button,
  .status-chip,
  .tag,
  .badge,
  .nav-icon,
  .dialog-card__badge,
  .stop-symbol {
    forced-color-adjust: auto;
  }

  .network-state__lamp,
  .power-map__pulse,
  .status-chip::before {
    border: 2px solid currentColor;
  }
}

@media print {
  .topbar,
  .rail,
  .bottom-nav,
  .global-stop,
  .toast-region,
  .view-header__tools,
  .boot-loader {
    display: none !important;
  }

  .app-shell,
  .app-main {
    display: block;
    min-height: auto;
    background: var(--white);
  }

  .view,
  .boot-view {
    width: 100%;
    padding: 0;
  }

  .card,
  .route-card,
  .video-card,
  .gallery-card,
  .mission-card,
  .panel,
  .content-panel {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Generated application views */
.home-view,
.mission-view,
.quiz-view,
.gallery-section,
.fault-scenarios,
.mission-questions {
  display: grid;
  gap: clamp(1.1rem, 2.4vw, 2rem);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(20rem, 0.88fr) minmax(24rem, 1.12fr);
  min-height: min(42rem, calc(100dvh - 7rem));
  overflow: hidden;
  border: 1px solid #304657;
  border-radius: var(--radius-large);
  background:
    linear-gradient(90deg, rgb(114 185 255 / 8%) 1px, transparent 1px) 0 0 / 3rem 3rem,
    linear-gradient(rgb(114 185 255 / 8%) 1px, transparent 1px) 0 0 / 3rem 3rem,
    var(--graphite-950);
  box-shadow: var(--shadow-high);
}

.home-hero::after {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0.35rem;
  content: "";
  background: linear-gradient(90deg, var(--blue-500) 0 55%, var(--orange-500) 55% 84%, var(--green-500) 84%);
}

.home-hero__copy {
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  color: #eaf2f7;
}

.home-hero__copy .eyebrow {
  color: var(--blue-300);
}

.home-hero__copy .view-title {
  max-width: 11ch;
  color: var(--white);
  font-size: clamp(3rem, 7.2vw, 6.8rem);
}

.home-hero__copy .view-lead {
  color: #d5e0e7;
}

.home-hero__visual {
  position: relative;
  min-height: 32rem;
  overflow: hidden;
  background: #27323a;
}

.home-hero__visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, var(--graphite-950) 0, transparent 32%), linear-gradient(0deg, rgb(11 17 23 / 36%), transparent 42%);
}

.home-hero__visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-actions,
.button-stack,
.diploma__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.privacy-note {
  max-width: 34rem;
  margin: 1.2rem 0 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--green-500);
  color: #c9d7df;
  font-size: 0.9rem;
}

.hero-pin {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgb(11 17 23 / 88%);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(0.35rem);
}

.hero-pin::before {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  content: "";
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0.28rem rgb(255 255 255 / 16%);
}

.hero-pin--electric { top: 18%; right: 24%; color: var(--blue-300); }
.hero-pin--heat { bottom: 24%; left: 16%; color: var(--orange-200); }
.hero-pin--home { right: 12%; bottom: 16%; color: var(--green-200); }

.dashboard-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--line);
}

.dashboard-strip .instrument {
  min-height: 8.5rem;
  border: 0;
  border-radius: 0;
  background: var(--paper-50);
}

.route-contrast,
.quick-actions,
.safety-photo-grid,
.mission-overview,
.system-map,
.contrast-callout,
.library-panel,
.curator-grid,
.parts-grid,
.fault-grid {
  display: grid;
  gap: clamp(0.85rem, 2vw, 1.35rem);
}

.route-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.route-card--electric { border-top: 0.35rem solid var(--blue-600); }
.route-card--heat { border-top: 0.35rem solid var(--orange-600); }
.route-card--heat::before { background: var(--orange-500); }
.route-card--heat .route-card__meta { color: var(--orange-700); }

.route-card__map {
  display: flex;
  align-items: center;
  min-height: 8.5rem;
  padding: 1.2rem;
  overflow-x: auto;
  background: var(--graphite-900);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-card__map span {
  flex: 0 0 auto;
  padding: 0.45rem 0.6rem;
  border: 1px solid currentColor;
  background: var(--graphite-850);
}

.route-card__map i {
  flex: 1 0 1.2rem;
  height: 3px;
  min-width: 1.2rem;
  background: currentColor;
}

.route-card__map--electric { color: var(--blue-300); }
.route-card__map--heat { color: var(--orange-200); }

.quick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-action {
  position: relative;
  display: grid;
  min-height: 9.5rem;
  align-content: end;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-low);
}

.quick-action > span {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  color: var(--paper-200);
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 900;
  line-height: 1;
}

.quick-action strong { z-index: 1; font-size: 1.35rem; }
.quick-action small { z-index: 1; color: var(--ink-muted); }

.safety-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.media-figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--graphite-900);
  box-shadow: var(--shadow-low);
}

.media-figure--compact { max-width: 48rem; }

.media-zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--graphite-900);
  text-align: left;
}

.media-zoom img,
.lesson-video,
.video-frame video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.media-zoom > span {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 999px;
  background: rgb(11 17 23 / 84%);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.media-figure figcaption {
  padding: 0.75rem 0.9rem;
  background: var(--paper-50);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.stop-banner,
.gate-banner,
.completion-panel,
.curator-gate,
.library-panel,
.contrast-callout {
  align-items: center;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--paper-50);
  box-shadow: var(--shadow-low);
}

.stop-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-color: var(--stop-600);
  border-left-width: 0.45rem;
  background: #fff0f1;
  color: var(--stop-700);
}

.stop-banner span { display: block; color: var(--ink); }
.stop-banner--active { margin-bottom: 1.2rem; }

.completion-panel,
.curator-gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
}

.completion-panel__mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 2px solid var(--blue-700);
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 1.5rem;
  font-weight: 900;
}

.completion-panel.is-complete { border-color: var(--green-600); background: #eaf7ef; }
.completion-panel.is-complete .completion-panel__mark { border-color: var(--green-700); background: var(--green-700); color: var(--white); }

.question-stack { display: grid; gap: 1rem; }

.system-map {
  grid-template-columns: minmax(20rem, 1.15fr) minmax(20rem, 0.85fr);
  align-items: stretch;
}

.system-map > img {
  width: 100%;
  height: 100%;
  max-height: 52rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-low);
}

.system-map__legend { display: grid; gap: 1rem; }
.contrast-callout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contrast-callout > div { display: grid; gap: 0.3rem; padding-left: 1rem; border-left: 0.3rem solid var(--blue-600); }
.contrast-callout > div:last-child { border-left-color: var(--orange-600); }
.contrast-callout strong { font-size: 1.25rem; }

.gate-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-color: var(--orange-600);
  background: #fff6ed;
}

.gate-banner a { color: var(--blue-700); font-weight: 900; }
.gate-banner--locked { display: grid; justify-content: stretch; border-color: var(--graphite-600); background: var(--paper-150); }

.mission-card__visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--graphite-800);
}

.mission-card__visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms cubic-bezier(.2,.8,.2,1); }
.mission-card__visual::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgb(11 17 23 / 62%), transparent 52%); }

.mission-card__number {
  position: absolute;
  z-index: 1;
  right: 0.75rem;
  bottom: 0.45rem;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
}

.mission-card__cta { display: inline-flex; margin-top: auto; color: var(--blue-700); font-weight: 900; }
.mission-card__lock { display: block; margin: 0.7rem 0; color: var(--ink); font-weight: 800; }
.mission-card--heat .mission-card__cta { color: var(--orange-700); }
.mission-card--diagnostics .mission-card__cta { color: var(--stop-700); }
.mission-card.is-complete { border-color: var(--green-600); }
.mission-card.is-complete::after { content: "Готово"; border-color: var(--green-600); background: #e2f7ed; color: var(--green-700); }

.status-chip--locked { border-color: var(--graphite-600); background: var(--paper-150); color: var(--ink); }
.status-chip--locked::before { background: var(--graphite-600); }

.back-link { display: inline-flex; width: fit-content; color: var(--blue-700); font-weight: 900; }
.mission-header { margin-bottom: 0; }
.mission-overview { grid-template-columns: minmax(20rem, 1.15fr) minmax(18rem, 0.85fr); align-items: stretch; }
.mission-overview > .content-panel { display: flex; flex-direction: column; justify-content: center; }

.physical-note,
.step-tip {
  margin: 1rem 0 0;
  padding: 0.85rem;
  border-left: 0.3rem solid var(--blue-600);
  background: var(--blue-100);
}

.timeline-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem; }
.adult-label { display: inline-flex; padding: 0.3rem 0.5rem; border: 1px solid var(--orange-700); border-radius: 999px; background: #fff0e4; color: var(--orange-700); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.mission-timeline__item.is-adult-only { border-color: var(--orange-600); }

.curator-gate { margin-top: 0.4rem; border-top: 0.35rem solid var(--blue-600); }
.curator-gate.is-waiting { border-top-color: var(--orange-600); background: #fff8f1; }
.curator-gate.is-complete { border-top-color: var(--green-600); background: #eff9f3; }

.mission-checklist { grid-column: 1 / -1; width: 100%; }
.mission-checklist fieldset { display: grid; gap: 0.65rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.mission-checklist legend { margin-bottom: 0.75rem; font-weight: 900; }
.mission-checklist .checklist__item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  min-height: 3.25rem;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
}

.mission-checklist .checklist__item::before { display: none; }
.mission-checklist .checklist__item input[type="checkbox"] { width: 1.45rem; height: 1.45rem; min-height: 0; margin: 0.15rem 0 0; accent-color: var(--green-700); }
.mission-checklist .checklist__item:has(input:checked) { border-color: var(--green-600); background: #e2f7ed; }

.gallery-section { padding-top: 0.25rem; }
.library-panel { grid-template-columns: minmax(0, 1fr) auto; }
.library-panel h2 { margin-bottom: 0.45rem; }
.full-library:empty { display: none; }

.gallery-card__visual::before { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gallery-card__visual img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.parts-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.part-card { display: grid; grid-template-columns: 42% minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-medium); background: var(--paper-50); box-shadow: var(--shadow-low); }
.part-card__visual { min-height: 15rem; padding: 0; overflow: hidden; cursor: zoom-in; background: var(--graphite-800); }
.part-card__visual img { width: 100%; height: 100%; object-fit: cover; }
.part-card__body { padding: 1rem; }
.part-card__body h2 { margin: 0.65rem 0; font-size: 1.6rem; }
.part-card__body small { display: block; margin-top: 0.8rem; padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--ink-muted); }

.fault-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fault-card { position: relative; min-height: 12rem; padding: 1.25rem 1.25rem 1.25rem 4.8rem; overflow: hidden; border: 1px solid var(--line); border-left: 0.35rem solid var(--stop-600); border-radius: var(--radius-medium); background: var(--paper-50); box-shadow: var(--shadow-low); }
.fault-card > span { position: absolute; top: 1rem; left: 1rem; display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border: 2px solid var(--stop-600); border-radius: 50%; color: var(--stop-700); font-size: 1.4rem; font-weight: 900; }
.fault-card h3 { margin-bottom: 0.55rem; font-size: 1.55rem; }

.curator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.curator-mission-link { display: grid; gap: 0.2rem; margin-top: 0.65rem; padding: 0.85rem; border: 1px solid var(--line); border-left: 0.3rem solid var(--orange-600); border-radius: var(--radius-small); background: var(--paper-100); text-decoration: none; }
.curator-mission-link span { color: var(--ink-muted); font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; }
.setting-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.8rem; align-items: start; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.setting-row input { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; }
.setting-row span { display: grid; }
.setting-row small { color: var(--ink-muted); }

.diploma-view { place-items: center; }
.diploma { position: relative; width: min(100%, 64rem); padding: clamp(1.5rem, 5vw, 4.5rem); overflow: hidden; border: 0.5rem double var(--blue-700); background: var(--paper-50); text-align: center; box-shadow: var(--shadow-high); }
.diploma::before { position: absolute; inset: 1rem; content: ""; border: 1px solid var(--orange-600); pointer-events: none; }
.diploma > * { position: relative; }
.diploma h1 { margin-bottom: 0.6rem; font-size: clamp(2.7rem, 7vw, 6.5rem); text-transform: uppercase; }
.diploma__lead { max-width: 44rem; margin-inline: auto; color: var(--ink-muted); }
.diploma img { width: min(100%, 32rem); margin: 1.5rem auto; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.badge-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; margin: 1rem 0; }
.achievement { display: inline-grid; grid-template-columns: auto 1fr; gap: 0.45rem; align-items: center; padding: 0.55rem 0.75rem; border: 1px solid var(--green-600); border-radius: 999px; background: #e2f7ed; color: var(--green-700); }
.achievement i { font-style: normal; }
.diploma__actions { justify-content: center; }

.media-dialog { overscroll-behavior: contain; }
.media-dialog__card { position: relative; width: min(94vw, 76rem); }
.media-dialog__card img { width: 100%; max-height: 76dvh; object-fit: contain; background: var(--graphite-950); }
.media-dialog__card p { margin: 0; padding-top: 0.8rem; }
.media-dialog__close { position: absolute; z-index: 2; top: 0.7rem; right: 0.7rem; display: grid; width: 3rem; height: 3rem; place-items: center; border: 2px solid var(--white); border-radius: 50%; background: var(--graphite-950); color: var(--white); cursor: pointer; font-size: 1.6rem; }

.dialog-card__hint { margin: 0.85rem 0 0; color: var(--ink-muted); font-size: 0.85rem; }
.curator-hold { overflow: hidden; }
.curator-hold::after { position: absolute; inset: auto 0 0; width: 0; height: 0.35rem; content: ""; background: var(--green-500); }
.curator-hold.is-holding::after { animation: curator-hold 2s linear forwards; }
@keyframes curator-hold { to { width: 100%; } }

.is-stop-active .global-stop { animation: stop-pulse 1.2s ease-in-out infinite alternate; }
@keyframes stop-pulse { to { box-shadow: 0 0 0 0.55rem rgb(223 38 56 / 34%), 0 1rem 2.4rem rgb(142 14 28 / 52%); } }

.is-reduced-motion *,
.is-reduced-motion *::before,
.is-reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (hover: hover) and (pointer: fine) {
  .mission-card:hover .mission-card__visual img,
  .quick-action:hover,
  .part-card:hover img { transform: scale(1.035); }
  .quick-action:hover { border-color: var(--blue-600); box-shadow: 0 1rem 2rem rgb(10 25 35 / 16%); }
}

@media (max-width: 74.99rem) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero__visual { min-height: 27rem; order: -1; }
  .home-hero__visual::after { background: linear-gradient(0deg, var(--graphite-950) 0, transparent 42%); }
  .dashboard-strip,
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 58rem) {
  .route-grid--two,
  .system-map,
  .mission-overview,
  .contrast-callout,
  .curator-grid { grid-template-columns: 1fr; }
  .safety-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curator-gate,
  .completion-panel { grid-template-columns: auto minmax(0, 1fr); }
  .curator-gate > .button,
  .curator-gate > form,
  .completion-panel > .button { grid-column: 1 / -1; }
}

@media (max-width: 40rem) {
  .home-hero { min-height: 0; }
  .home-hero__visual { min-height: 20rem; }
  .home-hero__copy { padding: 1.25rem; }
  .home-hero__copy .view-title { font-size: clamp(2.55rem, 15vw, 4.5rem); }
  .hero-pin { font-size: 0.56rem; }
  .dashboard-strip,
  .quick-actions,
  .safety-photo-grid,
  .fault-grid { grid-template-columns: 1fr; }
  .part-card { grid-template-columns: 1fr; }
  .part-card__visual { min-height: 14rem; }
  .stop-banner,
  .gate-banner { align-items: stretch; flex-direction: column; }
  .completion-panel,
  .curator-gate { grid-template-columns: 1fr; }
  .mission-overview { grid-template-columns: minmax(0, 1fr); }
  .route-card__map { min-height: 6.5rem; }
  .diploma { padding: 2.5rem 1.25rem; border-width: 0.35rem; }
}

@media print {
  .home-hero,
  .diploma { box-shadow: none; }
  .diploma__actions,
  .hero-actions,
  .mission-questions,
  .curator-gate { display: none !important; }
}
