:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #edf2f5;
  --text: #17212b;
  --muted: #66717c;
  --border: #d7dfe5;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --green: #2f7d5a;
  --cyan: #168f9b;
  --blue: #246bce;
  --red: #c93b3b;
  --yellow: #b88900;
  --tap: 48px;
}
body.night {
  color-scheme: dark;
  --bg: #101820;
  --panel: #19232e;
  --panel-soft: #202c38;
  --text: #f4f7f9;
  --muted: #aab4be;
  --border: #2d3945;
  --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { min-height: var(--tap); }
#app {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
}
h1, h2 { margin: 0; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.35rem; }
.header-actions { display: flex; gap: 8px; }
.button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--blue);
  color: white;
  font-weight: 700;
}
.button.secondary {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}
.primary-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 6px;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }
.nav-button {
  white-space: nowrap;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  font-weight: 700;
}
.nav-button.active {
  color: #fff;
  border-color: transparent;
  background: var(--section-color, var(--blue));
}
.search-panel {
  margin: 14px 0 18px;
}
.search-panel label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .9rem;
}
.search-panel input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--panel);
  color: var(--text);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.card {
  min-height: 126px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.card:active { transform: scale(.995); }
.card-accent {
  width: 100%;
  height: 5px;
  margin-bottom: 14px;
  border-radius: 99px;
  background: var(--card-color, var(--blue));
}
.card h3 { margin: 0; font-size: 1rem; }
.card p { margin: 7px 0 0; color: var(--muted); line-height: 1.35; }
.card .open {
  margin-top: 14px;
  color: var(--card-color, var(--blue));
  font-weight: 700;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.muted { color: var(--muted); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: .78rem;
  font-weight: 700;
}
.back-button { margin-bottom: 12px; }
.topic-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: var(--panel);
}
.topic-accent {
  height: 5px;
  margin-bottom: 18px;
  border-radius: 99px;
  background: var(--blue);
}
.topic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.topic-content { margin-top: 22px; }
.content-block {
  margin: 0 0 14px;
  line-height: 1.45;
}
.note, .warning {
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
}
.warning { border-left-color: var(--red); }
.check-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.check-row:last-child { border-bottom: 0; }
.switch {
  position: relative;
  width: 54px;
  height: 32px;
}
.switch input {
  position: absolute;
  opacity: 0;
}
.switch-track {
  display: block;
  width: 54px;
  height: 32px;
  border-radius: 99px;
  background: var(--border);
  transition: .18s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: .18s ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.check-complete { text-decoration: line-through; color: var(--muted); }
.source-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}
.status { margin: 16px 2px 0; color: var(--muted); font-size: .85rem; }
.empty {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 680px) {
  .app-header { align-items: stretch; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .topic-header { flex-direction: column; }
}



/* SmartPilot v0.3 — iPad-first interface */
:root {
  --content-max: 1180px;
  --orange: #d87816;
}
html, body {
  min-height: 100%;
  overscroll-behavior-y: none;
}
body { -webkit-touch-callout: none; }
button, input, select { touch-action: manipulation; }
#app {
  width: min(100%, var(--content-max));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.primary-nav {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 20;
  margin: 8px -6px 0;
  padding: 9px 6px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-button {
  min-height: 50px;
  padding-inline: 17px;
  font-size: 1rem;
}
.card {
  min-height: 145px;
  padding: 20px;
}
.card h3 { font-size: 1.08rem; }
.card p { font-size: .97rem; }
.topic-panel { padding: 24px; }
.check-row { min-height: 68px; }
.switch, .switch-track { width: 64px; height: 38px; }
.switch-track::after { width: 30px; height: 30px; }
.switch input:checked + .switch-track::after { transform: translateX(26px); }

/* Single-line operations strip */
.ops-strip {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 68px);
  z-index: 19;
  display: grid;
  grid-template-columns: minmax(86px, .85fr) minmax(112px, .95fr) repeat(3, minmax(118px, 1fr)) 48px;
  align-items: stretch;
  gap: 7px;
  margin: 8px 0 14px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.ops-flight,
.ops-utc,
.ops-bar,
.ops-settings {
  min-width: 0;
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}
.ops-flight,
.ops-settings {
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 800;
}
.ops-flight {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-utc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--panel-soft);
  font-weight: 800;
}
.ops-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}
.ops-key {
  flex: 0 0 auto;
  font-size: .72rem;
  letter-spacing: .06em;
  opacity: .9;
}
.ops-countdown {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}
.state-neutral { background: #65717b; }
.state-green { background: var(--green); }
.state-orange { background: var(--orange); }
.state-red { background: var(--red); }
.ops-settings {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.15rem;
}

/* Settings sheet */
.settings-dialog {
  width: min(94vw, 850px);
  max-height: min(92vh, 860px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
}
.settings-dialog::backdrop {
  background: rgba(0, 0, 0, .48);
  backdrop-filter: blur(4px);
}
.settings-sheet {
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 22px;
}
.settings-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.icon-button {
  width: 46px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 1.5rem;
}
.settings-section {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}
.settings-section h3 {
  margin: 0 0 12px;
}
.settings-section label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}
.settings-section input,
.settings-section select {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel-soft);
}
.settings-grid {
  display: grid;
  gap: 12px;
}
.settings-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}
.settings-actions.end { justify-content: flex-end; }
.file-import-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 12px;
}
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.danger { background: var(--red); }

@media (orientation: landscape) and (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .ops-strip {
    grid-template-columns: minmax(82px, .8fr) minmax(102px, .9fr) repeat(3, minmax(104px, 1fr)) 44px;
    gap: 5px;
    padding: 5px;
  }
  .ops-flight, .ops-utc, .ops-bar, .ops-settings {
    min-height: 42px;
    padding: 7px 8px;
  }
  .ops-countdown { font-size: .9rem; }
  .settings-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .ops-strip {
    position: static;
    grid-template-columns: repeat(3, 1fr);
  }
  .ops-flight { grid-column: span 1; }
  .ops-utc { grid-column: span 1; }
  .ops-settings { grid-column: span 1; }
  .ops-bar { min-height: 46px; }
  .settings-grid.two { grid-template-columns: 1fr; }
}


/* v0.3.2 compact controls */
.icon-toolbar {
  display: flex;
  gap: 7px;
}
.toolbar-button {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--panel);
}
.toolbar-button svg,
.search-field svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toolbar-button:active { background: var(--panel-soft); }

.ops-strip.compact {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 64px);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 0;
  padding: 4px;
  margin: 6px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ops-strip.compact::-webkit-scrollbar { display: none; }
.ops-strip.compact .ops-flight,
.ops-strip.compact .ops-utc,
.ops-strip.compact .ops-bar {
  flex: 1 1 auto;
  min-width: max-content;
  min-height: 30px;
  height: 30px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: .82rem;
}
.ops-strip.compact .ops-flight:empty,
.ops-strip.compact .ops-flight[hidden] { display: none; }
.ops-strip.compact .ops-key { font-size: .64rem; }
.ops-strip.compact .ops-countdown { font-size: .82rem; }

.times-page-heading,
.search-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.times-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.times-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 17px;
  background: var(--panel);
}
.times-card.wide { grid-column: 1 / -1; }
.times-card h3 { margin: 0 0 12px; }
.times-card label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}
.times-card input,
.times-card select {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--panel-soft);
}
.time-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.time-entry {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  background: var(--panel-soft);
}
.time-entry .time-main-label { margin-top: 0; color: var(--text); }
.display-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
}
.display-toggle input {
  width: 20px !important;
  min-height: 20px !important;
  margin: 0 !important;
}
.calculation-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px;
  background: var(--panel-soft);
}
.calculation-result span,
.ttot-summary span { color: var(--muted); font-size: .8rem; }
.calculation-result strong,
.ttot-summary strong { margin-top: 4px; font-variant-numeric: tabular-nums; }
.ttot-summary {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
  border-top: 1px solid var(--border);
  padding-top: 13px;
}
.ttot-summary > div { display: flex; flex-direction: column; }
.times-actions { margin-top: 14px; }

.search-dialog {
  width: min(92vw, 720px);
  max-height: 78vh;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
}
.search-dialog::backdrop { background: rgba(0,0,0,.42); backdrop-filter: blur(3px); }
.search-sheet { padding: 14px; }
.search-field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--panel-soft);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.search-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 58vh;
  overflow: auto;
}
.search-result-button {
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  text-align: left;
  color: var(--text);
  background: var(--panel);
}
.search-result-button strong,
.search-result-button span { display: block; }
.search-result-button span { margin-top: 3px; color: var(--muted); font-size: .82rem; }

@media (max-width: 850px) {
  .time-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .times-layout { grid-template-columns: 1fr; }
  .times-card.wide { grid-column: auto; }
  .time-entry-grid { grid-template-columns: 1fr; }
  .ttot-summary { grid-template-columns: 1fr; }
  .ops-strip.compact { position: static; }
}

#ops-strip [hidden] { display: none !important; }

/* v0.3.2.2 compact operations fields */
.ops-strip.compact { justify-content: flex-start; }

