:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-2: #081220;
  --surface: rgba(13, 26, 43, .84);
  --surface-strong: #0d1a2b;
  --surface-soft: rgba(18, 35, 56, .66);
  --surface-hover: rgba(28, 51, 78, .76);
  --line: rgba(144, 184, 222, .14);
  --line-strong: rgba(144, 184, 222, .28);
  --text: #eef7ff;
  --muted: #8ea5ba;
  --muted-2: #627a91;
  --blue: #2f95ff;
  --blue-2: #71c5ff;
  --orange: #ff8a34;
  --orange-2: #ffb266;
  --green: #34d399;
  --yellow: #f5c84c;
  --red: #ff5d68;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --shadow: 0 24px 72px rgba(0, 0, 0, .34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --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);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(47, 149, 255, .16), transparent 31rem),
    radial-gradient(circle at 92% 5%, rgba(255, 138, 52, .10), transparent 25rem),
    linear-gradient(180deg, #07111f 0%, var(--bg) 46%, #040910 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--blue-2); }
svg { display: block; }
[hidden] { display: none !important; }

.glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 34, 55, .91), rgba(8, 18, 31, .82));
  box-shadow: inset 0 1px rgba(255,255,255,.035), var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.fatal-message,
.offline-banner {
  position: fixed;
  z-index: 9999;
  left: 50%;
  transform: translateX(-50%);
  top: 14px;
  width: min(94vw, 900px);
  padding: 12px 18px;
  border: 1px solid rgba(245, 200, 76, .48);
  border-radius: 12px;
  background: rgba(64, 48, 6, .96);
  color: #fff4bf;
  text-align: center;
  font-size: .89rem;
  box-shadow: var(--shadow);
}

.login-overlay {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(47,149,255,.19), transparent 32rem),
    radial-gradient(circle at 83% 82%, rgba(255,138,52,.13), transparent 28rem),
    rgba(4, 10, 18, .94);
}
.login-card {
  width: min(100%, 520px);
  padding: 34px;
  border-radius: 26px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.brand-lockup--large { gap: 18px; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--blue-2);
  filter: drop-shadow(0 0 12px rgba(47,149,255,.35));
}
.brand-lockup--large .brand-mark { width: 58px; height: 58px; }
.brand-name {
  font-weight: 820;
  letter-spacing: .08em;
  line-height: 1.08;
  white-space: nowrap;
}
.brand-name span {
  background: linear-gradient(90deg, var(--blue-2) 0 43%, var(--orange-2) 58% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: .64rem;
  letter-spacing: .18em;
  white-space: nowrap;
}
.login-copy { margin: 36px 0 20px; color: var(--muted); }
.login-form { display: grid; gap: 8px; }
.pin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.pin-row input { letter-spacing: .25em; font-size: 1.1rem; }
.form-error { min-height: 1.2rem; margin: 5px 0 0; color: #ff8c93; font-size: .86rem; }
.setup-link { display: inline-block; margin-top: 18px; font-size: .86rem; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  z-index: 1100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(76px + var(--safe-top));
  padding: calc(13px + var(--safe-top)) max(22px, var(--safe-right)) 13px max(22px, var(--safe-left));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 12, 22, .84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .78rem;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px currentColor;
}
.sync-indicator.is-ok .sync-dot { background: var(--green); }
.sync-indicator.is-error .sync-dot { background: var(--red); }
.sync-indicator.is-loading .sync-dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.45); opacity: .55; } }

.icon-button,
.button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, opacity .15s ease;
}
.icon-button:hover, .button:hover { transform: translateY(-1px); }
.icon-button:active, .button:active { transform: translateY(0); }
.icon-button:disabled, .button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.icon-button svg, .button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 17px;
  border-radius: 12px;
  font-weight: 720;
  font-size: .86rem;
}
.button--primary {
  color: #fff;
  background: linear-gradient(135deg, #147ddd, #319eff);
  box-shadow: 0 10px 28px rgba(47,149,255,.2);
}
.button--secondary {
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.045);
}
.button--secondary:hover { background: var(--surface-hover); }
.button--danger {
  color: #ffdadd;
  border: 1px solid rgba(255,93,104,.34);
  background: rgba(255,93,104,.12);
}
.text-button {
  padding: 4px;
  color: var(--blue-2);
  background: transparent;
  font-weight: 700;
  font-size: .82rem;
}
.text-button:hover { color: #fff; }

.workspace {
  width: min(1560px, calc(100% - 38px));
  margin: 0 auto;
  padding: 20px 0 46px;
}
.mission-toolbar {
  display: grid;
  grid-template-columns: minmax(310px, 1.8fr) minmax(130px, .55fr) minmax(118px, .48fr) minmax(230px, .9fr);
  gap: 14px;
  align-items: end;
  padding: 16px;
  border-radius: var(--radius-lg);
}
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .71rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: rgba(3, 10, 18, .72);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input, select { min-height: 43px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(47,149,255,.72);
  box-shadow: 0 0 0 3px rgba(47,149,255,.12);
  background: rgba(7, 17, 29, .96);
}
input[type="date"], input[type="time"] { color-scheme: dark; }
select { cursor: pointer; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.search-input-wrap { position: relative; }
.search-input-wrap > svg {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  pointer-events: none;
}
.search-input-wrap input { padding-left: 40px; }
.search-results {
  position: absolute;
  z-index: 1400;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #0a1727;
  box-shadow: var(--shadow);
}
.search-result {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-hover); }
.search-result strong, .search-result small { display: block; }
.search-result small { margin-top: 3px; color: var(--muted); }
.selected-location {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .76rem;
}
.selected-location strong { color: var(--text); }
.location-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px rgba(255,138,52,.68);
}

