:root {
  color-scheme: light;
  --paper: #f2efe8;
  --paper-deep: #e9e5dc;
  --surface: #fffdf8;
  --surface-soft: #f8f5ee;
  --ink: #181b19;
  --ink-soft: #3d423e;
  --muted: #747a73;
  --line: #d8d4ca;
  --line-strong: #bdb8ad;
  --deep: #223936;
  --deep-2: #192e2c;
  --accent: #ea623e;
  --accent-dark: #c94729;
  --accent-soft: #fde6de;
  --green: #287b57;
  --green-soft: #e2f2e9;
  --red: #bd4651;
  --red-soft: #fae5e7;
  --amber: #c78b25;
  --blue: #367f90;
  --purple: #7e66b2;
  --shadow: 0 18px 55px rgba(33, 38, 34, 0.08);
  --shadow-small: 0 8px 24px rgba(33, 38, 34, 0.06);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --max-width: 1440px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101411;
  --paper-deep: #0b0e0c;
  --surface: #181d19;
  --surface-soft: #202620;
  --ink: #f3f0e8;
  --ink-soft: #d2d6d0;
  --muted: #99a198;
  --line: #343c35;
  --line-strong: #4b564c;
  --deep: #1b3d38;
  --deep-2: #102724;
  --accent: #ff7650;
  --accent-dark: #ea613d;
  --accent-soft: #43251e;
  --green: #59bd83;
  --green-soft: #173326;
  --red: #ec7d86;
  --red-soft: #3d2024;
  --amber: #e0a84b;
  --blue: #72bdcd;
  --purple: #a58bd7;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  --shadow-small: 0 8px 28px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  display: flex;
  height: 100dvh;
  min-width: 320px;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -12%, rgba(234, 98, 62, 0.1), transparent 27rem),
    linear-gradient(180deg, #f7f4ee 0, var(--paper) 42%, #eeebe4 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(rgba(24, 27, 25, 0.1) 0.55px, transparent 0.55px);
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

body.modal-open {
  overflow: hidden;
}

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

button,
select {
  cursor: pointer;
}

button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.15;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(234, 98, 62, 0.16);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 9px 24px rgba(234, 98, 62, 0.22);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

button.secondary,
button.quiet-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
  box-shadow: none;
}

button.secondary:hover:not(:disabled),
button.quiet-button:hover:not(:disabled) {
  color: var(--ink);
  background: #fff;
  border-color: var(--ink-soft);
  box-shadow: none;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
h4,
strong {
  letter-spacing: -0.025em;
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 300;
  padding: 0.6rem 0.85rem;
  color: #fff;
  font-weight: 800;
  background: var(--deep);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

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

:focus-visible {
  outline: 3px solid rgba(234, 98, 62, 0.45);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex: 0 0 auto;
  padding-top: env(safe-area-inset-top);
  background: rgba(247, 244, 238, 0.88);
  border-bottom: 1px solid rgba(189, 184, 173, 0.62);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
}

.brand-osm {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--line-strong);
}

.brand-product {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-button {
  min-height: 40px;
  padding: 0.52rem 0.78rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  background: transparent;
  border-color: transparent;
  border-radius: 999px;
  box-shadow: none;
}

.header-button:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  box-shadow: none;
}

.header-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent);
}