.ops-strip.compact .ops-flight,
.ops-strip.compact .ops-utc,
.ops-strip.compact .ops-bar {
  flex: 0 0 auto;
}

.ops-strip.compact .ops-flight {
  min-width: 78px;
  max-width: 110px;
  width: auto;
}

.ops-strip.compact .ops-utc {
  width: 142px;
}

.ops-strip.compact .ops-bar {
  width: 128px;
  justify-content: space-between;
}

.ops-strip.compact .ops-countdown {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 850px) {
  .ops-strip.compact .ops-flight {
    min-width: 72px;
    max-width: 96px;
  }
  .ops-strip.compact .ops-utc {
    width: 132px;
  }
  .ops-strip.compact .ops-bar {
    width: 118px;
  }
}


/* v0.3.2.3 — operations first, no title block */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.compact-header {
  justify-content: flex-end;
  min-height: 40px;
  margin-top: 6px;
}

.ops-strip.compact {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 30;
  margin-top: 0;
  margin-bottom: 7px;
}

.primary-nav {
  top: calc(env(safe-area-inset-top) + 38px);
  margin-top: 4px;
}

@media (max-width: 680px) {
  .compact-header {
    flex-direction: row;
    justify-content: flex-end;
  }

  .ops-strip.compact {
    position: sticky;
    top: env(safe-area-inset-top);
  }
}


/* v0.3.3 — Quick Note / Apple Pencil scratchpad */
.quick-note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-note-heading h2 {
  margin: 2px 0 0;
}

.quick-note-layout {
  display: grid;
  gap: 14px;
}

.quick-note-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.quick-note-card textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}

.quick-note-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.note-tool.active {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.note-canvas-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

#quick-note-canvas {
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
}

.quick-note-hint {
  margin: 9px 2px 0;
}

@media (max-width: 680px) {
  .quick-note-heading {
    align-items: flex-start;
  }

  .quick-note-card {
    padding: 12px;
  }
}

/* v0.3.3.1 — explicit Notes pushbutton */
.note-launch-button {
  width: auto !important;
  min-width: 92px;
  padding-inline: 12px !important;
  gap: 7px;
}
.note-launch-button .toolbar-label {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 680px) {
  .note-launch-button {
    min-width: 82px;
    padding-inline: 10px !important;
  }
  .note-launch-button .toolbar-label {
    font-size: 0.82rem;
  }
}


/* v0.3.4 — maximized Quick Note + compact tool popover */
.note-launch-button {
  width: 54px !important;
  min-width: 54px !important;
  padding-inline: 0 !important;
}

.quick-note-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.quick-note-modebar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-note-tools-anchor {
  position: relative;
}

.note-tools-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  width: min(540px, calc(100vw - 52px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
}

.note-tools-popover[hidden] {
  display: none !important;
}

.note-tools-row,
.note-color-row,
.note-size-row,
.note-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.note-tools-section {
  margin-top: 12px;
}

.note-tools-label {
  display: block;
  margin-bottom: 7px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}

.note-color {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(0,0,0,.18);
  border-radius: 50%;
  padding: 0;
}

.note-color.active {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.note-mode.active,
.note-tool.active,
.note-size.active,
.note-input.active {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.quick-note-workarea {
  height: clamp(480px, calc(100vh - 285px), 900px);
  min-height: 480px;
}

#quick-note-text-panel[hidden],
#quick-note-draw-panel[hidden],
#note-tools-button[hidden] {
  display: none !important;
}

#quick-note-text {
  width: 100%;
  height: 100%;
  min-height: 100%;
  resize: none;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 1.08rem;
  padding: 18px;
}

.note-canvas-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

#quick-note-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 680px) {
  .quick-note-workarea {
    height: clamp(430px, calc(100vh - 260px), 760px);
    min-height: 430px;
  }

  .note-tools-popover {
    width: min(500px, calc(100vw - 30px));
  }
}


/* v0.3.4.2 — prevent accidental selection while handwriting */
#quick-note-draw-panel,
#quick-note-draw-panel *,
.note-canvas-wrap,
#quick-note-canvas {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

#quick-note-canvas {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}


/* v0.3.5.1 — ZRH turnaround, based on stable v0.3.4.2 */
.turnaround-card[hidden] {
  display: none !important;
}

.turnaround-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.turnaround-header h3 {
  margin: 2px 0 0;
}

.turnaround-list {
  display: grid;
  gap: 7px;
}

.turnaround-row {
  display: grid;
  grid-template-columns: 86px 58px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.turnaround-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.turnaround-offset {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.turnaround-label {
  font-weight: 650;
}

@media (max-width: 680px) {
  .turnaround-row {
    grid-template-columns: 74px 50px 1fr;
    gap: 7px;
    padding: 8px;
  }
}


/* v0.3.5.2 — hidden calendar feed + turnaround reminders */
.calendar-feed-card[hidden] {
  display: none !important;
}

.turnaround-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.turnaround-popup-toggle {
  margin: 0;
  white-space: nowrap;
}

.turnaround-popup {
  position: fixed;
  right: 22px;
  top: 110px;
  z-index: 1200;
  width: min(410px, calc(100vw - 44px));
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
}

.turnaround-popup[hidden] {
  display: none !important;
}

.turnaround-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.turnaround-popup-head strong {
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.popup-close-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
}

.turnaround-popup-items {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.turnaround-popup-item {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--panel-soft);
  font-weight: 700;
}

@media (max-width: 680px) {
  .turnaround-popup {
    top: 92px;
    right: 14px;
    width: calc(100vw - 28px);
  }
}


/* v0.3.6 — PRE-FLIGHT Fuel Planning */
.fuel-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.fuel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fuel-layout {
  display: grid;
  grid-template-columns: 1.35fr .8fr .85fr;
  gap: 14px;
  align-items: start;
}

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

.fuel-card h3 {
  margin: 0 0 12px;
}

.fuel-grid,
.fuel-time-grid,
.fuel-weight-grid {
  display: grid;
  gap: 9px;
}

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

.fuel-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.fuel-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 9px 10px;
}

.fuel-output {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-soft);
}

.fuel-output span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.fuel-output strong {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.fuel-primary {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--panel));
}

.fuel-total strong,
.fuel-primary strong {
  font-size: 1.25rem;
}

.fuel-source-note {
  margin: 12px 2px 0;
}

@media (max-width: 1000px) {
  .fuel-layout {
    grid-template-columns: 1fr 1fr;
  }

  .fuel-layout .fuel-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .fuel-page-heading {
    flex-direction: column;
  }

  .fuel-layout {
    grid-template-columns: 1fr;
  }

  .fuel-layout .fuel-card:first-child {
    grid-column: auto;
  }

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

/* v0.3.6.1 — cleaner Fuel Planning in tonnes */
.fuel-layout-clean{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.75fr);gap:14px;align-items:start}
.fuel-card-title-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px}
.fuel-card-title-row h3{margin:0}
.fuel-release-inline{display:flex!important;flex-direction:row;align-items:center;gap:8px!important;white-space:nowrap}
.fuel-release-inline input{width:72px!important;text-align:center}
.fuel-list{display:grid;gap:0}
.fuel-entry-row{min-height:58px;display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:14px;padding:8px 0;border-bottom:1px solid var(--border)}
.fuel-entry-row>label,.fuel-entry-row>span:first-child{font-size:.95rem;font-weight:750;color:var(--text)}
.fuel-entry-controls{display:grid;grid-template-columns:minmax(150px,1fr) 94px;gap:12px;align-items:center}
.fuel-entry-controls-wide{grid-template-columns:minmax(140px,1fr) 94px 105px}
.fuel-slider{width:100%;accent-color:var(--blue)}
.fuel-ton-input,.fuel-minute-input{display:flex;align-items:center;gap:5px;min-width:0}
.fuel-ton-input input,.fuel-minute-input input{min-width:0;text-align:right;font-weight:750}
.fuel-ton-input span,.fuel-minute-input span,.fuel-calculated-mini span{color:var(--muted);font-size:.84rem;font-weight:700}
.fuel-calculated-mini{display:grid;grid-template-columns:auto 1fr auto;align-items:baseline;gap:4px;padding:8px;border-radius:10px;background:var(--panel-soft)}
.fuel-calculated-mini strong{text-align:right;font-variant-numeric:tabular-nums}
.fuel-subtotal-row,.fuel-block-row{grid-template-columns:1fr auto auto;gap:7px}
.fuel-subtotal-row{margin-top:4px;padding:11px 10px;border:0;border-radius:11px;background:var(--panel-soft)}
.fuel-block-row{margin-top:5px;padding:13px 12px;border:1px solid var(--blue);border-radius:12px;background:color-mix(in srgb,var(--blue) 12%,var(--panel))}
.fuel-subtotal-row strong,.fuel-block-row strong{font-size:1.25rem;font-variant-numeric:tabular-nums}
.fuel-block-row strong{font-size:1.45rem}
.fuel-weight-result{display:grid;grid-template-columns:1fr auto auto;align-items:baseline;gap:6px;min-height:48px;padding:10px 2px;border-bottom:1px solid var(--border)}
.fuel-weight-result span:first-child{font-weight:700}
.fuel-weight-result strong{font-size:1.16rem;font-variant-numeric:tabular-nums}
.fuel-primary-result{margin-top:5px;padding:11px 10px;border:1px solid var(--blue);border-radius:11px;background:color-mix(in srgb,var(--blue) 10%,var(--panel))}
@media(max-width:950px){.fuel-layout-clean{grid-template-columns:1fr}}
@media(max-width:680px){.fuel-entry-row{grid-template-columns:1fr;gap:7px}.fuel-entry-controls,.fuel-entry-controls-wide{grid-template-columns:minmax(120px,1fr) 88px}.fuel-calculated-mini{grid-column:1/-1}}


