:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.1);
  --blue: #004181;
  --blue-strong: #004285;
  --green: #0f8a5f;
  --red: #b42318;
  --amber: #a15c07;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 280px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.42);
  outline-offset: 3px;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 102, 204, 0.1), transparent 32rem),
    linear-gradient(180deg, #fbfbfd, var(--bg));
}

:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: rgba(21, 28, 40, 0.82);
  --surface-strong: #151c28;
  --text: #f8fafc;
  --muted: #a6b0c2;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(0, 102, 204, 0.18), transparent 32rem),
    linear-gradient(180deg, #111827, var(--bg));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 24px;
  padding: 28px;
}

.loading-bar {
  width: min(320px, 72vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadingSweep 1.1s ease-in-out infinite;
}

.offline-banner {
  margin: 0 auto 14px;
  width: min(1180px, 100%);
  border: 1px solid rgba(161, 92, 7, 0.16);
  border-radius: 16px;
  background: rgba(161, 92, 7, 0.08);
  color: var(--amber);
  padding: 12px 14px;
  font-size: 0.92rem;
}

.auth-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  width: min(1120px, 100%);
  align-items: stretch;
}

.login-hero,
.login-panel,
.onboarding-card,
.hero-panel,
.metric-card,
.wide-panel,
.info-panel,
.map-panel,
.empty-state {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.login-hero {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  border-radius: var(--radius-xl);
}

.login-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.98;
}

.login-hero p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px;
  border-radius: var(--radius-xl);
}

.login-panel h2,
.hero-panel h2,
.onboarding-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.9rem);
  line-height: 1.05;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-lockup.large {
  gap: 16px;
}

.brand-lockup strong {
  display: block;
  font-size: 1.05rem;
}

.brand-lockup span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: contain;
}

.large .brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 17px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-link,
.sidebar-profile,
.choice-chip,
.airport-result,
.icon-button,
.icon-remove {
  border: 0;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  padding: 0 22px;
}

.primary-button:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(17, 24, 39, 0.06);
  font-weight: 700;
}

.mission-save-button {
  background: #0f8a5f;
  color: white;
}

.mission-save-button:hover {
  background: #0b6f4c;
}

.mission-print-button {
  background: #5856d6;
  color: white;
}

.mission-print-button:hover {
  background: #4240b8;
}

.mission-settings-button {
  background: #ffcc00;
  color: #111827;
}

.mission-settings-button:hover {
  background: #f2b800;
}