.header-icon svg {
  width: 100%;
  height: 100%;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.app-shell {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 0;
  flex: 1 1 auto;
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 5.2rem) 0 5rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: reveal 220ms ease both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.page-heading > div {
  min-width: 0;
}

.page-label,
.section-label,
.status-kicker,
.weather-direction {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: clamp(2.75rem, 6vw, 5.4rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.page-heading > p {
  max-width: 480px;
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.page-heading-compact h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

select {
  padding-right: 2rem;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(234, 98, 62, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

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

.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.page-actions {
  margin-top: 1.3rem;
}

.page-actions > :first-child {
  margin-right: auto;
}

.page-actions.floating-actions {
  position: static;
  display: grid;
  width: min(440px, 100%);
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 0.42rem;
  margin: 0 auto;
  padding: 0.42rem;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(189, 184, 173, 0.72);
  border-radius: 999px;
  box-shadow: 0 16px 44px rgba(33, 38, 34, 0.17);
  backdrop-filter: blur(18px) saturate(1.2);
}

.page-actions.floating-actions button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding-inline: 0.85rem;
}

.calendar-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.route-action-shell {
  z-index: 45;
  display: none;
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem max(0.5rem, env(safe-area-inset-bottom));
  background: rgba(242, 239, 232, 0.92);
  border-top: 1px solid rgba(189, 184, 173, 0.72);
  box-shadow: 0 -12px 34px rgba(33, 38, 34, 0.08);
  backdrop-filter: blur(18px) saturate(1.2);
}

body:not([data-route="setup"]) .route-action-shell {
  display: block;
}

.route-action-shell .floating-actions {
  display: none;
}

body[data-route="summary"] .route-actions-summary,
body[data-route="loading"] .route-actions-loading,
body[data-route="results"] .route-actions-results,
body[data-route="calendar"] .route-actions-calendar {
  display: grid;
}

.primary-action {
  width: 100%;
  margin-top: auto;
}

.start-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(450px, 1.18fr);
  gap: 1rem;
  align-items: stretch;
}

.start-card,
.work-panel,
.results-context,
.calendar-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.start-card {
  display: flex;
  min-height: 410px;
  flex-direction: column;
  padding: clamp(1.35rem, 3vw, 2.1rem);
}

.start-card-primary {
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(234, 98, 62, 0.24), transparent 19rem),
    linear-gradient(145deg, var(--deep), var(--deep-2));
  border-color: rgba(25, 46, 44, 0.7);
}

.start-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.start-card-index {
  display: block;
  padding-top: 0.16rem;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
}

.start-card-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 650;
  line-height: 1.05;
}

.start-card-heading p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.start-card-primary .start-card-heading p {
  color: #bfcfca;
}

.start-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: 2rem;
}

.start-card-primary label {
  color: #d9e4e0;
}

.start-card-primary select {
  color: #fff;
  background: rgba(8, 26, 24, 0.58);
  border-color: rgba(217, 228, 224, 0.24);
}

.start-card-primary select:focus {
  background: rgba(8, 26, 24, 0.78);
  border-color: var(--accent);
}

.start-card-primary select option {
  color: #fff;
  background: var(--deep-2);
}

.start-card-primary .primary-action {
  margin-top: 1rem;
}

.manual-grid {
  margin: 2rem 0 1rem;
}

.manual-grid > label:first-child {
  grid-column: 1 / -1;
}

.legal-note {
  max-width: 760px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.work-panel {
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
}

.centered-panel {
  max-width: 940px;
  margin-inline: auto;
}

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

.summary-card textarea {
  min-height: 140px;
}

.flight-context,
.result-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flight-context {
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.flight-context > div,
.result-context-item {
  min-width: 0;
  padding: 0.85rem 1rem;
}

.flight-context > div:not(:last-child),
.result-context-item:not(:last-child) {
  border-right: 1px solid var(--line);
}

.flight-context span,
.result-context-item > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.flight-context strong,
.result-context-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.87rem;
  line-height: 1.35;
}

.loading-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(650px, 1.22fr);
  gap: 1rem;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 650;
  line-height: 1.1;
}

.section-heading > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.plane-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.seat-card {
  position: relative;
  min-height: 86px;
  justify-content: flex-start;
  padding: 0.75rem;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.seat-card:hover:not(:disabled) {
  color: var(--ink);
  background: #fff;
  border-color: var(--accent);
  box-shadow: none;
}

.seat-card::after {
  position: absolute;
  top: 0.72rem;
  right: 0.72rem;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--line-strong);
  border-radius: 50%;
}

.seat-card.is-loaded::after,
.seat-card.flightbags::after {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 123, 87, 0.1);
}

.seat-card.seat-center {
  grid-column: 1 / -1;
}