.app-tabs {
  position: sticky;
  z-index: 1000;
  top: calc(76px + var(--safe-top));
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 18px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 16, 28, .82);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}
.app-tabs::-webkit-scrollbar { display: none; }
.tab-button {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 720;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab-button:hover { color: var(--text); background: rgba(255,255,255,.035); }
.tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(47,149,255,.23), rgba(47,149,255,.11));
  box-shadow: inset 0 0 0 1px rgba(86,174,255,.22);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: tabIn .22s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(4px); } }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 14px;
}
.overall-card,
.mission-controls,
.timeline-panel,
.insight-card,
.chart-card,
.forecast-table-card,
.method-card,
.kp-card,
.space-alerts,
.gnss-check-card,
.mission-editor,
.missions-list-card,
.settings-card {
  border-radius: var(--radius-lg);
}
.overall-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 250px;
  padding: 28px 30px;
}
.overall-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -85px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47,149,255,.13), transparent 68%);
  pointer-events: none;
}
.overall-copy { position: relative; z-index: 1; max-width: 720px; }
.eyebrow {
  color: var(--blue-2);
  font-size: .66rem;
  font-weight: 820;
  letter-spacing: .16em;
}
.overall-copy h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.9rem, 3.2vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.overall-copy p { max-width: 670px; margin: 0; color: #adc0d2; line-height: 1.55; }
.overall-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 21px; color: var(--muted); font-size: .76rem; }
.overall-gauge {
  --angle: calc(var(--score) * 3.6deg);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 158px;
  height: 158px;
  flex: 0 0 auto;
  margin-left: 24px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color) var(--angle), rgba(255,255,255,.07) 0);
  filter: drop-shadow(0 16px 22px rgba(0,0,0,.22));
}
.overall-gauge::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #0a1727;
  box-shadow: inset 0 0 0 1px var(--line);
}
.overall-gauge__inner { position: relative; z-index: 1; text-align: center; }
.overall-gauge strong { display: block; font-size: 2.5rem; line-height: 1; }
.overall-gauge span { display: block; margin-top: 6px; color: var(--muted); font-size: .68rem; text-transform: uppercase; }

.mission-controls { padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading--compact { margin-bottom: 14px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 1.06rem; letter-spacing: -.01em; }
.slider-field + .slider-field { margin-top: 24px; }
.slider-label-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #c9d7e4; font-size: .82rem; }
.slider-label-row output { color: var(--orange-2); font-weight: 800; }
input[type="range"] {
  appearance: none;
  min-height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47,149,255,.75), rgba(47,149,255,.18));
  box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 3px solid #dff2ff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47,149,255,.13), 0 4px 12px rgba(0,0,0,.35);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #dff2ff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47,149,255,.13), 0 4px 12px rgba(0,0,0,.35);
}
.slider-scale { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted-2); font-size: .65rem; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.status-card {
  position: relative;
  overflow: hidden;
  min-height: 172px;
  padding: 18px;
  border-radius: 16px;
  transition: transform .18s ease, border-color .18s ease;
}
.status-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.status-card::after {
  content: "";
  position: absolute;
  inset: auto -35px -55px auto;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor, transparent 68%);
  opacity: .07;
}
.status-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border: 1px solid currentColor;
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.status-card__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.status-card__icon--airspace { color: var(--blue-2); }
.status-card__icon--notam { color: var(--orange-2); }
.status-card__icon--weather { color: var(--cyan); }
.status-card__icon--thermal { color: #ff7a8b; }
.status-card__icon--space { color: var(--purple); }
.status-card__top { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: .62rem; font-weight: 820; letter-spacing: .12em; }
.status-pill {
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--muted);
  font-size: .51rem;
  letter-spacing: .08em;
}
.status-card__title { display: block; margin-top: 12px; font-size: .93rem; }
.status-card__detail { margin: 6px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.42; }
.status-card.status-ok { border-color: rgba(52,211,153,.27); }
.status-card.status-ok .status-pill { color: var(--green); background: rgba(52,211,153,.08); }
.status-card.status-warn { border-color: rgba(245,200,76,.29); }
.status-card.status-warn .status-pill { color: var(--yellow); background: rgba(245,200,76,.08); }
.status-card.status-bad { border-color: rgba(255,93,104,.3); }
.status-card.status-bad .status-pill { color: var(--red); background: rgba(255,93,104,.08); }
.status-card.status-unknown .status-pill { color: var(--muted); }