.ghost-button {
  background: transparent;
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .mission-save-button {
  background: #0f8a5f;
  color: white;
}

:root[data-theme="dark"] .mission-print-button {
  background: #5856d6;
  color: white;
}

:root[data-theme="dark"] .mission-settings-button {
  background: #ffcc00;
  color: #111827;
}

.full-width {
  width: 100%;
  margin-top: 18px;
}

.notice {
  margin-top: 16px;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.notice.warning {
  background: rgba(161, 92, 7, 0.09);
  color: var(--amber);
}

.notice.error {
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
}

.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(28px);
}

:root[data-theme="dark"] .sidebar {
  background: rgba(21, 28, 40, 0.82);
}

.primary-nav {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.nav-link,
.sidebar-profile {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  text-align: left;
  font-weight: 720;
}

.nav-link.is-active,
.nav-link:hover,
.sidebar-profile:hover {
  background: rgba(0, 102, 204, 0.1);
  color: var(--blue);
}

.nav-icon,
.icon-button span {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.nav-icon svg,
.icon-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.sidebar-profile {
  display: grid;
  margin-top: auto;
  gap: 2px;
}

.sidebar-profile small {
  color: var(--muted);
}

.workspace {
  min-height: 100vh;
  padding: 18px 22px 22px calc(var(--sidebar) + 38px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 10px 4px 16px;
  background: linear-gradient(180deg, rgba(245, 245, 247, 0.94), rgba(245, 245, 247, 0));
  backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .topbar {
  background: linear-gradient(180deg, rgba(11, 15, 23, 0.94), rgba(11, 15, 23, 0));
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
}

.mobile-menu {
  display: none;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--text);
}

.page-surface {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.dashboard-home {
  display: grid;
  gap: 18px;
}

.pilot-hero,
.dashboard-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.pilot-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-xl);
  padding: 28px;
}

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

.pilot-identity h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.pilot-identity p:last-child {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.pilot-avatar {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

.pilot-avatar.fallback {
  display: grid;
  place-items: center;
  background: #111827;
  color: white;
  font-size: 2rem;
  font-weight: 850;
}

.pilot-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-stories {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  padding: 18px 0 16px;
}

.stories-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px 14px;
}

.stories-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.stories-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.stories-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 22px 6px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stories-rail::-webkit-scrollbar {
  display: none;
}

.story-button {
  display: grid;
  width: 92px;
  flex: 0 0 auto;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: center;
}

.story-button:hover .story-ring {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 18px 36px rgba(0, 65, 129, 0.18);
}

.story-ring {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9e6f2, #aab7c8);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.story-button.is-unseen .story-ring {
  background: conic-gradient(from 0deg, #1daeff, #0a84ff, #0067c5, #002454, #1daeff);
}

.story-button.is-unseen .story-ring::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #1daeff, #0a84ff, #0067c5, #002454, #1daeff);
  animation: storyRingFlow 4.8s linear infinite;
  content: "";
}

.story-button.is-seen .story-ring {
  background: linear-gradient(135deg, rgba(0, 103, 197, 0.24), rgba(17, 24, 39, 0.16));
}

.story-ring img {
  position: relative;
  z-index: 1;
  width: 66px;
  height: 66px;
  border: 3px solid var(--surface-strong);
  border-radius: inherit;
  background: #111827;
  object-fit: cover;
}

.story-title {
  width: 100%;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 780;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-state {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

body.story-viewer-open {
  overflow: hidden;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  animation: storyViewerIn 180ms ease both;
}

.story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.72);
  backdrop-filter: blur(18px);
}

.story-viewer::before {
  position: absolute;
  width: min(560px, 80vw);
  height: min(560px, 80vw);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(29, 174, 255, 0.28), transparent 66%);
  content: "";
  filter: blur(12px);
}

.story-panel {
  position: relative;
  display: grid;
  width: min(430px, 88vw);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
  background: #050a14;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
  color: white;
  transform-origin: center;
  animation: storyPanelIn 220ms ease both;
  touch-action: pan-y;
}

.story-progress {
  position: absolute;
  top: 14px;
  right: 16px;
  left: 16px;
  z-index: 3;
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
}

.story-progress span {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.story-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.story-progress .is-complete i {
  width: 100%;
}

.story-viewer-header {
  position: absolute;
  top: 26px;
  right: 14px;
  left: 14px;
  z-index: 3;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.38);
  backdrop-filter: blur(16px);
}

.story-viewer-header img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
}

.story-viewer-header strong,
.story-viewer-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-viewer-header strong {
  font-size: 0.88rem;
}

.story-viewer-header span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.story-close-button {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 1.45rem;
}

.story-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  animation: storySlideIn 220ms ease both;
}

.story-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-text-slide {
  padding: 34px;
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.story-tap-zone {
  position: absolute;
  top: 86px;
  bottom: 0;
  z-index: 2;
  width: 50%;
  border: 0;
  background: transparent;
}

.story-tap-left {
  left: 0;
}

.story-tap-right {
  right: 0;
}

.story-arrow {
  position: relative;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 2.1rem;
  line-height: 1;
  backdrop-filter: blur(14px);
}

.story-arrow-prev {
  position: absolute;
  right: calc(50% + 246px);
}

.story-arrow-next {
  position: absolute;
  left: calc(50% + 246px);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.dashboard-panel {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.pilot-summary-panel,
.stats-panel {
  grid-row: span 2;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.25rem;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(15, 138, 95, 0.1);
  color: var(--green);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.profile-facts {
  display: grid;
  gap: 12px;
}

.profile-fact {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.profile-fact:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-fact span,
.stat-card span,
.activity-item span,
.quick-action span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-fact strong {
  line-height: 1.45;
}

.quick-action-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.quick-action {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 15px;
  text-align: left;
}

.quick-action:hover {
  border-color: rgba(0, 102, 204, 0.24);
  background: rgba(0, 102, 204, 0.08);
  transform: translateY(-1px);
}

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

.stat-card {
  display: grid;
  min-height: 96px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
}

:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .mission-route div,
:root[data-theme="dark"] .validation-item,
:root[data-theme="dark"] .quick-action,
:root[data-theme="dark"] .ofp-grid div {
  background: rgba(255, 255, 255, 0.06);
}

.stat-card strong {
  overflow-wrap: anywhere;
  font-size: 1.55rem;
  line-height: 1.05;
}

.activity-item {
  display: grid;
  gap: 4px;
  border-left: 3px solid rgba(0, 102, 204, 0.34);
  padding: 3px 0 3px 12px;
}

.map-dashboard-panel {
  display: grid;
  gap: 12px;
}

.map-dashboard-panel .panel-heading {
  align-items: center;
  margin-bottom: 0;
}

.airport-search {
  position: relative;
  width: min(360px, 100%);
}

.airport-search .text-input {
  min-height: 46px;
}

.search-results.floating {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: min(420px, 90vw);
  max-height: 320px;
  overflow: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.dashboard-map {
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.06);
}

.dashboard-map .ol-zoom {
  left: auto;
  right: 12px;
  top: 12px;
}

.dashboard-map .ol-control button {
  background: rgba(17, 24, 39, 0.82);
  color: #ffffff;
}

.map-unavailable {
  display: grid;
  min-height: inherit;
  place-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.home {
  background: var(--blue);
}

.legend-dot.visited {
  background: var(--green);
}

.legend-line {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.65;
}

.assignment-workbench {
  display: grid;
  gap: 18px;
}

.assignment-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(24px);
}

.assignment-hero h2 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.assignment-hero p:last-child {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.6;
}

.pic-responsibility-notice {
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius-md);
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
  padding: 14px 16px;
  font-size: 0.94rem;
  font-weight: 760;
  line-height: 1.5;
}

.reserved-flight-jump {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: var(--radius-md);
  background: rgba(0, 102, 204, 0.07);
  color: var(--blue);
  padding: 14px 16px;
  text-decoration: none;
}

.reserved-flight-jump span {
  color: var(--muted);
}

.assignment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.compact-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 0 14px;
  font-weight: 760;
}

.compact-toggle input {
  accent-color: var(--blue);
}

.status-pill.is-blocked {
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
}

.mission-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mission-route div,
.validation-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
}

.mission-route span,
.mission-route small,
.validation-item span,
.briefing-list span {
  color: var(--muted);
  line-height: 1.45;
}

.mission-route strong {
  font-size: 1.35rem;
}

.briefing-list,
.validation-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.briefing-list span {
  border-left: 3px solid rgba(0, 102, 204, 0.34);
  padding-left: 12px;
}

.validation-item.blocker {
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.06);
}

.validation-item.warning {
  border-color: rgba(161, 92, 7, 0.22);
  background: rgba(161, 92, 7, 0.07);
}

.validation-item.success {
  border-color: rgba(15, 138, 95, 0.2);
  background: rgba(15, 138, 95, 0.07);
}

.reserved-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reserved-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
}

.reserved-form .text-input {
  min-height: 44px;
}

.reservation-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(0, 102, 204, 0.16);
  border-radius: 16px;
  background: rgba(0, 102, 204, 0.07);
  color: var(--muted);
  padding: 14px;
  line-height: 1.45;
}