.station-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.station-name {
  padding-right: 1rem;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.station-value {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.89rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-meta {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.panel-divider {
  height: 1px;
  margin: 1.5rem 0;
  background: var(--line);
}

.fuel-heading {
  align-items: flex-start;
}

.input-help {
  color: var(--muted);
  font-size: 0.67rem !important;
  line-height: 1.45;
}

.fuel-grid {
  gap: 0.7rem;
}

.input-with-unit {
  position: relative;
  display: flex;
}

.input-with-unit input {
  padding-right: 3rem;
}

.input-with-unit small {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  transform: translateY(-50%);
}

.weather-title {
  margin-bottom: 1rem;
}

.route-field {
  margin-bottom: 0.9rem;
  padding: 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.route-field input {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-field small {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 550;
}

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

.weather-panel {
  min-width: 0;
  padding-right: 1rem;
}

.weather-panel + .weather-panel {
  padding-right: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.weather-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.weather-panel-head h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.weather-direction {
  margin-bottom: 0.15rem;
  font-size: 0.58rem;
}

.wx-time {
  flex: 0 0 auto;
  max-width: 145px;
  padding: 0.3rem 0.42rem;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  text-align: right;
  background: var(--surface-soft);
  border-radius: 6px;
}

.airport-grid {
  gap: 0.65rem;
}

.metar-label {
  margin-top: 0.85rem;
}

.wx-textarea {
  min-height: 108px;
  margin-top: 0.42rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  text-transform: uppercase;
}

.quiet-button {
  width: 100%;
  min-height: 40px;
  margin-top: 0.5rem;
  padding-block: 0.5rem;
  font-size: 0.7rem;
}

.calculate-button {
  min-width: 170px;
}

.results-context {
  padding: 0;
  box-shadow: var(--shadow-small);
}

.result-context-grid {
  background: var(--surface);
}

.results-metar {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

.results-metar strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
}

.calculation-status {
  margin-top: 1rem;
  padding: clamp(1.15rem, 2.5vw, 1.8rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.calculation-status:empty {
  display: none;
}

.calculation-status.invalid {
  border-left-color: var(--red);
}

.calculation-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.calculation-status-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 650;
  line-height: 1.15;
}

.calculation-status.valid .status-kicker {
  color: var(--green);
}

.calculation-status.invalid .status-kicker {
  color: var(--red);
}

.status-badge {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  color: var(--green);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  background: var(--green-soft);
  border-radius: 999px;
}

.invalid .status-badge {
  color: var(--red);
  background: var(--red-soft);
}

.calculation-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1.25rem;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.calculation-metrics > div {
  padding: 0.78rem 0.9rem;
  background: var(--surface-soft);
}

.calculation-metrics span,
.runway-info-row span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calculation-metrics strong {
  display: block;
  font-size: 0.88rem;
}

.calculation-status details {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.calculation-status summary {
  width: fit-content;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.limit-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.limit-checks li {
  display: grid;
  min-height: 63px;
  grid-template-columns: auto 1fr;
  column-gap: 0.58rem;
  align-content: center;
  padding: 0.65rem 0.72rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.limit-checks li > span {
  grid-row: span 2;
  align-self: start;
  color: var(--green);
  font-weight: 900;
}

.limit-checks li.fail > span {
  color: var(--red);
}

.limit-checks strong {
  font-size: 0.75rem;
}

.limit-checks small {
  color: var(--muted);
  font-size: 0.65rem;
}

.calculation-source,
.calculation-notes {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.55;
}

.calculation-source {
  margin: 0.9rem 0 0;
}

.calculation-notes {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
}

.result-section {
  margin-top: 1rem;
}

.runway-graphics {
  display: grid;
  gap: 0.85rem;
}

.runway-card {
  padding: 1rem;
  color: #f5f4ef;
  background:
    radial-gradient(circle at 100% 0, rgba(234, 98, 62, 0.11), transparent 22rem),
    var(--deep-2);
  border: 1px solid #314b48;
  border-radius: 16px;
}

.runway-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.runway-card-head h4 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 650;
}

.runway-card-head span {
  color: #bacbc6;
  font-size: 0.7rem;
  font-weight: 750;
}

.runway-distance-layout {
  display: block;
}

.runway-distance-chart {
  position: relative;
  min-height: 142px;
  padding: 1rem 1.1rem 2.35rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid #38524f;
  border-radius: 12px;
}

.distance-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}

.distance-legend > div {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  column-gap: 0.45rem;
  align-items: center;
}

.distance-legend span {
  overflow: hidden;
  color: #a8bbb5;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.distance-legend strong {
  grid-column: 2;
  color: #f5f4ef;
  font-size: 0.77rem;
}

.distance-legend .good strong { color: #78db9d; }
.distance-legend .bad strong { color: #ff9ba4; }

.distance-swatch {
  grid-row: span 2;
  width: 8px;
  height: 28px;
  background: #74cf96;
  border-radius: 999px;
}

.distance-swatch.distance-fifty { background: #68c3d5; }
.distance-swatch.distance-final.good { background: #e7ab55; }
.distance-swatch.distance-final.bad { background: #e16c76; }

.distance-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.distance-segment {
  display: block;
  flex: 0 0 var(--segment-share);
  min-width: 2px;
  height: 100%;
  border-right: 2px solid rgba(11, 27, 25, 0.72);
}

.distance-segment:last-child {
  border-right: 0;
}

.distance-ground { background: #74cf96; }
.distance-fifty { background: #68c3d5; }
.distance-final.good { background: #e7ab55; }
.distance-final.bad { background: #e16c76; }

.distance-axis {
  position: absolute;
  right: 1.1rem;
  bottom: 0.45rem;
  left: 1.1rem;
  height: 24px;
  color: #a8bbb5;
  font-size: 0.55rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.distance-axis span {
  position: absolute;
  top: 0;
  left: var(--axis-position);
  transform: translateX(-50%);
}

.distance-axis span::after {
  content: " ft";
  opacity: 0.7;
}

.distance-axis .axis-start {
  transform: none;
}

.distance-axis .axis-ground {
  color: #91e2ad;
}

.distance-axis .axis-fifty {
  top: 0.78rem;
  color: #8fd8e5;
}

.distance-axis .axis-available {
  transform: translateX(-100%);
}

.runway-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.runway-info-row > div {
  min-width: 0;
  padding: 0.62rem 0.68rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.runway-info-row span {
  color: #9fb2ac;
}

.runway-info-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.runway-info-row .good strong,
.runway-info-row strong.green { color: #78db9d; }
.runway-info-row .bad strong { color: #ff9ba4; }
.runway-info-row strong.blue { color: #77d3e4; }

.results-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.72rem 0.82rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

th:first-child,
td:first-child {
  text-align: left;
}

thead {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-soft);
}

tbody {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

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

.wb-subtotal td,
.wb-total td {
  color: var(--ink);
  font-weight: 800;
  background: #f5ece7;
}

.wb-deduction td:not(:first-child) {
  color: var(--red);
}

.cg-plot-wrap {
  display: grid;
  min-height: 380px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.cg-plot {
  display: block;
  width: 100%;
  max-height: 690px;
  object-fit: contain;
}

.calendar-heading {
  align-items: flex-end;
}

.calendar-panel {
  padding: 0;
  box-shadow: var(--shadow-small);
}

.school-calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.calendar-navigation {
  display: flex;
  gap: 0.4rem;
}

.school-calendar-toolbar button {
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  font-size: 0.7rem;
}

.school-calendar-toolbar .icon-button {
  width: 38px;
  padding: 0;
}

.calendar-title-block {
  min-width: 210px;
  text-align: center;
}

.calendar-title-block span {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.calendar-title-block h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.refresh-button {
  justify-self: end;
}

.refresh-icon {
  display: inline-block;
}

.refresh-button.is-loading {
  color: var(--accent);
}

.refresh-button.is-loading .refresh-icon {
  animation: spin 800ms linear infinite;
}

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

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  padding: 0.65rem 1rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.calendar-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.calendar-hint {
  margin-left: auto;
}

.legend-dot {
  width: 7px;
  height: 7px;
  background: #5ab1d0;
  border-radius: 50%;
}

.legend-dot.multi { background: var(--purple); }
.legend-dot.stage { background: var(--amber); }
.legend-dot.standby { background: #8f999f; }

.school-calendar-shell {
  width: 100%;
  min-height: 420px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  color-scheme: light;
  background: #e8eceb;
  overscroll-behavior: contain;
  scrollbar-color: #8c9b98 #e1e6e4;
}

.school-calendar-wrap {
  width: max-content;
  min-width: 100%;
}

.school-calendar {
  position: relative;
  display: grid !important;
  grid-template-columns: 92px repeat(24, 64px) !important;
  grid-template-rows: 42px;
  grid-auto-rows: 72px;
  min-width: 1628px;
  color: #1b2927;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  background: #eef1f0;
  border-top: 1px solid #c4cecb;
  border-left: 1px solid #c4cecb;
}

.school-tail,
.school-row,
.hour-head,
.aircraft-head {
  border-right: 1px solid #c4cecb;
  border-bottom: 1px solid #c4cecb;
}

.aircraft-head,
.hour-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  min-height: 42px;
  place-items: center;
  color: #50615d;
  background: #fafbf9;
  box-shadow: 0 1px 0 #afbbb8;
}

.aircraft-head {
  left: 0;
  z-index: 12;
  width: 92px;
  min-width: 92px;
  padding: 0.3rem;
  border-right: 2px solid #a0afab;
  font-size: 0.61rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hour-head {
  width: 64px;
  min-width: 64px;
  font-size: 0.62rem;
  font-weight: 800;
}

.school-tail {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  width: 92px;
  min-width: 92px;
  align-items: center;
  padding: 0.32rem;
  background: #f2f5f3;
  border-right: 2px solid #a0afab;
}

.school-tail-standby {
  background: #e8ecea;
}

.tail-link {
  width: 100%;
  min-height: 46px;
  padding: 0.3rem;
  color: #1f302d;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: pre-line;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
}

.tail-link:hover:not(:disabled) {
  color: #1f302d;
  background: rgba(54, 127, 144, 0.08);
  border-color: rgba(54, 127, 144, 0.2);
  box-shadow: none;
}

.tail-link-live {
  cursor: pointer;
}

.flying-icon {
  margin-left: 0.2rem;
  color: var(--green);
}

.school-row {
  position: relative;
  height: 72px;
  min-height: 72px;
  overflow: hidden;
  background:
    repeating-linear-gradient(to right, transparent 0, transparent 63px, #cad2d0 63px, #cad2d0 64px),
    #fafbf9;
}

.school-row-standby {
  background:
    repeating-linear-gradient(to right, transparent 0, transparent 63px, #cad2d0 63px, #cad2d0 64px),
    #edf0ef;
}

.school-event {
  position: absolute;
  top: 5px;
  bottom: 5px;
  z-index: 3;
  display: flex;
  min-width: 3px;
  flex-direction: column;
  justify-content: center;
  padding: 0.26rem 0.34rem;
  overflow: hidden;
  color: #11303a;
  line-height: 1.1;
  text-align: center;
  background: #a8dced;
  border: 1px solid #5ab1d0;
  border-left-width: 3px;
  border-radius: 4px;
}

.school-event-stage {
  color: #442e08;
  background: #f4d994;
  border-color: #c78b25;
}

.school-event-multi {
  color: #35265b;
  background: #dcd1f4;
  border-color: #8a72bc;
}

.school-event-standby {
  color: #465250;
  background: #d8dfdd;
  border-color: #929e9b;
}

.school-event strong,
.school-event span,
.school-event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-event strong {
  font-size: 0.65rem;
  font-weight: 900;
}

.school-event span {
  font-size: 0.59rem;
}

.school-event small {
  font-size: 0.54rem;
  white-space: normal;
}

.current-time-global {
  position: absolute;
  top: 42px;
  bottom: 0;
  z-index: 7;
  width: 2px;
  pointer-events: none;
  background: var(--accent);
}

.current-time-global::before {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.loading,
.empty-calendar {
  width: min(100vw - 40px, 900px);
  padding: 3rem 1.5rem;
  color: #53625f;
  font-weight: 750;
  text-align: center;
  background: #fafbf9;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(24, 27, 25, 0.58);
  backdrop-filter: blur(9px);
}

.modal-card {
  width: min(100%, 500px);
  max-height: calc(100vh - 2rem);
  padding: clamp(1.2rem, 3vw, 1.7rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(24, 27, 25, 0.25);
  animation: modal-in 170ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.987); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-heading {
  margin-bottom: 1.15rem;
}

.modal-heading h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 650;
}

.modal-heading p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.modal-fields {
  display: grid;
  gap: 0.85rem;
}

.modal-actions {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.modal-actions > :first-child {
  margin-right: auto;
}

.single-action > :first-child {
  margin-right: 0;
}

.accounts-card {
  width: min(100%, 650px);
}

.account-mode {
  margin-bottom: 0.9rem;
  padding: 0.58rem 0.7rem;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  background: #e6f0f1;
  border-radius: 8px;
}

.account-mode.new {
  color: var(--green);
  background: var(--green-soft);
}

.account-mode.locked {
  color: var(--red);
  background: var(--red-soft);
}

.account-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.65rem 0 0.9rem;
}

.account-actions button {
  min-height: 38px;
  padding-block: 0.45rem;
  font-size: 0.69rem;
}

.danger-button {
  color: var(--red) !important;
  border-color: rgba(189, 70, 81, 0.4) !important;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.text-button {
  width: fit-content;
  min-height: auto;
  justify-content: flex-start;
  margin-top: 0.08rem;
  padding: 0.15rem 0;
  color: var(--accent-dark);
  font-size: 0.69rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.text-button:hover:not(:disabled) {
  color: var(--accent);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.checkbox-label {
  display: flex;
  min-height: 46px;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.78rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.checkbox-label input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.help-steps {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-steps li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.help-steps li > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent-dark);
  font-size: 0.66rem;
  font-weight: 850;
  background: var(--accent-soft);
  border-radius: 50%;
}

.help-steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.saved-flash {
  color: #fff !important;
  background: var(--green) !important;
  border-color: var(--green) !important;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 85% -12%, rgba(255, 118, 80, 0.1), transparent 27rem),
    linear-gradient(180deg, #151a16 0, var(--paper) 42%, #0d110e 100%);
}

html[data-theme="dark"] body::before {
  opacity: 0.2;
  background-image: radial-gradient(rgba(232, 238, 232, 0.14) 0.55px, transparent 0.55px);
}

html[data-theme="dark"] .app-header {
  background: rgba(16, 20, 17, 0.88);
  border-bottom-color: rgba(75, 86, 76, 0.68);
}

html[data-theme="dark"] .header-button:hover:not(:disabled),
html[data-theme="dark"] button.secondary:hover:not(:disabled),
html[data-theme="dark"] button.quiet-button:hover:not(:disabled),
html[data-theme="dark"] .seat-card:hover:not(:disabled) {
  background: #272e28;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  background: #252c26;
}

html[data-theme="dark"] .flight-context {
  background: rgba(24, 29, 25, 0.74);
}

html[data-theme="dark"] .page-actions.floating-actions {
  background: rgba(22, 27, 23, 0.9);
  border-color: rgba(75, 86, 76, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .route-action-shell {
  background: rgba(16, 20, 17, 0.94);
  border-top-color: rgba(75, 86, 76, 0.82);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .wb-subtotal td,
html[data-theme="dark"] .wb-total td {
  background: #30251f;
}

html[data-theme="dark"] .account-mode {
  background: #1b3033;
}

html[data-theme="dark"] .school-calendar-shell {
  color-scheme: dark;
  background: #131815;
  scrollbar-color: #536057 #1a211c;
}

html[data-theme="dark"] .school-calendar {
  color: #e5e9e3;
  background: #171d18;
  border-color: #3a453d;
}

html[data-theme="dark"] .school-tail,
html[data-theme="dark"] .school-row,
html[data-theme="dark"] .hour-head,
html[data-theme="dark"] .aircraft-head {
  border-color: #3a453d;
}

html[data-theme="dark"] .aircraft-head,
html[data-theme="dark"] .hour-head {
  color: #a8b2a8;
  background: #202721;
  box-shadow: 0 1px 0 #4b574d;
}

html[data-theme="dark"] .aircraft-head,
html[data-theme="dark"] .school-tail {
  border-right-color: #526056;
}

html[data-theme="dark"] .school-tail {
  background: #1c231e;
}

html[data-theme="dark"] .school-tail-standby {
  background: #181e1a;
}

html[data-theme="dark"] .tail-link,
html[data-theme="dark"] .tail-link:hover:not(:disabled) {
  color: #e4e9e2;
}

html[data-theme="dark"] .school-row {
  background:
    repeating-linear-gradient(to right, transparent 0, transparent 63px, #354038 63px, #354038 64px),
    #1b211c;
}

html[data-theme="dark"] .school-row-standby {
  background:
    repeating-linear-gradient(to right, transparent 0, transparent 63px, #354038 63px, #354038 64px),
    #171d19;
}

html[data-theme="dark"] .school-event {
  color: #d7f4fb;
  background: #173c45;
  border-color: #4b9fb3;
}

html[data-theme="dark"] .school-event-stage {
  color: #ffe8ba;
  background: #453516;
  border-color: #b8842e;
}

html[data-theme="dark"] .school-event-multi {
  color: #eee6ff;
  background: #34294c;
  border-color: #806bb0;
}

html[data-theme="dark"] .school-event-standby {
  color: #d3dbd5;
  background: #303833;
  border-color: #69756d;
}

html[data-theme="dark"] .loading,
html[data-theme="dark"] .empty-calendar {
  color: var(--muted);
  background: #1b211c;
}

html[data-theme="dark"] .modal {
  background: rgba(3, 5, 4, 0.72);
}

@media (max-width: 1120px) {
  .loading-layout,
  .results-analysis-grid {
    grid-template-columns: 1fr;
  }

  .loading-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 1px minmax(300px, 0.85fr);
    gap: 1.2rem;
    align-items: start;
  }

  .loading-panel > .section-heading:first-child,
  .loading-panel > .plane-top {
    grid-column: 1;
  }

  .loading-panel > .panel-divider {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 1px;
    height: 100%;
    margin: 0;
  }

  .loading-panel > .fuel-heading,
  .loading-panel > .fuel-grid {
    grid-column: 3;
  }

  .loading-panel > .fuel-heading {
    grid-row: 1;
  }

  .loading-panel > .fuel-grid {
    grid-row: 2;
  }

  .results-analysis-grid .result-section {
    margin-top: 0;
  }

  .results-analysis-grid {
    margin-top: 1rem;
  }
}

@media (max-width: 820px) {
  .start-grid {
    grid-template-columns: 1fr;
  }

  .start-card {
    min-height: 0;
  }

  .start-card-content {
    margin-top: 2.6rem;
  }

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

  .weather-panel {
    padding-right: 0;
  }

  .weather-panel + .weather-panel {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .school-calendar-shell {
    max-height: calc(100vh - 285px);
  }
}

@media (max-width: 680px) {
  :root {
    --radius-lg: 17px;
    --radius-md: 12px;
  }

  .header-inner,
  .app-shell {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .header-inner {
    min-height: 62px;
  }

  .brand-osm {
    font-size: 0.82rem;
  }

  .brand-product {
    font-size: 0.75rem;
  }

  .header-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .header-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .app-shell {
    min-height: 0;
    padding-top: 1.7rem;
    padding-bottom: 3rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.3rem;
  }

  .page-heading h1,
  .page-heading-compact h1 {
    font-size: clamp(2.45rem, 14vw, 3.4rem);
  }

  .page-heading > p {
    max-width: 100%;
    margin: 0;
    font-size: 0.8rem;
    text-align: left;
  }

  .start-card,
  .work-panel {
    padding: 1rem;
  }

  .start-card-heading h2 {
    font-size: 1.65rem;
  }

  .start-card-content {
    margin-top: 2rem;
  }

  .manual-grid,
  .grid,
  .summary-card,
  .account-form-grid,
  .calculation-metrics,
  .result-context-grid {
    grid-template-columns: 1fr;
  }

  .manual-grid > label:first-child,
  .wide,
  .results-metar {
    grid-column: auto;
  }

  .flight-context {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .flight-context::-webkit-scrollbar {
    display: none;
  }

  .flight-context > div {
    flex: 0 0 78%;
    border-right: 1px solid var(--line) !important;
    scroll-snap-align: start;
  }

  .result-context-item:not(:last-child) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .loading-panel {
    display: block;
  }

  .loading-panel > .panel-divider {
    width: auto;
    height: 1px;
    margin: 1.35rem 0;
  }

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

  .section-heading > p {
    max-width: 100%;
    text-align: left;
  }

  .plane-top {
    gap: 0.5rem;
  }

  .seat-card {
    min-height: 84px;
    padding: 0.68rem;
  }

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

  .page-actions.floating-actions {
    width: 100%;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.35rem;
    padding: 0.35rem;
  }

  .route-action-shell {
    padding: 0.42rem 0.55rem max(0.42rem, env(safe-area-inset-bottom));
  }

  .page-actions.floating-actions button {
    min-height: 46px;
    padding-inline: 0.55rem;
    font-size: 0.78rem;
  }

  .calculation-status {
    padding: 1rem;
    border-left-width: 4px;
  }

  .calculation-status-head,
  .runway-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-badge {
    order: -1;
  }

  .limit-checks {
    grid-template-columns: 1fr;
  }

  .runway-card {
    padding: 0.68rem;
  }

  .runway-card-head {
    margin-bottom: 0.7rem;
  }

  .runway-card-head span {
    font-size: 0.64rem;
  }

  .runway-distance-layout {
    display: grid;
    grid-template-columns: minmax(66px, 1fr) minmax(0, 3fr);
    gap: 0.42rem;
    align-items: stretch;
  }

  .runway-distance-chart {
    height: 100%;
    min-height: 100%;
    padding: 0;
    background: rgba(255, 255, 255, 0.025);
  }

  .distance-legend {
    display: none;
  }

  .distance-track {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 12px;
    width: 10px;
    height: auto;
    flex-direction: column;
  }

  .distance-segment {
    width: 100%;
    min-width: 0;
    min-height: 2px;
    height: auto;
    border-right: 0;
    border-bottom: 2px solid rgba(11, 27, 25, 0.72);
  }

  .distance-segment:last-child {
    border-bottom: 0;
  }

  .distance-axis {
    top: 16px;
    right: 3px;
    bottom: 16px;
    left: 29px;
    width: auto;
    height: auto;
    font-size: 0.48rem;
  }

  .distance-axis span,
  .distance-axis .axis-fifty {
    top: var(--axis-position);
    right: auto;
    left: 0;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-50%);
  }

  .distance-axis .axis-start {
    transform: none;
  }

  .distance-axis .axis-available {
    transform: translateY(-100%);
  }

  .runway-info-row {
    grid-template-columns: 1fr;
    gap: 0.32rem;
    margin-top: 0;
  }

  .runway-info-row > div {
    padding: 0.44rem 0.55rem;
  }

  .runway-info-row span {
    font-size: 0.52rem;
  }

  .runway-info-row strong {
    font-size: 0.72rem;
  }

  .runway-info-row .metric-ground { border-left: 3px solid #74cf96; }
  .runway-info-row .metric-fifty { border-left: 3px solid #68c3d5; }
  .runway-info-row .metric-margin.good { border-left: 3px solid #e7ab55; }
  .runway-info-row .metric-margin.bad { border-left: 3px solid #e16c76; }

  .cg-plot-wrap {
    min-height: 270px;
  }

  .school-calendar-toolbar {
    grid-template-columns: 1fr auto;
  }

  .calendar-navigation {
    grid-column: 1 / -1;
    justify-content: center;
    order: 2;
  }

  .calendar-title-block {
    min-width: 0;
    text-align: left;
  }

  .refresh-button span:last-child,
  .calendar-hint {
    display: none;
  }

  .refresh-button {
    width: 38px;
    padding: 0;
  }

  .calendar-legend {
    gap: 0.55rem 0.8rem;
  }

  .school-calendar-shell {
    min-height: 365px;
    max-height: calc(100vh - 325px);
  }

  .modal {
    align-items: end;
    padding: 0.45rem;
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 0.9rem - env(safe-area-inset-bottom));
    border-radius: 18px 18px 12px 12px;
  }

  .button-row.modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .brand-divider,
  .brand-product {
    display: none;
  }

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

  .plane-top {
    grid-template-columns: 1fr 1fr;
  }

}

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

@media print {
  body {
    display: block;
    height: auto;
    overflow: visible;
    background: #fff;
  }

  .app-header,
  .route-action-shell,
  .page-actions,
  .page-heading > p,
  .calendar-step {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
    overflow: visible;
  }

  .step:not(#step-results) {
    display: none !important;
  }

  #step-results {
    display: block !important;
  }

  .work-panel,
  .results-context,
  .calculation-status,
  .runway-card {
    color: #111;
    background: #fff;
    border-color: #bbb;
    box-shadow: none;
    break-inside: avoid;
  }
}