.timeline-panel { margin-top: 14px; padding: 22px; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .69rem; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.legend-dot--ok { background: var(--green); }
.legend-dot--warn { background: var(--yellow); }
.legend-dot--bad { background: var(--red); }
.operational-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(74px, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding: 5px 1px 8px;
  scrollbar-color: rgba(144,184,222,.25) transparent;
}
.timeline-hour {
  position: relative;
  min-height: 90px;
  padding: 11px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.024);
  text-align: center;
  cursor: pointer;
}
.timeline-hour:hover, .timeline-hour.is-selected { border-color: var(--blue); background: rgba(47,149,255,.08); }
.timeline-hour::before { content: ""; display: block; width: 7px; height: 7px; margin: 0 auto 9px; border-radius: 50%; background: var(--muted); }
.timeline-hour.risk-ok::before { background: var(--green); box-shadow: 0 0 10px rgba(52,211,153,.55); }
.timeline-hour.risk-warn::before { background: var(--yellow); }
.timeline-hour.risk-bad::before { background: var(--red); box-shadow: 0 0 10px rgba(255,93,104,.45); }
.timeline-hour strong { display: block; color: var(--text); font-size: .8rem; }
.timeline-hour span { display: block; margin-top: 7px; font-size: .64rem; }
.timeline-hour small { display: block; margin-top: 4px; color: var(--muted-2); font-size: .58rem; }
.skeleton-line { height: 82px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.08), rgba(255,255,255,.03)); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }

.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.insight-card { min-height: 198px; padding: 21px; }
.direction-badge, .score-badge, .risk-badge, .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--blue-2);
  background: rgba(47,149,255,.07);
  font-size: .72rem;
  font-weight: 800;
}
.score-badge { color: #ff8ca1; background: rgba(255,93,104,.07); }
.risk-badge { color: var(--yellow); background: rgba(245,200,76,.07); }
.altitude-bars { display: grid; gap: 11px; }
.altitude-bar { display: grid; grid-template-columns: 48px 1fr 64px; gap: 9px; align-items: center; color: var(--muted); font-size: .7rem; }
.altitude-bar__track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.06); }
.altitude-bar__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.altitude-bar strong { color: var(--text); text-align: right; font-size: .72rem; }
.insight-copy { margin: 14px 0 0; color: var(--muted); line-height: 1.55; font-size: .81rem; }