.ofp-preview {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.ofp-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.035);
  padding: 12px;
}

.ofp-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.ofp-grid strong {
  overflow-wrap: anywhere;
}

.hero-panel {
  grid-column: 1 / -1;
  border-radius: var(--radius-xl);
  padding: 34px;
}

.hero-panel.compact {
  grid-column: auto;
}

.hero-panel p {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.65;
}

.metric-card,
.wide-panel,
.info-panel,
.map-panel,
.empty-state {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.app-error-state {
  text-align: left;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.wide-panel {
  grid-column: 1 / -1;
}

.wide-panel h3,
.info-panel h3 {
  margin: 0 0 16px;
}

.summary-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.history-page,
.settings-page {
  display: grid;
  gap: 18px;
}

.history-hero,
.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(24px);
}

.history-hero h2,
.settings-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.history-hero p:last-child,
.settings-hero p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.history-controls {
  display: grid;
  width: min(420px, 100%);
  gap: 10px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.history-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.history-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.history-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-notes {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  border-left: 3px solid rgba(0, 102, 204, 0.32);
  color: var(--muted);
  padding-left: 12px;
  line-height: 1.45;
}

.history-completion-row {
  grid-column: 1 / -1;
}

.history-completion-row .primary-button {
  width: min(260px, 100%);
}

.history-actions {
  display: flex;
  grid-column: 3;
  grid-row: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.09);
  color: var(--red);
  font-weight: 760;
  padding: 0 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.28);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.completion-dialog {
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.completion-dialog h3 {
  margin: 0;
  font-size: 1.45rem;
}

.completion-dialog p {
  color: var(--muted);
  line-height: 1.5;
}

.completion-dialog textarea {
  min-height: 140px;
  resize: vertical;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.settings-fields {
  display: grid;
  gap: 12px;
}

.settings-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 14px;
}

.toggle-row input {
  width: 44px;
  height: 24px;
  accent-color: var(--blue);
}

.autosave-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.1);
  color: var(--blue);
  padding: 9px 13px;
  font-size: 0.84rem;
  font-weight: 800;
}

.autosave-status[data-tone="success"] {
  background: rgba(15, 138, 95, 0.1);
  color: var(--green);
}