/* v0.3.6.2 — contextual sliders + immediate overwrite */
.fuel-slider {
  transition: opacity .15s ease, max-height .15s ease, margin .15s ease;
  max-height: 32px;
  opacity: 1;
}

.fuel-slider-hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.fuel-entry-controls {
  align-items: center;
}

.fuel-ton-input input:focus,
.fuel-minute-input input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.fuel-release-inline {
  position: relative;
}

.fuel-release-button {
  min-width: 58px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.fuel-release-picker {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  width: 230px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.fuel-release-picker[hidden] {
  display: none !important;
}

.fuel-release-slider {
  width: 100%;
  accent-color: var(--blue);
}

.fuel-release-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: .78rem;
}

/* v0.3.6.3 — ZFW alignment + larger Release slider */
.fuel-zfw-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.fuel-zfw-row > label {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}
.fuel-zfw-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.fuel-zfw-input {
  min-width: 112px;
}
.fuel-zfw-input input {
  width: 84px !important;
  text-align: right;
  font-size: 1.16rem;
  font-weight: 800;
}
.fuel-zfw-row .fuel-slider {
  width: 180px;
}
.fuel-release-picker {
  top: calc(100% + 18px) !important;
  right: -6px !important;
  width: 330px !important;
  padding: 18px 18px 14px !important;
}
.fuel-release-slider {
  height: 34px;
}
.fuel-release-picker .fuel-release-scale {
  margin-top: 10px;
  font-size: .9rem;
}
@media (max-width: 680px) {
  .fuel-zfw-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .fuel-zfw-control {
    justify-content: stretch;
  }
  .fuel-zfw-row .fuel-slider {
    width: 100%;
  }
  .fuel-release-picker {
    width: min(330px, calc(100vw - 44px)) !important;
    right: 0 !important;
  }
}


/* v0.3.7 — Fuel & Turnaround refinements */
.app-version{margin:5px 0 18px;font-size:.78rem;color:var(--muted);opacity:.8}
.fuel-step-button,.fuel-quick-buttons button{min-width:38px;height:36px;border:1px solid var(--border);border-radius:9px;background:var(--panel-soft);color:var(--text);font:inherit;font-weight:800}
.fuel-release-inline{gap:8px!important}
.fuel-release-picker{top:calc(100% + 18px)!important;width:420px!important;padding:20px 22px 16px!important}
.fuel-release-slider{display:block!important;width:100%!important;min-width:100%!important;margin:0!important}
.fuel-release-scale{width:100%!important;margin-top:10px!important}
.fuel-entry-controls-wide{grid-template-columns:minmax(110px,1fr) 92px auto 105px!important}
.fuel-quick-buttons{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.fuel-zfw-row .fuel-slider{align-self:end;margin-top:18px!important}
.turnaround-row{cursor:pointer;transition:border-color .15s ease,background .15s ease,opacity .15s ease}
.turnaround-row.selected{border-color:var(--blue);background:color-mix(in srgb,var(--blue) 10%,var(--panel-soft))}
.turnaround-row:not(.selected){opacity:.45;text-decoration:line-through}
.turnaround-popup{border:3px solid #d32f2f!important;box-shadow:0 0 0 5px rgba(211,47,47,.16),0 18px 48px rgba(0,0,0,.34)!important;background:color-mix(in srgb,#d32f2f 7%,var(--panel))!important}
.turnaround-popup-head{color:#d32f2f}
.turnaround-popup-item{border-left:6px solid #d32f2f;background:color-mix(in srgb,#d32f2f 8%,var(--panel-soft))!important}
.turnaround-custom{margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}
.turnaround-custom h4{margin:0 0 5px}.turnaround-custom-help{margin:0 0 9px}
.turnaround-custom-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.turnaround-custom-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;padding:8px 9px;border:1px solid var(--border);border-radius:10px;background:var(--panel-soft)}
.turnaround-custom-row label{display:flex;align-items:center;gap:7px;font-weight:650}
.turnaround-offset-input{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:.86rem}
.turnaround-offset-input input{width:64px!important;padding:6px 7px!important;text-align:right}
@media(max-width:950px){.fuel-entry-controls-wide{grid-template-columns:minmax(110px,1fr) 88px!important}.fuel-quick-buttons,.fuel-calculated-mini{grid-column:1/-1}}
@media(max-width:680px){.fuel-release-picker{width:min(390px,calc(100vw - 40px))!important}.turnaround-custom-list{grid-template-columns:1fr}}

/* v0.3.8 */
.turnaround-next-strip{display:flex;align-items:center;gap:9px;min-height:34px;padding:5px 12px;margin:4px 0 7px;border:1px solid var(--border);border-radius:12px;background:var(--panel);white-space:nowrap;overflow:hidden}.turnaround-next-strip[hidden]{display:none!important}.turnaround-next-kicker{font-weight:900;color:var(--blue)}#turnaround-next-countdown,#turnaround-next-time{font-variant-numeric:tabular-nums;font-weight:800}#turnaround-next-label{overflow:hidden;text-overflow:ellipsis;font-weight:700}.fuel-ton-step-input{display:grid!important;grid-template-columns:30px minmax(58px,1fr) auto 30px;gap:5px;align-items:center}.fuel-mini-step,.fuel-quick-buttons button{height:30px;min-width:30px;padding:0 7px;border:1px solid var(--border);border-radius:8px;background:var(--panel-soft);color:var(--text);font:inherit;font-weight:800}.fuel-quick-buttons{display:flex;flex-wrap:nowrap;gap:4px;align-items:center}.fuel-entry-controls-wide{grid-template-columns:minmax(90px,.9fr) 86px auto 102px!important}.turnaround-custom{margin-top:10px;padding-top:8px}.turnaround-custom h4{margin:0 0 6px;font-size:.9rem}.turnaround-custom-help{display:none}.turnaround-custom-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 8px}.turnaround-custom-row{padding:5px 7px!important;min-height:34px!important}.turnaround-custom-row label{font-size:.84rem}.turnaround-offset-input{font-size:.78rem}.turnaround-offset-input input{width:48px!important;padding:4px 5px!important}.fuel-release-picker{width:390px!important}.fuel-release-slider{width:100%!important}.fuel-zfw-row .fuel-slider{margin-top:14px!important}@media(max-width:900px){.fuel-entry-controls-wide{grid-template-columns:1fr 86px!important}.fuel-quick-buttons,.fuel-calculated-mini{grid-column:1/-1}.turnaround-custom-list{grid-template-columns:1fr}}


/* v0.4.0 — FPL + Weather */
.preflight-tool-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.preflight-tool-heading h2 {
  margin:2px 0 0;
}

.preflight-tool-card {
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--panel);
  padding:16px;
  margin-bottom:14px;
}

.tool-label {
  display:block;
  margin-bottom:7px;
  font-weight:800;
}

.fpl-input,
.weather-manual-fallback textarea {
  width:100%;
  box-sizing:border-box;
  min-height:170px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--panel-soft);
  color:var(--text);
  padding:12px;
  font:inherit;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}

.tool-actions,
.weather-heading-actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.fpl-summary-line {
  padding:11px 12px;
  border:1px solid var(--yellow);
  border-radius:12px;
  background:color-mix(in srgb,var(--yellow) 12%,var(--panel));
  font-weight:800;
  font-variant-numeric:tabular-nums;
}

.fpl-metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}

.fpl-metrics > div {
  display:grid;
  gap:3px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--panel-soft);
}

.fpl-metrics span,
.wx-summary-grid span {
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
}

.fpl-subsection {
  margin-top:14px;
}

.fpl-subsection h3 {
  margin:0 0 8px;
}

.fpl-route,
.fpl-airport-chips {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.fpl-token,
.fpl-airport-chip {
  padding:5px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel-soft);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.86rem;
}

.fpl-token.coordinate {
  border-color:var(--blue);
}

.weather-airport-input-row {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:end;
  gap:10px;
}

.weather-airport-input-row .tool-label {
  margin:0;
  align-self:center;
}

.weather-airport-input-row input {
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--panel-soft);
  color:var(--text);
  padding:9px 10px;
  font:inherit;
  text-transform:uppercase;
}

.weather-note {
  margin:10px 0 0;
  color:var(--muted);
  font-size:.85rem;
}

.weather-error {
  margin-bottom:12px;
  padding:11px 12px;
  border:1px solid #c62828;
  border-radius:12px;
  background:rgba(198,40,40,.12);
}

.weather-error[hidden] {
  display:none!important;
}

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