.map-shell { overflow: hidden; border-radius: var(--radius-xl); }
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.map-toolbar__title strong { display: block; margin-top: 5px; font-size: .85rem; }
.layer-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.layer-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.layer-toggle span {
  display: block;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .72rem;
  cursor: pointer;
}
.layer-toggle input:checked + span { color: #fff; border-color: rgba(47,149,255,.45); background: rgba(47,149,255,.14); }
.map-stage { position: relative; }
#map { height: clamp(470px, 68vh, 820px); background: #07111c; }
.map-hint {
  position: absolute;
  z-index: 550;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #dceaff;
  background: rgba(4, 12, 21, .76);
  backdrop-filter: blur(12px);
  font-size: .68rem;
  pointer-events: none;
}
.map-legend {
  position: absolute;
  z-index: 550;
  left: 13px;
  bottom: 13px;
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  color: #c4d3e0;
  background: rgba(5, 13, 23, .82);
  backdrop-filter: blur(12px);
  font-size: .64rem;
}
.legend-swatch { display: inline-block; width: 17px; height: 7px; margin-right: 6px; border-radius: 4px; }
.legend-swatch--mission { background: var(--blue); }
.legend-swatch--airspace { background: var(--orange); }
.legend-swatch--notam { background: var(--red); }
.map-feature-panel { min-height: 100px; padding: 17px 20px; border-top: 1px solid var(--line); }
.map-feature-panel__empty { color: var(--muted); font-size: .79rem; }
.feature-detail { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(110px, .45fr)); gap: 14px; align-items: start; }
.feature-detail h3 { margin: 4px 0 7px; }
.feature-detail p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.48; }
.feature-fact { padding-left: 13px; border-left: 1px solid var(--line); }
.feature-fact span { display: block; color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .08em; }
.feature-fact strong { display: block; margin-top: 6px; font-size: .78rem; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { color: var(--text) !important; background: #0b192a !important; border-color: var(--line) !important; }
.leaflet-control-attribution { color: #8194a8 !important; background: rgba(5,12,21,.75) !important; }
.leaflet-control-attribution a { color: var(--blue-2) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { color: var(--text); background: #0b192a; }
.leaflet-popup-content { margin: 12px 14px; }
.wind-marker {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(34,211,238,.5);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(5,18,28,.82);
  box-shadow: 0 7px 20px rgba(0,0,0,.28);
  font-size: .61rem;
  font-weight: 800;
}
.wind-marker i { display: block; font-style: normal; transform-origin: center; font-size: 1.1rem; }

.weather-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; }
.metric-card { min-height: 128px; padding: 17px; border-radius: 15px; }
.metric-card > span { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; }
.metric-card strong { display: block; margin-top: 17px; font-size: 1.45rem; line-height: 1; }
.metric-card small { display: block; margin-top: 10px; color: var(--muted); font-size: .68rem; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.chart-card { padding: 21px; }
.chart-unit { color: var(--muted); font-size: .7rem; }
.svg-chart { min-height: 250px; overflow: hidden; }
.svg-chart svg { width: 100%; height: 250px; overflow: visible; }
.chart-axis { stroke: rgba(144,184,222,.13); stroke-width: 1; }
.chart-label { fill: #7890a7; font-size: 10px; }
.chart-line-main { fill: none; stroke: #42a4ff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-line-secondary { fill: none; stroke: #ff9a4d; stroke-width: 2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-line-thermal { fill: none; stroke: #ff7289; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-line-kp { fill: none; stroke: #aa8dff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-line-kp-forecast { fill: none; stroke: #d7c8ff; stroke-width: 2.2; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#areaGradient); opacity: .32; }
.chart-dot { fill: #dff4ff; stroke: #42a4ff; stroke-width: 2; }
.forecast-table-card { margin-top: 12px; padding: 21px; }
.table-scroll { overflow-x: auto; }
.forecast-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.forecast-table th, .forecast-table td { padding: 12px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: .72rem; }
.forecast-table th { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; }
.forecast-table tr.is-selected { background: rgba(47,149,255,.07); box-shadow: inset 3px 0 var(--blue); }
.forecast-table tr:hover { background: rgba(255,255,255,.025); }
.table-risk { display: inline-flex; min-width: 46px; justify-content: center; padding: 4px 6px; border-radius: 999px; font-size: .61rem; font-weight: 800; }
.table-risk.risk-ok { color: var(--green); background: rgba(52,211,153,.1); }
.table-risk.risk-warn { color: var(--yellow); background: rgba(245,200,76,.1); }
.table-risk.risk-bad { color: var(--red); background: rgba(255,93,104,.1); }
.method-card { display: flex; align-items: flex-start; gap: 16px; margin-top: 12px; padding: 20px; }
.method-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; color: #ffd9e1; background: rgba(255,93,104,.15); font-weight: 900; }
.method-card h3 { margin: 1px 0 8px; font-size: .92rem; }
.method-card p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }

.space-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; }
.kp-card, .space-alerts { padding: 22px; }
.source-time { color: var(--muted); font-size: .68rem; }
.kp-display { display: flex; align-items: center; gap: 34px; min-height: 260px; }
.kp-gauge {
  --kp-angle: 0deg;
  position: relative;
  width: 205px;
  height: 205px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(from -135deg, var(--kp-color) var(--kp-angle), rgba(255,255,255,.06) 0 270deg, transparent 270deg);
  transform: rotate(135deg);
}
.kp-gauge::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #091625;
  box-shadow: inset 0 0 0 1px var(--line);
}
.kp-gauge::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.09);
}
.kp-gauge__center {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  transform: rotate(-135deg);
}
.kp-gauge__center strong { font-size: 3.2rem; line-height: 1; }
.kp-gauge__center span { margin-top: 5px; color: var(--muted); font-size: .75rem; }
.kp-explanation h3 { margin: 0 0 9px; }
.kp-explanation p { max-width: 590px; margin: 0; color: var(--muted); line-height: 1.56; font-size: .8rem; }
.kp-bands { display: flex; justify-content: space-between; margin-top: 25px; padding-top: 10px; border-top: 5px solid; border-image: linear-gradient(90deg, var(--green), var(--yellow), var(--orange), var(--red), #d946ef) 1; color: var(--muted); font-size: .66rem; }
.space-alerts-list { display: grid; gap: 9px; max-height: 310px; overflow: auto; }
.space-alert { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.space-alert strong { display: block; font-size: .77rem; }
.space-alert p { margin: 6px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.space-alert time { display: block; margin-top: 8px; color: var(--muted-2); font-size: .6rem; }
.empty-state { padding: 22px 8px; color: var(--muted); text-align: center; font-size: .76rem; }
.gnss-check-card { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center; margin-top: 12px; padding: 22px; }
.gnss-check-copy h2 { margin: 7px 0 8px; font-size: 1.05rem; }
.gnss-check-copy p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .76rem; }
.checklist { display: grid; gap: 10px; }
.checklist label, .watch-toggle { display: flex; align-items: center; gap: 9px; color: #c7d7e5; font-size: .76rem; cursor: pointer; }
.checklist input, .watch-toggle input { width: 17px; min-height: 17px; accent-color: var(--blue); }

.missions-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 12px; }
.mission-editor, .missions-list-card { padding: 22px; }
.mission-editor .field-label { margin-top: 15px; }
.watch-toggle { margin: 17px 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.missions-list { display: grid; gap: 9px; }
.mission-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.022);
}
.mission-item:hover { border-color: var(--line-strong); }
.mission-item h3 { margin: 0; font-size: .84rem; }
.mission-item p { margin: 6px 0 0; color: var(--muted); font-size: .69rem; }
.mission-item__meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; color: var(--muted-2); font-size: .61rem; }
.mission-item__actions { display: flex; align-items: center; gap: 6px; }
.mission-action { min-height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: .66rem; }
.mission-action:hover { color: #fff; background: var(--surface-hover); }
.mission-action--delete:hover { color: var(--red); border-color: rgba(255,93,104,.35); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-card { padding: 22px; }
.settings-note { margin: 0 0 18px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.settings-fields { display: grid; gap: 10px; margin-bottom: 18px; }
.settings-fields label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: #c8d8e5;
  font-size: .75rem;
}
.settings-fields label span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.settings-fields input { width: 88px; min-height: 36px; text-align: right; }
.source-status-list { display: grid; gap: 9px; margin-bottom: 16px; }
.source-status {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.source-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.source-status.is-ok .source-status__dot { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.45); }
.source-status.is-warn .source-status__dot { background: var(--yellow); }
.source-status.is-bad .source-status__dot { background: var(--red); }
.source-status strong { display: block; font-size: .74rem; }
.source-status small { display: block; margin-top: 3px; color: var(--muted); font-size: .62rem; }
.source-status time { color: var(--muted-2); font-size: .61rem; }
.file-drop {
  display: grid;
  place-items: center;
  min-height: 95px;
  margin: 14px 0 10px;
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.018);
  cursor: pointer;
  text-align: center;
  font-size: .75rem;
}
.file-drop:hover { border-color: var(--blue); color: var(--text); }
.file-drop input { display: none; }

.app-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  width: min(1560px, calc(100% - 38px));
  margin: 0 auto;
  padding: 18px 0 calc(25px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: .65rem;
}

.app-footer a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(142,165,186,.45); }
.app-footer a:hover { color: var(--text); }
.data-attribution { margin-left: auto; }

.toast-root {
  position: fixed;
  z-index: 4000;
  right: max(18px, var(--safe-right));
  bottom: max(18px, var(--safe-bottom));
  display: grid;
  gap: 9px;
  width: min(370px, calc(100vw - 36px));
}
.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #eaf5ff;
  background: rgba(10,24,40,.96);
  box-shadow: var(--shadow);
  font-size: .77rem;
  animation: toastIn .2s ease;
}
.toast.is-error { border-color: rgba(255,93,104,.45); }
.toast.is-success { border-color: rgba(52,211,153,.42); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }


/* Mappa operativa v1.2 — fasce verticali, selezione e dettaglio leggibile */
.map-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(47,149,255,.045);
}
.map-status-strip strong { display: block; margin-top: 4px; font-size: .82rem; }
.map-status-strip > span { flex: 0 0 auto; color: var(--muted); font-size: .68rem; text-align: right; }
.map-legend--bands { min-width: 190px; }
.map-legend--bands > strong { margin-bottom: 2px; color: #fff; font-size: .64rem; letter-spacing: .08em; }
.map-legend--bands small { max-width: 180px; margin-top: 2px; color: #8da2b8; line-height: 1.35; }
.legend-swatch--prohibited { background: #ff4968; }
.legend-swatch--auth-ground { background: #ff6b35; }
.legend-swatch--25 { background: #d68a32; }
.legend-swatch--45 { background: #f3c94d; }
.legend-swatch--60 { background: #26d3df; }
.tfo-map-tooltip { border: 1px solid rgba(255,255,255,.18) !important; color: #edf7ff !important; background: rgba(5,15,27,.94) !important; box-shadow: 0 12px 30px rgba(0,0,0,.38) !important; }
.tfo-map-tooltip::before { border-top-color: rgba(5,15,27,.94) !important; }
.tfo-map-tooltip span { color: #a9bed2; font-size: .68rem; }

.map-inspector { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); min-height: 330px; border-top: 1px solid var(--line); }
.map-zone-browser { min-width: 0; border-right: 1px solid var(--line); background: rgba(5,14,24,.36); }
.map-zone-browser__heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.map-zone-browser__heading strong { display: block; margin-top: 4px; font-size: .79rem; }
.map-zone-list { max-height: 580px; overflow: auto; padding: 10px; scrollbar-width: thin; }
.map-zone-list__empty { padding: 18px 12px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.map-zone-group { margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.map-zone-group:last-child { margin-bottom: 0; }
.map-zone-group__main { display: grid; grid-template-columns: 11px 1fr; gap: 11px; width: 100%; padding: 12px 12px 9px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.map-zone-group__main:hover { background: rgba(255,255,255,.035); }
.map-zone-group__main strong { display: block; overflow: hidden; color: #edf7ff; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.map-zone-group__main small { display: block; margin-top: 5px; color: var(--muted); font-size: .62rem; line-height: 1.35; }
.map-zone-group__dot { width: 9px; height: 9px; margin-top: 3px; border: 2px solid color-mix(in srgb, var(--zone-color) 78%, white); border-radius: 50%; background: var(--zone-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--zone-color) 15%, transparent); }
.zone-band-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 11px 34px; }
.zone-band-button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--zone-color) 50%, transparent); border-radius: 999px; color: #dcecff; background: color-mix(in srgb, var(--zone-color) 10%, transparent); font-size: .62rem; font-weight: 800; cursor: pointer; }
.zone-band-button:hover, .zone-band-button:focus-visible { border-color: var(--zone-color); background: color-mix(in srgb, var(--zone-color) 19%, transparent); }
.zone-band-button i { width: 7px; height: 7px; border-radius: 50%; background: var(--zone-color); }
.zone-band-button--notam { --zone-color: #ff4d68; }

.map-detail-column { min-width: 0; }
.map-point-results { padding: 14px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); }
.point-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.point-result-heading strong { display: block; margin-top: 4px; font-size: .78rem; }
.point-result-heading small { color: var(--muted); font-size: .64rem; }
.point-result-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.point-result-button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.02); font-size: .65rem; cursor: pointer; }
.point-result-button i { width: 8px; height: 8px; border-radius: 50%; background: var(--zone-color); }
.point-result-button:hover, .point-result-button.is-active { color: #fff; border-color: color-mix(in srgb, var(--zone-color) 62%, transparent); background: color-mix(in srgb, var(--zone-color) 12%, transparent); }

.map-feature-panel { min-height: 270px; padding: 0; border-top: 0; }
.map-feature-panel__empty--rich { display: grid; gap: 8px; min-height: 270px; align-content: center; padding: 30px; }
.map-feature-panel__empty--rich strong { color: #dcecff; font-size: .92rem; }
.map-feature-panel__empty--rich span { max-width: 750px; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.airspace-detail { --zone-color: var(--orange); padding: 19px; }
.airspace-detail__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.airspace-detail__identity { display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 12px; min-width: 0; }
.airspace-detail__color { width: 11px; min-height: 58px; border-radius: 999px; background: var(--zone-color); box-shadow: 0 0 0 5px color-mix(in srgb, var(--zone-color) 13%, transparent); }
.airspace-detail__identity h3 { margin: 5px 0 5px; font-size: 1.08rem; line-height: 1.2; }
.airspace-detail__identity p { margin: 0; color: var(--muted); font-size: .7rem; }
.airspace-detail__actions { flex: 0 0 auto; }
.button--compact { min-height: 34px; padding: 0 11px; font-size: .65rem; }
.impact-box { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(250px, 1fr); gap: 16px 22px; margin-top: 17px; padding: 15px 16px; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 13px; background: rgba(255,255,255,.02); }
.impact-box > div span { display: block; color: var(--muted); font-size: .61rem; font-weight: 800; letter-spacing: .08em; }
.impact-box > div strong { display: block; margin-top: 7px; font-size: .9rem; }
.impact-box p { margin: 0; color: #c2d2df; font-size: .72rem; line-height: 1.52; }
.impact-box__action { grid-column: 2; padding-top: 10px; border-top: 1px solid var(--line); color: #eef7ff !important; font-weight: 650; }
.impact-box--bad { border-color: rgba(255,73,104,.28); border-left-color: #ff4968; background: rgba(255,73,104,.055); }
.impact-box--warn { border-color: rgba(255,107,53,.30); border-left-color: #ff6b35; background: rgba(255,107,53,.055); }
.impact-box--ok { border-color: rgba(67,209,124,.25); border-left-color: #43d17c; background: rgba(67,209,124,.045); }
.impact-box--neutral { border-left-color: #71869b; }
.airspace-facts-grid { display: grid; grid-template-columns: repeat(5, minmax(125px, 1fr)); gap: 0; margin-top: 17px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.airspace-facts-grid .feature-fact { min-height: 91px; padding: 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.012); }
.airspace-facts-grid .feature-fact:nth-child(5n) { border-right: 0; }
.airspace-facts-grid .feature-fact:nth-last-child(-n+5) { border-bottom: 0; }
.feature-fact strong small { display: block; margin-top: 6px; color: var(--muted); font-size: .59rem; font-weight: 500; line-height: 1.35; }
.feature-notam-reference, .source-contact-card { margin-top: 14px; padding: 13px 15px; border: 1px solid rgba(255,77,104,.26); border-radius: 12px; background: rgba(255,77,104,.045); }
.feature-notam-reference strong, .source-contact-card > span { display: block; color: #ff9aaa; font-size: .66rem; letter-spacing: .06em; }
.feature-notam-reference span { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
.source-contact-card { border-color: var(--line); background: rgba(255,255,255,.018); }
.source-contact-card > span { color: var(--muted); }
.source-contact-card strong { display: block; margin-top: 7px; font-size: .76rem; }
.source-contact-card p { margin: 6px 0 0; color: #bcd0df; font-size: .68rem; line-height: 1.45; }
.source-text-card { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.11); }
.source-text-card summary { padding: 12px 14px; color: #e5f2ff; font-size: .71rem; font-weight: 800; cursor: pointer; }
.source-text-card > div { max-height: 260px; overflow: auto; padding: 13px 14px; border-top: 1px solid var(--line); color: #afc2d2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .66rem; line-height: 1.55; white-space: normal; }
.map-legal-note { margin: 13px 0 0; color: #8297aa; font-size: .62rem; line-height: 1.5; }

@media (max-width: 1180px) {
  .mission-toolbar { grid-template-columns: 1.4fr .55fr .5fr; }
  .toolbar-field--profile { grid-column: span 3; }
  .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weather-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overall-card { min-height: 270px; }
}

@media (max-width: 900px) {
  .map-inspector { grid-template-columns: 1fr; }
  .map-zone-browser { border-right: 0; border-bottom: 1px solid var(--line); }
  .map-zone-list { max-height: 330px; }
  .airspace-facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .airspace-facts-grid .feature-fact, .airspace-facts-grid .feature-fact:nth-child(5n), .airspace-facts-grid .feature-fact:nth-last-child(-n+5) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .airspace-facts-grid .feature-fact:nth-child(2n) { border-right: 0; }
  .airspace-facts-grid .feature-fact:nth-last-child(-n+2) { border-bottom: 0; }
  .impact-box { grid-template-columns: 1fr; }
  .impact-box__action { grid-column: 1; }
  .workspace { width: min(100% - 24px, 1560px); }
  .topbar { padding-left: 15px; padding-right: 15px; }
  .brand-subtitle { display: none; }
  .sync-indicator span:last-child { display: none; }
  .sync-indicator { min-width: 38px; justify-content: center; padding: 0; }
  .mission-toolbar { grid-template-columns: 1fr 1fr; }
  .search-block, .toolbar-field--profile { grid-column: 1 / -1; }
  .toolbar-field--profile { grid-column: 1 / -1; }
  .app-tabs { top: calc(68px + var(--safe-top)); }
  .dashboard-grid, .space-grid, .missions-layout { grid-template-columns: 1fr; }
  .overall-card { min-height: 230px; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-grid, .chart-grid, .settings-grid { grid-template-columns: 1fr; }
  .kp-display { gap: 22px; }
  .gnss-check-card { grid-template-columns: 1fr; }
  .feature-detail { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .map-status-strip { align-items: flex-start; flex-direction: column; }
  .map-status-strip > span { text-align: left; }
  .airspace-detail { padding: 15px; }
  .airspace-detail__header { flex-direction: column; }
  .airspace-detail__actions, .airspace-detail__actions .button { width: 100%; }
  .airspace-facts-grid { grid-template-columns: 1fr; }
  .airspace-facts-grid .feature-fact, .airspace-facts-grid .feature-fact:nth-child(2n), .airspace-facts-grid .feature-fact:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .airspace-facts-grid .feature-fact:last-child { border-bottom: 0; }
  .point-result-heading { align-items: flex-start; flex-direction: column; }
  .topbar { min-height: calc(64px + var(--safe-top)); }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: .78rem; }
  .workspace { width: min(100% - 16px, 1560px); padding-top: 10px; }
  .mission-toolbar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row .button { width: 100%; }
  .selected-location { flex-wrap: wrap; }
  .app-tabs { top: calc(64px + var(--safe-top)); margin: 10px 0; }
  .tab-button { min-height: 36px; padding: 0 13px; }
  .overall-card { display: grid; min-height: auto; padding: 22px; }
  .overall-gauge { width: 128px; height: 128px; margin: 24px 0 0; }
  .overall-gauge strong { font-size: 2rem; }
  .status-grid { grid-template-columns: 1fr; }
  .status-card { min-height: 150px; }
  .weather-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 116px; }
  .timeline-panel, .insight-card, .chart-card, .forecast-table-card, .kp-card, .space-alerts, .gnss-check-card, .mission-editor, .missions-list-card, .settings-card { padding: 17px; }
  .timeline-legend { display: none; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  #map { height: 62vh; min-height: 430px; }
  .map-hint { top: 8px; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .map-legend { display: none; }
  .feature-detail { grid-template-columns: 1fr; }
  .feature-fact { padding: 9px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .kp-display { flex-direction: column; align-items: flex-start; }
  .kp-gauge { align-self: center; width: 180px; height: 180px; }
  .kp-gauge__center strong { font-size: 2.8rem; }
  .mission-item { grid-template-columns: 1fr; }
  .mission-item__actions { justify-content: flex-end; }
  .app-footer { width: calc(100% - 24px); flex-direction: column; }
  .pin-row { grid-template-columns: 1fr; }
  .login-card { padding: 25px 20px; }
  .brand-lockup--large .brand-subtitle { display: block; white-space: normal; }
}

@media print {
  :root { color-scheme: light; }
  body { color: #0a1727; background: #fff; }
  body::before, .topbar-actions, .mission-toolbar, .app-tabs, .map-hint, .app-footer, .button-row, .offline-banner { display: none !important; }
  .topbar { position: static; color: #0a1727; background: #fff; border-bottom: 1px solid #ddd; }
  .workspace { width: 100%; padding: 10px; }
  .tab-panel { display: none !important; }
  #tab-dashboard { display: block !important; }
  .glass-panel { color: #0a1727; background: #fff; border: 1px solid #d9e0e7; box-shadow: none; }
  .status-card__detail, .overall-copy p, .overall-meta, .insight-copy, .slider-label-row, .slider-scale { color: #4c5d6d; }
  .overall-gauge::before { background: #fff; }
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .timeline-panel { page-break-inside: avoid; }
}

/* v1.1.0 — spiegazione trasparente dell'indice */
.score-breakdown-card {
  grid-column: 1 / -1;
  padding: 21px;
  border-radius: var(--radius-lg);
}
.score-breakdown-list {
  display: grid;
  gap: 8px;
}
.score-breakdown-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.25fr) 78px 68px 92px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  font-size: .76rem;
}
.score-breakdown-row > span:first-child { color: #dceaff; font-weight: 760; }
.score-breakdown-row small { color: var(--muted); }
.score-breakdown-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.score-breakdown-row--total {
  margin-top: 4px;
  border-color: rgba(47,149,255,.25);
  background: rgba(47,149,255,.065);
}
.score-breakdown-head {
  color: var(--muted-2);
  background: transparent;
  border-color: transparent;
  min-height: 28px;
  padding-top: 0;
  padding-bottom: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .62rem;
}
@media (max-width: 720px) {
  .score-breakdown-row { grid-template-columns: 1fr 64px 76px; }
  .score-breakdown-row > small:nth-child(3), .score-breakdown-head > small:nth-child(3) { display: none; }
}
@media print {
  .score-breakdown-card { page-break-inside: avoid; }
  .score-breakdown-row { border-color: #d9e0e7; background: #fff; }
}

/* v1.3.0 — sfondo OSM senza chiave e diagnostica rendering */
#map { background: #26313b; }
.leaflet-tile-pane { filter: saturate(.62) brightness(.68) contrast(1.12); }
.map-zone-list__empty--error { color: #ffd3d8; border: 1px solid rgba(255,77,104,.34); border-radius: 11px; background: rgba(255,77,104,.08); }

/* THERA dossier / v1.3.0 */
.dossier-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.dossier-heading h2{font-size:2rem;margin:.4rem 0}.dossier-heading img{width:90px;height:90px;object-fit:contain;background:white;border-radius:14px;padding:5px}.dossier-notice{padding:18px;border-left:3px solid #ff7800;background:#ff780010;line-height:1.6}.dossier-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}.dossier-box{padding:26px;margin-bottom:20px}.dossier-box p{color:var(--muted);line-height:1.6}.dossier-box small{display:block;line-height:1.5;color:var(--muted);margin:12px 0;overflow-wrap:anywhere}.dossier-check{display:flex;gap:10px;margin:18px 0;line-height:1.5}.dossier-check input,.dossier-file input{width:auto;accent-color:#ff7800}.dossier-box .button-row{flex-wrap:wrap;margin:18px 0}.dossier-file{padding:16px;border:1px solid #ffffff20;border-radius:12px;margin:14px 0}.dossier-file label{display:flex;gap:10px;align-items:center;overflow-wrap:anywhere}.dossier-file .badge{font-size:12px;color:#ffac67;display:block;margin:10px 0}.dossier-file a{color:#70bdff}.track-canvas-wrap{height:480px;max-height:70vh;overflow:hidden;border-radius:14px;background:#e9edf0}#trackCanvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}.dossier-report-link{display:flex;justify-content:space-between;gap:15px;padding:17px;border-bottom:1px solid #ffffff20;color:var(--text);text-decoration:none}.dossier-report-link span{color:var(--muted)}.dossier-message{padding:15px;color:#79d9a0}.dossier-message.is-error{color:#ffa26b}.dossier-files{max-height:500px;overflow:auto}.tab-button{white-space:nowrap}@media(max-width:850px){.dossier-grid{grid-template-columns:1fr}.dossier-box{padding:18px}.dossier-report-link{flex-direction:column}.track-canvas-wrap{height:400px}}@media print{body>*{display:none!important}body::after{content:"Genera il PDF dalla scheda Dossier e tracciati. La stampa della dashboard non è il documento da inviare.";display:block;color:#000;font:14pt sans-serif}}

/* THERA Thermal 0.3: explicit arithmetic and zero-point context, mobile safe. */
.thermal-method-meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:.8rem;color:var(--muted)}
.thermal-formula-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0}
.thermal-formula-cards>div{padding:18px;border:1px solid var(--border,rgba(255,255,255,.12));border-radius:14px;background:rgba(255,255,255,.03)}
.thermal-formula-cards>div>span{display:block;font-size:.84rem;color:var(--muted)}
.thermal-formula-cards strong{display:block;font-size:1.7rem;margin:10px 0;line-height:1.25}
.thermal-formula-cards strong small{display:inline;font-size:.85rem;margin-left:5px}.thermal-formula-cards small{margin:5px 0}
.thermal-formula-result{border-color:rgba(255,120,0,.45)!important}.thermal-formula-result strong{color:#ffae61}
.thermal-arithmetic{font-variant-numeric:tabular-nums;font-weight:650;color:var(--text)!important}
.thermal-warnings{border-left:3px solid #ff9f43;background:rgba(255,120,0,.07);padding:16px 20px;margin:20px 0;border-radius:0 10px 10px 0}
.thermal-warnings p{margin:.7em 0 0;font-size:.91rem}.thermal-missing{color:#ffbb80!important}
.thermal-factor-row{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(0,1fr) 60px;gap:18px;padding:15px 0;border-bottom:1px solid rgba(255,255,255,.09);align-items:start;overflow-wrap:anywhere}
.thermal-factor-row strong{font-size:.9rem}.thermal-factor-row div small{margin:6px 0 0;line-height:1.45}.thermal-factor-row>span{font-size:.88rem;color:var(--muted);line-height:1.55}.thermal-factor-row>b{text-align:right;color:#ffae61;font-variant-numeric:tabular-nums}.thermal-factor-row>b small{font-size:.7rem;margin:2px 0}
.thermal-context{margin:22px 0;padding:16px 0;border-top:1px solid rgba(255,255,255,.12)}.thermal-context summary{cursor:pointer;font-weight:650;line-height:1.5}.thermal-context[open] summary{margin-bottom:14px}
.thermal-curve{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.thermal-curve>div{padding:12px 5px;border-radius:9px;background:rgba(255,255,255,.04);text-align:center}.thermal-curve strong,.thermal-curve span{display:block}.thermal-curve span{margin-top:8px;font-size:.85rem;color:var(--muted)}
.thermal-limit-note{font-size:.84rem;line-height:1.65!important;border-top:1px solid rgba(255,255,255,.12);padding-top:16px}
@media(max-width:640px){.thermal-formula-cards{grid-template-columns:1fr}.thermal-formula-cards>div{padding:14px}.thermal-factor-row{grid-template-columns:minmax(0,1fr) 50px;gap:8px}.thermal-factor-row>div{grid-column:1}.thermal-factor-row>span{grid-column:1;grid-row:2}.thermal-factor-row>b{grid-column:2;grid-row:1/span 2}.thermal-curve{grid-template-columns:repeat(3,minmax(0,1fr))}}