.autosave-status[data-tone="warning"] {
  background: rgba(161, 92, 7, 0.1);
  color: var(--amber);
}

.autosave-status[data-tone="info"] {
  background: rgba(0, 102, 204, 0.1);
  color: var(--blue);
}

.onboarding-page {
  display: grid;
  width: min(920px, 100%);
  place-items: center;
}

.onboarding-card {
  width: 100%;
  border-radius: var(--radius-xl);
  padding: 30px;
}

.onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.step-counter {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.1);
  color: var(--blue);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 260ms ease;
}

.wizard-body {
  min-height: 310px;
  animation: riseIn 220ms ease both;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.chip-grid,
.distance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.chip-grid.single {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.choice-chip {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 12px 14px;
  font-weight: 740;
}

.choice-chip:hover,
.choice-chip.is-selected {
  border-color: rgba(0, 102, 204, 0.32);
  background: rgba(0, 102, 204, 0.1);
  color: var(--blue);
  transform: translateY(-1px);
}

.field-stack {
  display: grid;
  gap: 10px;
}

.field-stack.compact {
  margin-top: 16px;
  max-width: 280px;
}

.field-stack label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.text-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 15px;
  outline: none;
}

.text-input:focus {
  border-color: rgba(0, 102, 204, 0.42);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.search-results {
  display: grid;
  gap: 8px;
}

.airport-result,
.selected-airport {
  display: grid;
  gap: 4px;
  width: 100%;
  border-radius: 16px;
  padding: 14px;
  text-align: left;
}

.airport-result {
  background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="dark"] .airport-result {
  background: rgba(21, 28, 40, 0.96);
}

.airport-result span,
.selected-airport span {
  color: var(--muted);
}

.selected-airport {
  border: 1px solid rgba(15, 138, 95, 0.22);
  background: rgba(15, 138, 95, 0.08);
  color: var(--green);
}

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

.aircraft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 10px;
}

.icon-remove {
  border-radius: 14px;
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
  font-size: 1.4rem;
}

.page-enter {
  animation: riseIn 260ms ease both;
}

.sidebar-scrim {
  display: none;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loadingSweep {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

@keyframes storyRingFlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes storyViewerIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes storyPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes storySlideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes storyProgress {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

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

@media (max-width: 980px) {
  .login-page,
  .two-column,
  .dashboard-main-grid,
  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 420px;
  }

  .sidebar {
    transform: translateX(calc(-100% - 22px));
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim.is-visible {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    background: rgba(17, 24, 39, 0.18);
    backdrop-filter: blur(4px);
  }

  .workspace {
    padding: 12px 16px 20px;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    gap: 12px;
  }

  .pilot-hero,
  .assignment-hero,
  .history-hero,
  .settings-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .pilot-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .story-arrow {
    display: none;
  }
}

@media (max-width: 720px) {
  .auth-stage {
    padding: 14px;
  }

  .login-hero,
  .login-panel,
  .onboarding-card,
  .hero-panel {
    padding: 24px;
    border-radius: 22px;
  }

  .login-hero {
    min-height: 360px;
  }

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

  .dashboard-stories {
    margin-right: -2px;
    margin-left: -2px;
    border-radius: 22px;
  }

  .stories-heading {
    padding-inline: 18px;
  }

  .stories-rail {
    gap: 12px;
    padding-inline: 18px;
  }

  .story-button {
    width: 78px;
  }

  .story-ring {
    width: 66px;
    height: 66px;
  }

  .story-ring img {
    width: 58px;
    height: 58px;
  }

  .story-viewer {
    padding: 0;
  }

  .story-panel {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .story-progress {
    top: max(12px, env(safe-area-inset-top));
  }

  .story-viewer-header {
    top: calc(max(12px, env(safe-area-inset-top)) + 12px);
  }

  .pilot-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .pilot-actions,
  .pilot-actions button,
  .map-dashboard-panel .panel-heading {
    width: 100%;
  }

  .map-dashboard-panel .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .settings-grid,
  .history-card {
    grid-template-columns: 1fr;
  }

  .history-actions {
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-start;
  }

  .dashboard-map {
    min-height: 360px;
  }

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

  .onboarding-header,
  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 1.5rem;
  }

  .ghost-button {
    min-height: 40px;
    padding: 0 12px;
  }

  .wizard-actions {
    flex-direction: column-reverse;
  }

  .wizard-actions button {
    width: 100%;
  }

  .aircraft-row {
    grid-template-columns: 1fr;
  }

  .mission-route {
    grid-template-columns: 1fr;
  }

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

  .reserved-form {
    grid-template-columns: 1fr;
  }

  .icon-remove {
    width: 100%;
    height: 44px;
  }
}