.wx-card {
  border:2px solid var(--border);
  border-radius:18px;
  background:var(--panel);
  padding:14px;
}

.wx-card.wx-green { border-color:#2e7d32; }
.wx-card.wx-amber { border-color:#b77900; }
.wx-card.wx-red { border-color:#c62828; }
.wx-card.wx-stale { border-color:#777; opacity:.82; }

.wx-card-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.wx-card-head h3 {
  margin:0;
  font-size:1.4rem;
}

.wx-age {
  color:var(--muted);
  font-size:.8rem;
}

.wx-age.stale { font-weight:800; }

.wx-flag {
  border-radius:999px;
  padding:5px 9px;
  font-size:.76rem;
  font-weight:900;
}
.wx-flag-green { background:rgba(46,125,50,.16); color:#2e7d32; }
.wx-flag-amber { background:rgba(183,121,0,.16); color:#9a6500; }
.wx-flag-red { background:rgba(198,40,40,.16); color:#c62828; }
.wx-flag-stale { background:rgba(100,100,100,.16); color:var(--muted); }

.wx-summary-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:11px 0;
}

.wx-summary-grid > div {
  display:grid;
  gap:3px;
  padding:8px 9px;
  border-radius:10px;
  background:var(--panel-soft);
}

.wx-runway-best {
  display:grid;
  grid-template-columns:auto auto 1fr;
  align-items:baseline;
  gap:8px;
  padding:10px;
  border:1px solid var(--blue);
  border-radius:11px;
  background:color-mix(in srgb,var(--blue) 10%,var(--panel));
}
.wx-runway-best span { font-size:.72rem; font-weight:900; color:var(--blue); }
.wx-runway-best strong { font-size:1.15rem; }
.wx-runway-best small { color:var(--muted); }
.wx-runway-note,
.wx-runway-empty {
  margin:5px 2px 10px;
  color:var(--muted);
  font-size:.76rem;
}

.wx-raw {
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px;
  margin-top:9px;
  align-items:start;
}
.wx-raw > span { font-size:.72rem; font-weight:900; color:var(--muted); }
.wx-raw code,
.wx-taf-details code {
  white-space:normal;
  word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.78rem;
}

.taf-timeline {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:11px;
}

.taf-chip {
  min-width:90px;
  display:grid;
  gap:2px;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:9px;
}
.taf-chip strong { font-size:.72rem; }
.taf-chip span { font-size:.68rem; color:var(--muted); }
.taf-green { border-color:#2e7d32; background:rgba(46,125,50,.08); }
.taf-amber { border-color:#b77900; background:rgba(183,121,0,.08); }
.taf-red { border-color:#c62828; background:rgba(198,40,40,.08); }

.wx-taf-details {
  margin-top:9px;
}

.weather-manual-fallback {
  margin-top:14px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
}

@media (max-width:900px) {
  .weather-grid { grid-template-columns:1fr; }
  .fpl-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:680px) {
  .weather-airport-input-row { grid-template-columns:1fr; }
  .fpl-metrics { grid-template-columns:1fr 1fr; }
  .wx-runway-best { grid-template-columns:1fr; }
}

/* v0.4.1 — SWISS OFP screenshot import */
.ofp-import-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:14px}.ofp-import-head h3{margin:0 0 4px}.ofp-import-head p{margin:0}.ofp-min-rwy{display:grid;gap:5px;font-size:.82rem;font-weight:800;color:var(--muted)}.ofp-min-rwy>div{display:flex;align-items:center;gap:6px}.ofp-min-rwy input{width:86px;padding:7px 8px;border:1px solid var(--border);border-radius:9px;background:var(--panel-soft);color:var(--text);font:inherit;text-align:right;font-weight:800}.ofp-upload-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:14px}.ofp-file-button{cursor:pointer}.ofp-preview-strip{display:flex;gap:8px;overflow-x:auto;margin-top:10px;padding-bottom:2px}.ofp-preview-item{flex:0 0 130px;display:grid;gap:5px}.ofp-preview-item img{width:130px;height:78px;object-fit:cover;border:1px solid var(--border);border-radius:9px;background:var(--panel-soft)}.ofp-preview-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:.72rem}.ofp-ocr-details{margin-top:12px}.ofp-ocr-details textarea{width:100%;box-sizing:border-box;min-height:135px;margin-top:9px;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--panel-soft);color:var(--text);font:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ofp-window-results{margin-top:12px;border-top:1px solid var(--border);padding-top:11px}.ofp-window-results[hidden]{display:none!important}.ofp-window-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px}.ofp-window-table{display:grid}.ofp-window-row{display:grid;grid-template-columns:90px 120px minmax(120px,1fr);gap:8px;align-items:center;padding:7px 8px;border-bottom:1px solid var(--border)}.ofp-window-row.header{color:var(--muted);font-size:.75rem;font-weight:800}.wx-ofp-windows{display:grid;gap:6px;margin:10px 0;padding:9px 10px;border:1px solid var(--yellow);border-radius:10px;background:color-mix(in srgb,var(--yellow) 9%,var(--panel))}.wx-ofp-label{font-size:.68rem;font-weight:900;color:var(--yellow)}.wx-ofp-windows>div{display:flex;flex-wrap:wrap;gap:5px}.wx-ofp-chip{padding:4px 7px;border-radius:7px;background:var(--panel-soft);font-size:.74rem;font-weight:800;font-variant-numeric:tabular-nums}@media(max-width:680px){.ofp-import-head{grid-template-columns:1fr}.ofp-min-rwy{grid-template-columns:1fr auto;align-items:center}.ofp-window-row{grid-template-columns:70px 95px 1fr;font-size:.82rem}}

/* v0.4.2 */
.ofp-allin-note {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}


/* v0.5.0 — PDF-first Pre-Flight + vertical weather + Smart NOTAM */
.pdf-import-head,
.smart-notam-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.pdf-import-head h3,
.smart-notam-head h3 { margin:0 0 4px; }

.pdf-import-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
}
.pdf-import-box {
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel-soft);
}
.pdf-import-box > strong { font-size:1rem; }
.pdf-file-button { width:max-content; cursor:pointer; }
.pdf-file-name {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:.78rem;
}
.pdf-import-summary {
  margin-top:12px;
  display:grid;
  gap:5px;
  padding:10px 12px;
  border:1px solid var(--blue);
  border-radius:11px;
  background:color-mix(in srgb,var(--blue) 8%,var(--panel));
}
.pdf-import-summary[hidden] { display:none!important; }
.pdf-summary-fuel {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  color:var(--muted);
  font-size:.82rem;
}

/* One airport per line/row */
.weather-grid {
  grid-template-columns:1fr !important;
}

.wx-head-badges {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}
.metar-age-badge {
  border-radius:999px;
  padding:5px 9px;
  font-size:.76rem;
  font-weight:900;
  background:var(--panel-soft);
}
.age-green { color:#198754; border:1px solid #198754; }
.age-blue { color:#2979ff; border:1px solid #2979ff; }
.age-orange { color:#e09000; border:1px solid #e09000; }
.age-red { color:#d32f2f; border:1px solid #d32f2f; }
.age-unknown { color:var(--muted); border:1px solid var(--border); }

.wx-no-takeoff {
  margin:8px 0 10px;
  padding:10px 12px;
  border:2px solid #d32f2f;
  border-radius:10px;
  background:rgba(211,47,47,.14);
  color:#d32f2f;
  font-weight:950;
  letter-spacing:.02em;
}

.raw-taf-highlighted {
  display:block;
  line-height:1.8;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.79rem;
}
.raw-taf-highlighted > span {
  display:inline;
  padding:2px 4px;
  margin-right:2px;
  border-radius:4px;
}
.taf-raw-outside {
  color:var(--muted);
  opacity:.52;
}
.taf-raw-green {
  background:rgba(46,125,50,.17);
  box-shadow:inset 0 -2px 0 #2e7d32;
}
.taf-raw-amber {
  background:rgba(230,155,0,.20);
  box-shadow:inset 0 -2px 0 #d89400;
}
.taf-raw-red {
  background:rgba(198,40,40,.18);
  box-shadow:inset 0 -2px 0 #c62828;
}
.taf-no-takeoff {
  display:inline-block;
  margin-left:5px;
  padding:1px 5px;
  border-radius:4px;
  background:#c62828;
  color:white;
  font-weight:950;
}

.smart-notam-panel[hidden] { display:none!important; }
.smart-notam-stats {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.notam-action-badge {
  border:1px solid #c62828;
  color:#c62828;
}
.notam-review-badge {
  border:1px solid #d89400;
  color:#b77900;
}
.smart-notam-list {
  display:grid;
  gap:12px;
  margin-top:12px;
}
.smart-notam-airport {
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}
.smart-notam-airport-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:9px 11px;
  background:var(--panel-soft);
}
.smart-notam-airport-head span {
  color:var(--muted);
  font-size:.78rem;
}
.smart-notam-item {
  border-top:1px solid var(--border);
  padding:0;
}
.smart-notam-item summary {
  display:grid;
  grid-template-columns:auto auto minmax(150px,1fr) auto;
  gap:8px;
  align-items:center;
  padding:9px 11px;
  cursor:pointer;
}
.smart-notam-text {
  padding:0 11px 11px;
  color:var(--muted);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.77rem;
  line-height:1.45;
}
.notam-severity {
  min-width:58px;
  text-align:center;
  border-radius:6px;
  padding:3px 5px;
  font-size:.68rem;
  font-weight:950;
}
.notam-action .notam-severity { background:rgba(198,40,40,.16); color:#c62828; }
.notam-review .notam-severity { background:rgba(216,148,0,.16); color:#b77900; }
.notam-info .notam-severity { background:var(--panel-soft); color:var(--muted); }
.notam-time-state {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.74rem;
  font-weight:800;
}
.time-overlap .notam-time-state { color:#c62828; }
.time-outside { opacity:.45; }
.notam-reason {
  color:var(--muted);
  font-size:.72rem;
}

@media(max-width:760px) {
  .pdf-import-grid { grid-template-columns:1fr; }
  .smart-notam-item summary {
    grid-template-columns:auto 1fr;
  }
  .notam-time-state,
  .notam-reason { grid-column:1/-1; }
}


/* v0.5.1 */
.pdf-import-summary {
  min-height: 48px;
}

/* v0.5.2 */
.pdf-file-name { max-width: 100%; }

/* v0.5.3 critical import fix */


/* v0.5.4 — TAF partial overlap + PROB/TEMPO */
.raw-taf-highlighted {
  display:grid;
  gap:6px;
}

.raw-taf-highlighted > span {
  display:block;
  padding:7px 8px;
  margin:0;
  border-radius:7px;
  line-height:1.5;
}

.taf-change-badge,
.taf-overlap-badge {
  display:inline-block;
  margin:0 5px 0 2px;
  padding:2px 5px;
  border-radius:5px;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:.67rem;
  font-weight:900;
  vertical-align:1px;
}

.taf-change-badge {
  border:1px solid currentColor;
  opacity:.9;
}

.taf-overlap-badge {
  background:rgba(255,255,255,.16);
  color:inherit;
}

.taf-raw-outside .taf-change-badge {
  opacity:.55;
}


/* v0.5.5 — Smart NOTAM summary-first */
.smart-notam-airport-head.compact {
  align-items:flex-start;
  gap:14px;
}

.smart-notam-airport-title {
  display:grid;
  gap:4px;
  min-width:0;
}

.smart-notam-airport-title > strong {
  font-size:1.15rem;
}

.smart-notam-primary {
  color:var(--text);
  font-size:.88rem;
  font-weight:800;
}

.smart-notam-airport-counts {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  justify-content:flex-end;
}

.mini-count {
  border-radius:999px;
  padding:3px 7px;
  font-size:.68rem;
  font-weight:900;
  white-space:nowrap;
}

.mini-count.action {
  color:#c62828;
  border:1px solid #c62828;
}

.mini-count.review {
  color:#b77900;
  border:1px solid #d89400;
}

.mini-count.total {
  color:var(--muted);
  border:1px solid var(--border);
}

.smart-notam-category {
  border-top:1px solid var(--border);
}

.smart-notam-category-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:7px 11px;
  background:var(--panel-soft);
  color:var(--muted);
  font-size:.76rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.smart-notam-item.compact summary {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:9px 11px;
}

.notam-summary-main {
  display:grid;
  gap:2px;
  min-width:0;
}

.notam-summary-main > strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.88rem;
}

.notam-summary-main > small {
  color:var(--muted);
  font-size:.67rem;
}

.smart-notam-item.compact .notam-time-state {
  max-width:220px;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.smart-notam-original {
  border-top:1px dashed var(--border);
  padding:8px 11px 11px;
  background:color-mix(in srgb,var(--panel-soft) 70%,transparent);
}

.original-label {
  margin-bottom:5px;
  color:var(--muted);
  font-size:.67rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.smart-notam-outside {
  border-top:1px solid var(--border);
}

.smart-notam-outside > summary {
  padding:9px 11px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:800;
  cursor:pointer;
}

.smart-notam-outside-list {
  border-top:1px solid var(--border);
}

.time-outside {
  opacity:.55;
}

@media(max-width:760px) {
  .smart-notam-airport-head.compact {
    display:grid;
    grid-template-columns:1fr;
  }

  .smart-notam-airport-counts {
    justify-content:flex-start;
  }

  .smart-notam-item.compact summary {
    grid-template-columns:auto 1fr;
  }

  .smart-notam-item.compact .notam-time-state {
    grid-column:1/-1;
    max-width:none;
    text-align:left;
    padding-left:0;
  }
}


/* v0.5.6 — compact weather summary */
.wx-summary-grid.compact {
  gap:8px;
}

.wx-summary-grid.compact > .wx-summary-line {
  display:flex;
  align-items:baseline;
  justify-content:flex-start;
  gap:10px;
  min-height:0;
  padding:8px 10px;
}

.wx-summary-grid.compact > .wx-summary-line span {
  flex:0 0 auto;
  margin:0;
}

.wx-summary-grid.compact > .wx-summary-line strong {
  flex:1 1 auto;
  min-width:0;
  margin:0;
  font-size:1rem;
  line-height:1.2;
}

@media (max-width:680px) {
  .wx-summary-grid.compact {
    grid-template-columns:1fr;
  }

  .wx-summary-grid.compact > .wx-summary-line {
    gap:8px;
    padding:7px 9px;
  }
}


/* v0.5.7 — Crew Briefing NOTAM layout */
.smart-notam-list {
  gap:18px;
}

.crew-briefing-meta {
  display:grid;
  gap:5px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel-soft);
}

.crew-briefing-meta > div:first-child {
  font-size:1rem;
  letter-spacing:.03em;
}

.crew-meta-row {
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  color:var(--muted);
  font-size:.82rem;
}

.crew-briefing-section {
  display:grid;
  gap:10px;
}

.crew-briefing-section > h3 {
  margin:0;
  padding-bottom:5px;
  border-bottom:2px solid var(--border);
  font-size:.95rem;
  letter-spacing:.04em;
}

.crew-airport-block {
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}

.crew-airport-heading {
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  padding:10px 12px;
  background:var(--panel-soft);
}

.crew-airport-heading h4 {
  margin:0;
  font-size:1rem;
}

.crew-airport-heading span {
  color:var(--muted);
  font-size:.75rem;
}

.crew-airport-badges {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  justify-content:flex-end;
}

.crew-category {
  padding:10px 12px 4px;
  border-top:1px solid var(--border);
}

.crew-category h5 {
  margin:0 0 5px;
  font-size:.82rem;
  color:var(--text);
}

.crew-category-items {
  display:grid;
}

.crew-notam-detail {
  border-top:1px solid color-mix(in srgb,var(--border) 70%,transparent);
}

.crew-notam-detail:first-child {
  border-top:none;
}

.crew-notam-detail summary {
  display:grid;
  grid-template-columns:10px minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  padding:7px 0;
  cursor:pointer;
  list-style:none;
}

.crew-notam-detail summary::-webkit-details-marker {
  display:none;
}

.crew-bullet-level {
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--muted);
}

.crew-bullet-level.action { background:#c62828; }
.crew-bullet-level.review { background:#d89400; }
.crew-bullet-level.info { background:#73808c; }

.crew-summary-text {
  font-size:.86rem;
  font-weight:750;
}

.crew-time {
  color:var(--muted);
  font-size:.69rem;
  white-space:nowrap;
}

.crew-outside {
  border-top:1px solid var(--border);
  padding:8px 12px;
}

.crew-outside > summary {
  color:var(--muted);
  font-size:.76rem;
  font-weight:800;
  cursor:pointer;
}

.crew-category-items.outside {
  margin-top:5px;
  opacity:.55;
}

.main-threats,
.briefing-items {
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel);
}

.main-threats ol,
.briefing-items ul {
  margin:0;
  padding-left:22px;
}

.main-threats li,
.briefing-items li {
  margin:5px 0;
  line-height:1.35;
  font-size:.86rem;
}

.threat-action::marker { color:#c62828; }
.threat-review::marker { color:#d89400; }

@media(max-width:760px) {
  .crew-airport-heading {
    display:grid;
    grid-template-columns:1fr;
  }

  .crew-airport-badges {
    justify-content:flex-start;
  }

  .crew-notam-detail summary {
    grid-template-columns:10px 1fr;
  }

  .crew-time {
    grid-column:2;
    white-space:normal;
  }
}


/* v0.5.8 — compact OFP WX window */
.wx-ofp-windows.compact {
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 10px;
  min-height:0;
  overflow:hidden;
}

.wx-ofp-windows.compact .wx-ofp-label {
  flex:0 0 auto;
  white-space:nowrap;
}

.wx-ofp-chip-row {
  display:flex;
  align-items:center;
  gap:6px;
  flex:1 1 auto;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}

.wx-ofp-chip-row::-webkit-scrollbar {
  display:none;
}

.wx-ofp-windows.compact .wx-ofp-chip {
  flex:0 0 auto;
  white-space:nowrap;
}


/* v0.5.9 — TAF timeline OFP relevance */
.taf-timeline {
  overflow-x:auto;
  overflow-y:hidden;
  flex-wrap:nowrap;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.taf-timeline::-webkit-scrollbar {
  display:none;
}

.taf-chip {
  flex:0 0 auto;
}

/* Completely outside the OFP weather window */
.taf-chip.ofp-outside {
  border-color:var(--border) !important;
  background:var(--panel-soft) !important;
  color:var(--muted) !important;
  opacity:.46;
  box-shadow:none !important;
}

.taf-chip.ofp-outside strong,
.taf-chip.ofp-outside span {
  color:var(--muted) !important;
}

/* Only part of the TAF group overlaps the OFP window */
.taf-chip.ofp-partial {
  position:relative;
  border-width:2px;
  border-style:dashed;
}

.taf-chip.ofp-partial::after {
  content:"PARTIAL";
  position:absolute;
  top:-7px;
  right:6px;
  padding:1px 5px;
  border-radius:5px;
  background:var(--panel);
  border:1px solid currentColor;
  font-size:.56rem;
  font-weight:950;
  letter-spacing:.04em;
}

/* Fully inside the OFP window — strongest visual emphasis */
.taf-chip.ofp-inside {
  opacity:1;
  border-width:2px;
}

/* No OFP window for this airport: keep ordinary weather colors */
.taf-chip.ofp-no-window {
  opacity:1;
}


/* v0.6.0 — corrected PARTIAL semantics and unclipped badge */
.taf-chip.ofp-partial {
  padding-top:22px;
}

.taf-chip.ofp-partial::after {
  top:4px;
  right:7px;
  line-height:1.15;
  z-index:1;
}

.taf-chip.ofp-partial strong {
  display:block;
}


/* v0.6.1 — compact imports, WEATHER/NOTAM P/B, AD List runway database */
.preflight-pb-group{display:flex;gap:6px;align-items:center}.preflight-pb{border:1px solid var(--border);border-radius:9px;background:var(--panel-soft);color:var(--muted);font-weight:900;font-size:.75rem;letter-spacing:.05em;padding:8px 11px;cursor:pointer}.preflight-pb.active{background:var(--yellow);color:#111;border-color:var(--yellow);box-shadow:inset 0 -2px 0 rgba(0,0,0,.18)}
.pdf-import-compact{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;border:1px solid var(--border);border-radius:12px;background:var(--panel);padding:9px 12px;margin-bottom:10px;font-size:.82rem}.pdf-import-compact[hidden]{display:none!important}.pdf-import-compact .ad-db-status{color:var(--muted)}.compact-button{padding:6px 9px;font-size:.75rem;margin-left:auto}.pdf-import-card[hidden]{display:none!important}
#weather-control-card[hidden],#weather-grid[hidden],#weather-error[hidden],#weather-manual-fallback[hidden]{display:none!important}
.wx-runway-best strong{font-variant-numeric:tabular-nums}
@media(max-width:700px){.weather-heading-actions{align-items:flex-start}.preflight-pb-group{width:100%}.preflight-pb{flex:1}.compact-button{margin-left:0}}

/* v0.6.3 ATC Route Map */
.route-map-page-heading,
.route-map-subhead {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}
.route-map-actions { display:flex; gap:.5rem; flex-wrap:wrap; justify-content:flex-end; }
.route-map-card {
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  padding:1rem;
  margin-bottom:1rem;
  box-shadow:var(--shadow-soft);
}
.route-map-canvas {
  min-height:320px;
  background:#0f1f2a;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  overflow:hidden;
}
.simple-world-map { width:100%; height:auto; display:block; }
.simple-world-map .continent { fill:#223948; stroke:#345a6b; stroke-width:.25; opacity:.78; }
.simple-world-map .graticule path { stroke:#5e7888; stroke-width:.13; opacity:.32; fill:none; }
.simple-world-map .atc-route-line {
  fill:none;
  stroke:#f0b429;
  stroke-width:1.1;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 4px rgba(240,180,41,.45));
}
.simple-world-map .route-point circle { fill:#f9fafb; stroke:#111827; stroke-width:.35; }
.simple-world-map .route-point.airport circle { fill:#38bdf8; }
.simple-world-map .route-point text,
.simple-world-map .route-chart-pin text {
  fill:#f8fafc;
  font-size:2.2px;
  font-weight:800;
  paint-order:stroke;
  stroke:#0f172a;
  stroke-width:.65;
  stroke-linejoin:round;
}
.simple-world-map .route-chart-pin { cursor:pointer; outline:none; }
.simple-world-map .route-chart-pin circle { fill:#22c55e; stroke:#f8fafc; stroke-width:.35; }
.simple-world-map .route-chart-pin:hover circle,
.simple-world-map .route-chart-pin:focus circle { fill:#f97316; }
.route-map-legend { display:flex; flex-wrap:wrap; gap:1rem; margin-top:.75rem; color:var(--muted); font-size:.9rem; }
.legend-dot { display:inline-block; width:.75rem; height:.75rem; border-radius:99px; margin-right:.35rem; vertical-align:-.08rem; }
.legend-dot.route { background:#f0b429; }
.legend-dot.airport { background:#38bdf8; }
.legend-dot.chart { background:#22c55e; }
.route-map-chart-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:.75rem;
}
.route-chart-card {
  text-align:left;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  padding:0;
  cursor:pointer;
  min-height:170px;
  display:flex;
  flex-direction:column;
}
.route-chart-card.placeholder { opacity:.72; }
.route-chart-card img { width:100%; height:110px; object-fit:cover; object-position:center; border-bottom:1px solid var(--border); background:#0f172a; }
.route-chart-placeholder {
  height:110px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#132330,#263d4d);
  color:#9fb4c3;
  font-size:1.9rem;
  font-weight:900;
  letter-spacing:.08em;
  border-bottom:1px solid var(--border);
}
.route-chart-card-body { padding:.8rem; display:grid; gap:.2rem; }
.route-chart-card-body strong { font-size:1rem; }
.route-chart-card-body span { color:var(--muted); font-size:.82rem; }
.route-chart-card-body em { color:var(--blue); font-size:.82rem; font-style:normal; font-weight:700; }
@media (max-width:700px){
  .route-map-page-heading,.route-map-subhead { display:block; }
  .route-map-actions { justify-content:flex-start; margin-top:.75rem; }
  .route-map-canvas { min-height:220px; }
}

/* v0.7.1 hierarchy + iPhone fixes */
.primary-nav { overflow-x:auto; scrollbar-width:none; }
.primary-nav::-webkit-scrollbar { display:none; }
.primary-nav .nav-button { flex:0 0 auto; white-space:nowrap; }

@media (max-width:600px) {
  .fuel-entry-row { grid-template-columns:minmax(0,1fr)!important; gap:8px!important; }
  .fuel-entry-controls, .fuel-entry-controls-wide {
    width:100%!important; min-width:0!important; display:flex!important;
    justify-content:flex-end!important; flex-wrap:wrap!important; gap:8px!important;
  }
  .fuel-ton-step-input {
    margin-left:auto; width:100%; max-width:260px;
    display:grid!important; grid-template-columns:48px minmax(82px,108px) auto 48px!important;
  }
  .fuel-mini-step { width:48px!important; min-width:48px!important; min-height:48px!important; }
  .fuel-ton-step-input input { min-width:0!important; width:100%!important; }
}


/* v0.7.2 — Operational Times cleanup */
.time-entry-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: stretch;
}
.time-entry {
  display: grid;
  grid-template-rows: auto 48px auto;
  gap: 8px;
  padding: 10px 11px;
  min-width: 0;
}
.time-entry label { margin: 0 !important; }
.time-entry input[type="datetime-local"] {
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.time-entry input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: center;
  margin: auto;
}
.time-entry .display-toggle {
  min-height: 24px;
  justify-content: center;
}

.times-card .settings-grid.three {
  align-items: end;
}
.times-card .settings-grid.three > label,
.times-card .calculation-result {
  min-width: 0;
}
.times-card input,
.times-card select {
  min-height: 44px;
}
.calculation-result {
  min-height: 62px;
  margin-top: 0;
  padding: 9px 11px;
}
.ttot-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ttot-summary > div,
.ttot-summary > label {
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 11px;
  background: var(--panel-soft);
  justify-content: center;
}
.ttot-summary { border-top: 0; padding-top: 0; }

.turnaround-custom-list {
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 7px;
}
.turnaround-custom-row {
  grid-template-columns: minmax(0,1fr) 82px;
  padding: 7px 9px !important;
  min-height: 42px !important;
}
.turnaround-custom-row label {
  color: var(--text) !important;
  font-size: .9rem !important;
  line-height: 1.2;
  min-width: 0;
}
.turnaround-offset-input {
  color: var(--muted);
  justify-content: flex-end;
}
.turnaround-offset-input input {
  width: 54px !important;
  min-height: 34px !important;
}
.turnaround-sound-test {
  min-height: 34px;
  padding: 5px 9px;
  font-size: .78rem;
}

.wx-airport-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .time-entry-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ttot-summary { grid-template-columns: 1fr 1fr; }
  .ttot-summary > label { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .time-entry-grid { grid-template-columns: 1fr; }
  .times-card { padding: 13px; }
  .ttot-summary { grid-template-columns: 1fr; }
  .ttot-summary > label { grid-column: auto; }
  .turnaround-custom-list { grid-template-columns: 1fr; }
  .turnaround-custom-row { grid-template-columns: minmax(0,1fr) 76px; }
}

/* v0.7.3 */
.turnaround-custom-list{display:flex!important;flex-direction:column!important;gap:6px!important}
.turnaround-custom-row{display:grid!important;grid-template-columns:minmax(180px,1fr) minmax(190px,250px)!important;align-items:center!important;gap:14px!important;min-height:48px!important;padding:7px 10px!important}
.turnaround-custom-row label{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;font-size:.94rem!important;color:var(--text)!important}
.turnaround-custom-row label span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.turnaround-offset-input{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:8px!important;font-size:.86rem!important}
.turnaround-offset-input input{width:100%!important;min-width:0!important;height:36px!important;padding:5px 8px!important;text-align:center!important}
.turnaround-offset-input input.input-invalid{border-color:var(--red)!important;outline:1px solid var(--red)}
.wx-runway-best{grid-template-columns:auto minmax(170px,.8fr) minmax(260px,1.4fr)!important;align-items:center!important;gap:12px!important}
.wx-runway-selected{display:flex;flex-direction:column;gap:3px}
.wx-runway-select-label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;color:var(--muted);font-size:.78rem;font-weight:750}
.wx-runway-select{width:100%;min-width:0;height:38px;padding:4px 8px;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--text);font:inherit}
@media(max-width:700px){.turnaround-custom-row{grid-template-columns:minmax(0,1fr) minmax(145px,190px)!important;gap:8px!important}.wx-runway-best{grid-template-columns:1fr!important}.wx-runway-select-label{grid-template-columns:1fr}}

/* v0.7.4 — Cockpit checklist */
.checklist-shell{max-width:1380px;margin:0 auto;padding:10px 14px 24px}
.checklist-status-strip{display:grid;grid-template-columns:repeat(10,minmax(90px,1fr));gap:5px;margin-bottom:8px}
.checklist-status-strip button{min-height:42px;padding:5px;border:1px solid var(--border);border-radius:9px;background:var(--panel);color:var(--text);font-weight:800;font-size:.74rem;line-height:1.05}
.checklist-status-strip button.done{background:#2f8f61;color:#fff;border-color:#2f8f61}
.checklist-toolbar{display:flex;justify-content:flex-end;margin-bottom:7px}.checklist-toolbar button{padding:7px 12px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--muted);font-weight:700}
.checklist-board{display:grid;grid-template-columns:1fr 1fr;gap:22px;background:#f8faf8;color:#111;padding:20px 24px;border:8px solid #56ad3c;border-radius:4px}
.checklist-column{display:flex;flex-direction:column;gap:10px}.checklist-block{font-size:clamp(14px,1.45vw,22px);line-height:1.18}.checklist-block h3{display:inline-block;margin:0 0 5px;padding:2px 7px;border:2px solid #45513d;border-radius:7px;background:#83aa70;color:#fff;font-size:.9em}.checklist-block p{margin:0}.checklist-block strong{color:#e11}.checklist-block.red-title h3{background:#f22;border-color:#6b1111}.checklist-block.soft-box{background:#e7f3e9;padding:12px 16px}
.checklist-footer-grid{display:grid;grid-template-columns:.8fr 1.5fr 1.4fr;background:#fff;color:#111;border:2px solid #333;border-top:0;margin:0 24px}.checklist-footer-grid>div{padding:9px 12px;border-right:2px solid #333;font-size:clamp(11px,1vw,15px);line-height:1.25}.checklist-footer-grid>div:last-child{border-right:0}
@media(max-width:900px){.checklist-status-strip{grid-template-columns:repeat(5,1fr)}.checklist-board{grid-template-columns:1fr}.checklist-footer-grid{grid-template-columns:1fr;margin:0}.checklist-footer-grid>div{border-right:0;border-bottom:1px solid #333}}


/* v0.7.5 — Fuel Planning compact, stable control groups */
.fuel-layout-clean {
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
}
.fuel-card {
  padding: 14px 16px !important;
}
.fuel-card-title-row {
  margin-bottom: 6px !important;
}
.fuel-entry-row {
  display: grid !important;
  grid-template-columns: minmax(150px, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 54px !important;
  padding: 7px 0 !important;
}
.fuel-entry-row > label,
.fuel-entry-row > span:first-child {
  min-width: 0 !important;
}
.fuel-entry-controls {
  width: auto !important;
  min-width: 0 !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}
.fuel-ton-input.fuel-ton-step-input {
  display: grid !important;
  grid-template-columns: 42px 82px 24px 42px !important;
  gap: 6px !important;
  align-items: center !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}
.fuel-mini-step,
.fuel-step-button {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
}
.fuel-ton-step-input input,
.fuel-release-button {
  width: 82px !important;
  min-width: 82px !important;
  height: 42px !important;
  min-height: 42px !important;
  text-align: center !important;
}
.fuel-ton-step-input span {
  width: 24px !important;
  min-width: 24px !important;
  text-align: center !important;
}
.fuel-release-inline {
  display: grid !important;
  grid-template-columns: auto 42px 82px 42px !important;
  gap: 6px !important;
  align-items: center !important;
}
.fuel-release-inline > span {
  margin-right: 4px !important;
}
.fuel-entry-controls-wide {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
}
.fuel-minute-input {
  display: grid !important;
  grid-template-columns: 66px 34px !important;
  gap: 5px !important;
  align-items: center !important;
}
.fuel-minute-input input {
  width: 66px !important;
  min-width: 66px !important;
  height: 40px !important;
}
.fuel-quick-buttons {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
}
.fuel-quick-buttons button {
  width: 42px !important;
  min-width: 42px !important;
  height: 40px !important;
  min-height: 40px !important;
}
.fuel-calculated-mini {
  min-width: 106px !important;
  height: 40px !important;
  padding: 0 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
}
.fuel-weight-card .fuel-list {
  gap: 0 !important;
}
.fuel-weight-result {
  min-height: 54px !important;
  padding: 8px 0 !important;
}
.fuel-weight-result.fuel-primary-result {
  padding: 8px 10px !important;
}
.fuel-zfw-input input {
  width: 92px !important;
  min-width: 92px !important;
  height: 42px !important;
}
#fuel-planning-view .fuel-source-note {
  margin-top: 8px !important;
}

/* Keep complete fuel calculation visible on landscape iPad */
@media (min-width: 900px) {
  #fuel-planning-view {
    padding-bottom: 12px !important;
  }
  .fuel-page-heading {
    margin-bottom: 8px !important;
  }
  .fuel-list {
    gap: 0 !important;
  }
}

/* Responsive fallback */
@media (max-width: 900px) {
  .fuel-layout-clean {
    grid-template-columns: 1fr !important;
  }
  .fuel-entry-row {
    grid-template-columns: 1fr !important;
  }
  .fuel-entry-controls,
  .fuel-entry-controls-wide {
    justify-content: flex-start !important;
  }
}


/* v0.7.5 — CCI / DECOMP / COM compact matrix */
.matrix-page{max-width:1400px;margin:0 auto;padding:10px 14px 20px}
.matrix-grid{display:grid;grid-template-columns:1fr 1.1fr 1fr;gap:16px}
.matrix-col{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:12px}
.matrix-col h2{margin:0 0 10px;background:#dedf18;color:#111;text-align:center;border-radius:10px;padding:8px 10px;font-size:1.2rem}
.matrix-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.matrix-buttons button{min-height:52px;padding:7px;border:1px solid #a7a700;border-radius:8px;background:#ecec14;color:#111;font-weight:850;font-size:.9rem;line-height:1.05}
.matrix-buttons button.matrix-wide{grid-column:1/-1}
@media(max-width:900px){.matrix-grid{grid-template-columns:1fr}.matrix-buttons{grid-template-columns:1fr 1fr}}

/* v0.7.5 — force Additional labels visible */
.turnaround-custom-row label{
  opacity:1 !important;
  visibility:visible !important;
  color:var(--text) !important;
}
.turnaround-custom-row label span{
  display:inline !important;
  opacity:1 !important;
  visibility:visible !important;
  color:var(--text) !important;
}

/* v0.7.7 — Fuel layout stabilization based on working v0.7.5 DOM */
#fuel-planning-view .fuel-layout-clean{display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(330px,.9fr)!important;gap:14px!important;align-items:start!important}
#fuel-planning-view .fuel-card{padding:12px 14px!important;overflow:visible!important}
#fuel-planning-view .fuel-list{gap:0!important}
#fuel-planning-view .fuel-entry-row{display:grid!important;grid-template-columns:minmax(150px,1fr) auto!important;align-items:center!important;gap:10px!important;min-height:50px!important;padding:6px 0!important}
#fuel-planning-view .fuel-entry-row>label,#fuel-planning-view .fuel-entry-row>span:first-child{min-width:0!important;margin:0!important;white-space:nowrap!important}
#fuel-planning-view .fuel-entry-controls{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;gap:6px!important;width:auto!important;min-width:0!important}
#fuel-planning-view .fuel-ton-input.fuel-ton-step-input{display:grid!important;grid-template-columns:38px 70px 16px 38px!important;gap:5px!important;align-items:center!important;width:max-content!important;min-width:167px!important;max-width:167px!important;margin:0!important}
#fuel-planning-view .fuel-mini-step{width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;padding:0!important;margin:0!important}
#fuel-planning-view .fuel-ton-step-input input{width:70px!important;min-width:70px!important;max-width:70px!important;height:38px!important;min-height:38px!important;padding:0 5px!important;margin:0!important;text-align:center!important}
#fuel-planning-view .fuel-ton-step-input span{width:16px!important;min-width:16px!important;max-width:16px!important;margin:0!important;text-align:center!important}
#fuel-planning-view .fuel-release-inline{display:grid!important;grid-template-columns:auto 38px 70px 38px!important;gap:5px!important;align-items:center!important;width:max-content!important}
#fuel-planning-view .fuel-release-inline .fuel-step-button{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;padding:0!important}
#fuel-planning-view .fuel-release-button{width:70px!important;min-width:70px!important;height:38px!important;min-height:38px!important;padding:0!important}
#fuel-planning-view .fuel-entry-controls-wide{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;gap:5px!important;width:auto!important}
#fuel-planning-view .fuel-minute-input{display:grid!important;grid-template-columns:58px 28px!important;gap:3px!important;align-items:center!important;width:89px!important;min-width:89px!important}
#fuel-planning-view .fuel-minute-input input{width:58px!important;min-width:58px!important;height:38px!important;min-height:38px!important;padding:0 5px!important;text-align:center!important}
#fuel-planning-view .fuel-quick-buttons{display:flex!important;flex-wrap:nowrap!important;gap:4px!important}
#fuel-planning-view .fuel-quick-buttons button{width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;padding:0!important}
#fuel-planning-view .fuel-calculated-mini{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;min-width:100px!important;height:38px!important;min-height:38px!important;padding:0 7px!important;margin:0!important}
#fuel-planning-view .fuel-subtotal-row,#fuel-planning-view .fuel-block-row{display:grid!important;grid-template-columns:minmax(150px,1fr) auto 16px!important;align-items:center!important;gap:5px!important;min-height:48px!important;padding:7px 0!important}
#fuel-planning-view .fuel-block-row{padding:8px 9px!important}
#fuel-planning-view .fuel-total-row{display:none!important}
#fuel-planning-view .fuel-weight-card{min-width:0!important}
#fuel-planning-view .fuel-weight-result{min-height:50px!important;padding:7px 0!important}
#fuel-planning-view .fuel-primary-result{padding:7px 9px!important}
#fuel-planning-view .fuel-zfw-control{min-width:0!important}
#fuel-planning-view .fuel-zfw-input input{width:86px!important;min-width:86px!important;height:38px!important}
@media(min-width:1000px){#fuel-planning-view .fuel-page-heading{margin-bottom:7px!important}#fuel-planning-view .fuel-source-note{margin-top:6px!important}}
@media(max-width:900px){#fuel-planning-view .fuel-layout-clean{grid-template-columns:1fr!important}#fuel-planning-view .fuel-entry-row{grid-template-columns:1fr!important}#fuel-planning-view .fuel-entry-controls,#fuel-planning-view .fuel-entry-controls-wide{justify-content:flex-start!important}}
.turnaround-custom-row label,.turnaround-custom-row label span{visibility:visible!important;opacity:1!important;color:var(--text)!important}
.turnaround-custom-row label{display:flex!important}.turnaround-custom-row label span{display:inline!important}

/* v0.7.8 — OFP time-window weather logic */
.wx-ofp-timing{
  margin-left:auto;
  font-size:.76rem;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}
.wx-ofp-windows.compact{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

/* v0.8.0 — Fuel fixes */
#fuel-planning-view .fuel-zfw-input.fuel-ton-step-input{
  display:grid!important;
  grid-template-columns:38px 78px 16px 38px!important;
  gap:5px!important;
  align-items:center!important;
  width:max-content!important;
}
#fuel-planning-view .fuel-zfw-input .fuel-mini-step{
  width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;padding:0!important;
}
#fuel-planning-view .fuel-zfw-input input{
  width:78px!important;min-width:78px!important;height:38px!important;min-height:38px!important;text-align:center!important;
}

/* v0.8.2 Layout Editor */
.layout-editor-bar{display:flex;gap:8px;align-items:center;margin:0 0 12px;flex-wrap:wrap}.layout-editor-bar button{min-height:38px;border-radius:9px;padding:6px 12px;font-weight:700}#layout-editor-status{font-size:.82rem;opacity:.7}.layout-editing [data-layout-id]{outline:2px dashed currentColor;outline-offset:2px;cursor:pointer;position:relative}.layout-editing [data-layout-id]::after{content:"✎";position:absolute;right:4px;top:3px;font-size:12px;opacity:.75}.layout-custom-button{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:54px;padding:9px 12px;border:1px solid rgba(127,127,127,.35);border-radius:10px;text-decoration:none}.layout-custom-button small{opacity:.72}.layout-button-dialog{border:0;border-radius:14px;max-width:460px;width:min(92vw,460px);padding:18px}.layout-button-dialog::backdrop{background:rgba(0,0,0,.55)}.layout-button-dialog form{display:grid;gap:12px}.layout-button-dialog label{display:grid;gap:5px;font-weight:600}.layout-button-dialog input,.layout-button-dialog select{width:100%;min-height:42px;padding:7px 9px;border-radius:8px}.layout-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}

/* v0.8.3 page layout editor */
.gear-glyph{font-size:22px;line-height:1}.layout-gear-button.active{outline:2px solid currentColor;outline-offset:2px}.page-layout-panel{position:fixed;right:18px;top:150px;z-index:9000;display:flex;gap:8px;align-items:center;padding:9px;background:var(--surface,#fff);border:1px solid rgba(127,127,127,.35);border-radius:12px;box-shadow:0 6px 24px rgba(0,0,0,.15)}.page-layout-panel[hidden]{display:none!important}.page-layout-panel button{min-height:38px;padding:6px 12px;border-radius:9px;font-weight:700}.page-layout-panel span{font-size:.78rem;opacity:.7}.page-layout-editing [data-layout-id]{outline:2px dashed currentColor!important;outline-offset:2px;position:relative}.layout-custom-button{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:54px;padding:9px 12px;border:1px solid rgba(127,127,127,.35);border-radius:10px;text-decoration:none}.layout-custom-button small{opacity:.72}

/* v0.8.4 — resizable + drag/drop layout */
.page-layout-grid{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  gap:10px!important;
}
.page-layout-grid > .layout-managed-item{
  width:auto!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.page-layout-editing .layout-managed-item{
  touch-action:none!important;
  user-select:none!important;
  -webkit-user-select:none!important;
  cursor:grab!important;
}
.page-layout-editing .layout-managed-item:active{cursor:grabbing!important}
.layout-dragging{
  opacity:.55!important;
  transform:scale(.98)!important;
  z-index:100!important;
}
.layout-drop-target{
  box-shadow:0 0 0 3px rgba(0,122,255,.45)!important;
}
@media (max-width:700px){
  .page-layout-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

/* v0.8.5 — persisted personal layout remains active outside edit mode */
main .page-layout-grid{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  gap:10px!important;
}
main .page-layout-grid > .layout-managed-item{
  width:auto!important;
  max-width:none!important;
  box-sizing:border-box!important;
  align-self:stretch!important;
}
@media (max-width:700px){
  main .page-layout-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

/* v0.8.7 responsive phone + text controls */
.layout-managed-item{
  overflow:hidden!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
}
.layout-managed-item > *{
  max-width:100%!important;
}
@media (max-width:700px){
  main .page-layout-grid{
    grid-template-columns:repeat(12,minmax(0,1fr))!important;
  }
  main .page-layout-grid > .layout-managed-item{
    min-width:0!important;
  }
  
}

/* v0.8.8 — exact widths + working text size */
main .page-layout-grid{
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
}
.layout-managed-item strong,
.layout-managed-item h3,
.layout-managed-item h4,
.layout-managed-item .title,
.layout-managed-item .topic-title{
  font-size:var(--layout-font-size,inherit)!important;
  line-height:1.15!important;
}
.layout-managed-item small,
.layout-managed-item .subtitle,
.layout-managed-item .topic-subtitle{
  font-size:calc(var(--layout-font-size,16px) * .78)!important;
  line-height:1.2!important;
}
[data-smartpilot-helper-hidden="1"]{display:none!important}

/* v0.9.0 — Home Assistant route send */
.route-map-ha-status{margin:.35rem 0 0;font-size:.86rem}
.route-map-ha-status[data-state="ok"]{font-weight:700}
.route-map-ha-status[data-state="error"]{font-weight:700}
.route-map-ha-status[data-state="sending"]{font-style:italic}
.ha-route-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:9px!important}
.ha-route-check input{width:auto!important;min-height:auto!important}
@media (max-width:700px){.route-map-actions{display:flex;flex-wrap:wrap;gap:7px}.route-map-actions .button{flex:1 1 auto}}
