:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --line: #d9e0ea;
  --text: #15202e;
  --text-2: #4b5a6e;
  --muted: #7a8799;
  --accent: #0f4c81;
  --accent-ink: #ffffff;
  --accent-soft: #e3eef8;
  --r5: #1f8a4c; --r5-bg: #dff5e7;
  --r4: #4f9a2a; --r4-bg: #e9f5dc;
  --r3: #b7791f; --r3-bg: #fdf0d5;
  --r2: #c2410c; --r2-bg: #fde6d8;
  --r1: #b42318; --r1-bg: #fde2e0;
  --font-body: 'General Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(21, 32, 46, .06), 0 6px 20px -8px rgba(21, 32, 46, .12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
h2 { font-size: 20px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.fine { font-size: 13px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* header */
.top { background: #0b2540; color: #e6eef7; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: inline-flex; color: #8fc3f2; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-sub { color: #8fa6bf; font-size: 13px; margin-left: -4px; }
.top-meta { font-family: var(--font-mono); font-size: 12px; color: #8fa6bf; }

/* form */
.airport-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.airport-links:empty { display: none; }
.airport-menu { position: relative; display: inline-block; text-align: left; }
.airport-menu[open] { z-index: 30; }
.airport-trigger { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--accent-soft); color: var(--accent); font: 600 13px var(--font-mono); cursor: pointer; list-style: none; }
.airport-trigger::-webkit-details-marker { display: none; }
.airport-trigger::after { content: '⌄'; }
.airport-menu[open] > .airport-trigger::after { content: '⌃'; }
.airport-trigger:focus-visible, .airport-external:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.airport-popover { position: absolute; top: calc(100% + 8px); left: 0; width: 300px; max-width: calc(100vw - 24px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 12px 32px #15202e29; }
.airport-popover h3 { margin: 0 0 4px; font: 700 18px var(--font-mono); }
.airport-name, .airport-help { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.airport-help { margin: 8px 0 12px; }
.airport-external { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px; border-radius: 6px; color: var(--text); font-size: 16px; text-decoration: none; }
.airport-external:hover { background: var(--accent-soft); color: var(--accent); }
.airport-external span { color: var(--accent); }
.apt-title { display: flex; align-items: center; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { margin-top: 18px; padding: 16px; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.route-field, .submit-field, .route-hint { grid-column: 1 / -1; }
.route-hint { margin-top: -4px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 16px; background: #fff; color: var(--text); }
.field select { appearance: none; -webkit-appearance: none; font-family: var(--font-mono); padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234b5a6e' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
#route { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .02em; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 16px; }
.hint.err { color: var(--r1); }
.submit-field { display: flex; align-items: flex-end; }
.btn { height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); width: 100%; }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.ac-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ac-details summary { cursor: pointer; font-size: 14px; color: var(--text-2); font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
.ac-details summary .ac-sum { flex: 1; }
.ac-details summary::-webkit-details-marker { display: none; }
.ac-details summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.ac-details[open] summary::before { transform: rotate(45deg); }
.ac-name { font-weight: 600; color: var(--text); }
.ac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; margin-top: 12px; }
.ac-grid .field input { height: 38px; font-size: 15px; font-family: var(--font-mono); }
.ac-grid .span2 { grid-column: 1 / -1; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th { text-align: left; font-weight: 600; color: var(--text-2); padding: 4px 6px; font-size: 12px; }
.ac-table td { padding: 3px 6px; }
.ac-table input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-family: var(--font-mono); font-size: 14px; }
.ac-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* status */
.status { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.status .elapsed { margin-left: auto; font-size: 12px; opacity: .7; }
.status.err { background: var(--r1-bg); color: var(--r1); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* overview */
#overview { margin-top: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; font-family: var(--font-mono); }
.r5 { background: var(--r5-bg); color: var(--r5); }
.r4 { background: var(--r4-bg); color: var(--r4); }
.r3 { background: var(--r3-bg); color: var(--r3); }
.r2 { background: var(--r2-bg); color: var(--r2); }
.r1 { background: var(--r1-bg); color: var(--r1); }
.grid-head, .grid-row { display: grid; grid-template-columns: 56px repeat(3, minmax(0, 1fr)); gap: 6px; }
.grid-head { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 6px; }
.grid-head div { text-align: center; }
.grid-head div:first-child { text-align: left; }
.grid { display: flex; flex-direction: column; gap: 6px; }
.day { display: flex; flex-direction: column; justify-content: center; font-weight: 600; font-size: 14px; line-height: 1.2; }
.day small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.day .rel { color: var(--accent); font-size: 11px; font-weight: 600; }
.cell { text-align: left; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 8px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 96px; position: relative; box-shadow: 0 1px 2px rgba(21,32,46,.04); transition: border-color .12s, transform .12s; }
.cell:hover { border-color: var(--accent); }
.cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cell.nodata { cursor: default; color: var(--muted); justify-content: center; align-items: center; font-size: 12px; background: var(--surface-2); }
.cell .score { font-family: var(--font-mono); font-weight: 600; font-size: 20px; line-height: 1; display: inline-flex; align-items: baseline; gap: 2px; padding: 4px 7px; border-radius: 6px; align-self: flex-start; }
.cell .score small { font-size: 11px; font-weight: 500; opacity: .8; }
.cell .kv { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.cell .kv .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.cell .kv .v { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.cell .kv .u { color: var(--muted); font-size: 11px; margin-left: 3px; font-family: var(--font-body); }
.cell .wind { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); display: flex; justify-content: space-between; gap: 4px; white-space: nowrap; }
.cell .wind .fl { color: var(--muted); }
.cell .wind.hw { color: var(--r2); }
.cell .wind.tw { color: var(--r5); }
.cell-altitudes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.cell-altitudes.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cell-altitude.best-rated .alt-label { color: var(--accent); font-weight: 600; }
.alt-score { font: 600 12px var(--font-mono); padding: 1px 5px; border-radius: 4px; }
.alt-score small { font-size: 10px; opacity: .8; }
.cell-altitude .alt-score { align-self: flex-start; font: 600 12px var(--font-mono); padding: 1px 5px; border-radius: 4px; }
.cell-altitude .alt-score small { font-size: 10px; opacity: .8; }
.cell-altitude { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-altitude .alt-label { color: var(--text-2); font-size: 12px; line-height: 1.25; }
.cell-altitude .alt-value { color: var(--text); font: 600 12px var(--font-mono); white-space: nowrap; }
.cell-altitude .alt-stat { color: var(--text); font: 500 13px var(--font-mono); white-space: nowrap; }
.cell-altitude .alt-stat .u { color: var(--muted); font: 11px var(--font-body); }
@media (max-width: 600px) {
  .cell-altitudes, .cell-altitudes.cols-3 { grid-template-columns: 1fr; gap: 6px; }
}

/* detail */
.altitude-options { margin-top: 20px; scroll-margin-top: 16px; }
.altitude-flight { margin: -2px 0 12px; color: var(--text-2); font-size: 14px; }
.altitude-options tr[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.detail { margin-top: 26px; }
.detail-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.detail-head h2 { font-size: 22px; }
.detail-head .when { color: var(--text-2); margin-top: 2px; }
.score-big { display: flex; align-items: center; gap: 12px; }
.score-big .n { font-family: var(--font-mono); font-size: 34px; font-weight: 600; line-height: 1; padding: 8px 12px; border-radius: 10px; }
.score-big .n small { font-size: 14px; font-weight: 500; opacity: .75; }
.score-big .lab { font-weight: 600; font-size: 15px; }
.score-big .lab small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-family: var(--font-mono); font-size: 20px; font-weight: 600; margin-top: 2px; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.narr { font-size: 16px; line-height: 1.6; }
.narr p { margin: 0 0 10px; }
.narr p:last-child { margin: 0; }
.two { display: grid; grid-template-columns: 1fr; gap: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 7px 6px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .best td { background: var(--accent-soft); }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); margin-right: 4px; }
.tag.ovc, .tag.bkn { background: #dfe6ef; color: #2c3e55; }
.tag.ice { background: var(--r1-bg); color: var(--r1); }
.ded { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.ded.zero { color: var(--r5); }
.ded.minus { color: var(--r2); }
.alt-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.alt-tab { font-family: var(--font-mono); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text-2); }
.alt-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.alt-tab .sub { font-weight: 400; opacity: .8; }
.legs { display: grid; gap: 8px; }
.leg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.leg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.leg-range { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.leg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 8px; }
.ms .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ms .v { font-family: var(--font-mono); font-weight: 600; font-size: 15px; white-space: nowrap; }
.ms .v small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; font-family: var(--font-body); }
.leg-clouds { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; }
.leg-clouds .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.apt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.apt-head .t { font-family: var(--font-mono); color: var(--muted); font-size: 12px; }
.apt-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; display: grid; gap: 4px; }
.apt-list li { display: flex; gap: 8px; }
.apt-list .k { color: var(--muted); min-width: 68px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
.back { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 8px; }
.foot { margin: 36px auto 24px; font-size: 12px; color: var(--muted); }

@media (min-width: 720px) {
  form { grid-template-columns: 2fr 1fr 1fr .8fr .8fr auto; align-items: end; }
  .route-field, .submit-field { grid-column: auto; }
  .route-hint { grid-column: 1 / -1; }
  .btn.primary { width: auto; min-width: 140px; }
  .ac-grid { grid-template-columns: repeat(4, 1fr); }
  .ac-grid .span2 { grid-column: span 2; }
  .grid-head, .grid-row { grid-template-columns: 120px repeat(3, minmax(0, 1fr)); gap: 10px; }
  .grid { gap: 10px; }
  .cell { padding: 12px 14px 10px; min-height: 104px; }
  .cell .score { font-size: 22px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .two { grid-template-columns: 1fr 1fr; }
  .leg { display: grid; grid-template-columns: 190px 1fr; gap: 6px 16px; align-items: center; }
  .leg-head { flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; }
  .leg-clouds { grid-column: 2; margin-top: 0; }
  .tscroll { margin: 0; padding: 0; }
  table.t { font-size: 14px; }
}
@media (max-width: 719px) {
  .brand-sub, .top-meta { display: none; }
  .cell .kv .k { display: none; }
  .cell .kv { font-size: 13px; }
  .cell .score { font-size: 18px; }
  .cell .wind { font-size: 11px; }
  .day { font-size: 13px; }
  .leg-stats { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px 12px; }
  .ms .v { font-size: 14px; }
  table.t th, table.t td { padding-left: 4px; padding-right: 4px; }
}

/* NOTAMs */
.notams { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.notam-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.notam-head .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.notam-sum { color: var(--text-2); margin-bottom: 6px; }
.notam-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.notam-list li { display: flex; gap: 6px; align-items: flex-start; }
.notam-list li .tag { flex: none; min-width: 64px; text-align: center; }
.notam-list .ntx { font-family: var(--font-mono); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.notam-list li.alert .ntx { color: var(--r1); }
.notams details summary { cursor: pointer; color: var(--accent, #0f4c81); margin-top: 6px; }
.notams details .notam-list { margin-top: 6px; }
.notams a { color: var(--accent); }

/* aircraft ID */
.tail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); align-items: end; }
.tail-row #tail { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .02em; }
.tail-btns { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.tail-btns .btn:not(.small) { flex: 1; }
.tail-hint { grid-column: 1 / -1; margin-top: -4px; }
.tail-hint.ok { color: var(--r5); }
.tail-hint.warn { color: var(--r3); }
@media (min-width: 720px) {
  .tail-row { grid-template-columns: 1fr 1.4fr auto; }
  .tail-btns { grid-column: auto; }
  .tail-btns .btn:not(.small) { flex: none; min-width: 110px; }
}

/* step altitudes */
.step-table td { vertical-align: top; }
.step-table .step-alt { font-weight: 700; font-size: 14px; }
.step-arrow { color: var(--accent); margin-left: 2px; }
.tag.ok { background: var(--r5-bg); color: var(--r5); }
.step-table .tag { margin-top: 3px; }
.step-total td { border-top: 2px solid var(--line); background: var(--surface-2); }
.step-table td.mono .fine { font-family: inherit; }

/* route profiles */
.profiles { margin-top: 24px; }
.prof-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 4px 0 10px; scrollbar-width: thin; }
.prof-day { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; color: inherit; }
.prof-day small { color: var(--muted); }
.prof-day.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); font-weight: 600; }
.prof-day .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prof-day .dot.r5 { background: var(--r5); } .prof-day .dot.r4 { background: var(--r4); } .prof-day .dot.r3 { background: var(--r3); } .prof-day .dot.r2 { background: var(--r2); } .prof-day .dot.r1 { background: var(--r1); }
.prof-list { display: flex; flex-direction: column; gap: 10px; }
.prof { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 4px; cursor: pointer; transition: border-color .12s; }
.prof:hover { border-color: var(--accent); }
.prof.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); cursor: default; }
.prof.nodata { cursor: default; background: var(--surface-2); padding: 10px; }
.prof-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; font-size: 13px; }
.prof-head .score { font-family: var(--font-mono); font-weight: 600; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.prof-head .score small { font-size: 10px; opacity: .8; }
.prof-meta { font-size: 12.5px; }
.prof-note { font-size: 12px; }
.prof-svg { display: block; }
.prof-svg .pg { stroke: var(--line); stroke-width: 1; }
.prof-svg .pt { font-size: 10px; fill: var(--muted); font-family: var(--font-mono); }
.prof-svg .pc { fill: #7f9bb5; }
.prof-svg .ptr { fill: #8a7560; fill-opacity: .85; }
.prof-svg .pfz { fill: none; stroke: #2f7fd1; stroke-width: 1.5; stroke-dasharray: 5 3; }
.prof-svg .pceil { stroke: #c0392b; stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.prof-svg .pfp { fill: none; stroke: var(--text, #15202e); stroke-width: 2.2; stroke-linejoin: round; }
.prof-svg .pw { font-size: 10.5px; font-family: var(--font-mono); font-weight: 600; fill: var(--muted); }
.prof-svg .pw.tw { fill: var(--r5); } .prof-svg .pw.hw { fill: var(--r1); }
.prof-svg .pwl { stroke: var(--line); stroke-dasharray: 2 3; }
.prof-svg .pwp { fill: var(--text, #15202e); font-weight: 600; }
.prof-svg .pfl { fill: var(--text, #15202e); }
.prof-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.prof-legend i { display: inline-block; width: 14px; height: 8px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }

.prof-svg .pb line { stroke: #6b7a8c; stroke-width: 1.1; stroke-linecap: round; }
.prof-svg .pb .flag, .prof-svg .pb circle { fill: #6b7a8c; stroke: none; }
.prof-svg .pb circle { fill: none; stroke: #6b7a8c; }
.prof-svg .pb.hi line { stroke: #15202e; stroke-width: 1.4; }
.prof-svg .pb.hi .flag { fill: #15202e; }

.vfr-field .check { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; }
.vfr-field .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.vfr-hint { grid-column: 1 / -1; }
.cell.novfr { flex-direction: column; gap: 4px; text-align: center; padding: 8px; }
.cell.novfr b { color: var(--r1); font-size: 13px; }
.cell.novfr small { font-size: 11px; line-height: 1.3; }

/* Local FAA Excel snapshots, visually separate from weather and live feeds. */
.notam-import { margin-top: 16px; padding: 18px 22px; }
.notam-import h2 { font-size: var(--text-base, 16px); margin: 0 0 5px; }
.notam-import p { margin: 5px 0 10px; }
.notam-import-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notam-import-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.notam-import-actions label { cursor: pointer; white-space: nowrap; }
.notam-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.notam-import-actions:has(.notam-file:focus-visible) label { outline: 3px solid var(--accent); outline-offset: 3px; }
.notam-import-actions:has(.notam-file:disabled) label { opacity: .6; cursor: wait; }
#notamImportStatus, #notamImportCoverage { margin-top: 6px; overflow-wrap: anywhere; }
.notam-import-location { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.notam-import-location > summary { font-size: var(--text-sm, 14px); font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.notam-import-notices { display: grid; gap: 8px; margin-top: 12px; }
.notam-full { min-width: 0; flex: 1; }
.notam-full summary { cursor: pointer; font-size: var(--text-xs, 13px); overflow-wrap: anywhere; }
.notam-raw { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono, monospace); font-size: var(--text-xs, 13px); background: var(--surface); border: 1px solid var(--line); padding: 10px; border-radius: 6px; margin: 8px 0; }
.notam-warning { color: #8a5013; }
.notam-import [hidden] { display: none !important; }
@media (max-width: 650px) {
  .notam-import { padding: 16px; }
  .notam-import-head { align-items: flex-start; flex-direction: column; gap: 6px; }
}

/* route profile + prog chart side by side */
.prof-body { display: block; }
.prof-body.split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 10px; align-items: start; }
.prof-prog { margin: 2px 0 6px; }
.prof-body:not(.split) .prof-prog { margin-top: 8px; }
.prog-svg { display: block; border-radius: 8px; overflow: hidden; }
.prog-svg .pgm-bg { fill: #f3f6f9; }
.prog-svg .pgm-coast { fill: none; stroke: #7d8a96; stroke-width: 1; }
.prog-svg .pgm-state { fill: none; stroke: #a9b4be; stroke-width: .8; }
.prog-svg .pgm-route-halo { fill: none; stroke: #fff; stroke-width: 5; stroke-linejoin: round; opacity: .85; }
.prog-svg .pgm-route { fill: none; stroke: #15202e; stroke-width: 2.4; stroke-linejoin: round; }
.prog-svg .pgm-wp { fill: #15202e; stroke: #fff; stroke-width: 1.2; }
.prog-svg .pgm-wpt { font: 600 10.5px var(--font-mono); fill: #15202e; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.prog-svg .pgm-h { font: 800 17px var(--font-body, sans-serif); fill: #1f5fd6; }
.prog-svg .pgm-l { font: 800 17px var(--font-body, sans-serif); fill: #d63a2f; }
.prog-svg .pgm-p { font: 500 9.5px var(--font-mono); fill: #44505c; paint-order: stroke; stroke: #f3f6f9; stroke-width: 3px; }
.prog-svg .pgm-lbg { fill: #fff; fill-opacity: .9; stroke: var(--line); }
.prog-svg .pgm-lbl { font: 600 10.5px var(--font-mono); fill: #15202e; }
.prog-svg .pgm-msg { font: 500 11px var(--font-body, sans-serif); fill: #44505c; paint-order: stroke; stroke: #f3f6f9; stroke-width: 3px; }
.prog-legend { margin-top: 4px; }
.prog-legend a { color: var(--accent); }

/* route + reverse button */
.route-row { display: flex; gap: 8px; align-items: stretch; }
.route-row input { flex: 1 1 auto; min-width: 0; }
.btn-reverse { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; cursor: pointer; }
.btn-reverse:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 420px) { .btn-reverse span { display: none; } }

/* altitude options: per-factor deductions */
.alt-table th.ded-group { text-align: center; font-size: 11px; border-bottom: 0; padding-bottom: 2px; }
.alt-table th.ded-h { font-size: 10.5px; padding: 4px 6px; border-top: 3px solid var(--dc); }
.alt-table td.ded-c { padding-left: 6px; padding-right: 6px; box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--dc) 7%, transparent); }
.alt-table td.ded-c .ded.zero { color: var(--muted, #8a8f98); font-weight: 400; }
.dh0 { --dc: #1e9be8; } .dh1 { --dc: #8ccbe0; } .dh2 { --dc: #a7c98a; } .dh3 { --dc: #1fa35a; }
.dh4 { --dc: #f08a4b; } .dh5 { --dc: #e8c400; } .dh6 { --dc: #9aa0a6; } .dh7 { --dc: #e0352b; } .dh8 { --dc: #8e3bd6; } .dh9 { --dc: #a0612b; }

/* grid cell: top-3 deduction mini chart */
.cell-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cell-top-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ded-chart { flex: 0 1 52%; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; row-gap: 3px; align-items: center; font-size: 11px; }
.ded-chart .dc-scale { grid-column: 2; display: flex; justify-content: space-between; font: 600 10px var(--font-mono); color: var(--muted); line-height: 1; }
.ded-chart .dc-axis { grid-column: 2; height: 6px; border-radius: 3px; background: #2f7f99; margin-bottom: 3px; }
.ded-chart .dc-row { display: contents; }
.ded-chart .dc-lab { color: var(--text-2); text-align: right; white-space: nowrap; line-height: 1.2; }
.ded-chart .dc-track { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.ded-chart .dc-bar { display: block; height: 7px; border-radius: 2px; background: var(--dc); min-width: 3px; }
.ded-chart .dc-val { font: 600 10px var(--font-mono); color: var(--r2); white-space: nowrap; }
@media (max-width: 520px) { .cell-top { flex-direction: column; gap: 6px; } .ded-chart { flex-basis: auto; width: 100%; } }

/* stronger selected-brief indicator */
.cell { overflow: visible; }
.cell.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(21,32,46,.12); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cell.sel::after { content: "Showing below ↓"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font: 600 10.5px var(--font-body); letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.signout { margin-left: 12px; font-size: 13px; color: #cfe0f2; text-decoration: none; font-weight: 600; white-space: nowrap; }
.signout:hover { text-decoration: underline; }

/* overview: condensed vs expanded */
.btn-view { font: 600 12px var(--font-body); padding: 3px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; margin-right: 4px; }
.btn-view:hover { background: var(--accent-soft); }
.cell-score-row { display: flex; align-items: center; gap: 10px; }
.cell-avg { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; white-space: nowrap; }
.cell-avg b { font: 600 14px var(--font-mono); color: var(--text); }
.cell-avg .u { color: var(--muted); font-size: 11px; }
.grid:not(.compact) .cell-avg { display: none; }
.grid.compact .cell-altitudes { display: none; }
.grid.compact .cell { min-height: 0; }
.grid.compact .ded-chart .dc-scale, .grid.compact .ded-chart .dc-axis { display: none; }
.grid.compact .ded-chart { align-self: center; }

/* phone: extra-tight condensed boxes */
.dc-stack, .ded-legend { display: none; }
@media (max-width: 520px) {
  #overview:has(.grid.compact) .ded-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--text-2); margin: 0 0 6px; }
  .ded-legend span::before { content: ""; display: inline-block; width: 10px; height: 6px; border-radius: 2px; background: var(--dc); margin-right: 4px; vertical-align: middle; }
  .ded-legend .dl-note { color: var(--muted); }
  .ded-legend .dl-note::before { display: none; }
  .grid.compact .cell { padding: 6px 6px 7px; gap: 2px; }
  .cell.sel::after { content: "Below ↓"; font-size: 9.5px; padding: 1px 6px; top: -8px; }
  .grid.compact .cell-top { flex-direction: column; gap: 2px; }
  .grid.compact .cell-top-l { gap: 2px; }
  .grid.compact .cell-score-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .grid.compact .cell .score { font-size: 15px; padding: 2px 5px; }
  .grid.compact .cell .score small { font-size: 9px; }
  .grid.compact .cell-avg { flex-direction: row; align-items: baseline; gap: 4px; font-size: 11px; }
  .grid.compact .cell-avg b { font-size: 11.5px; }
  .grid.compact .cell-avg .u { font-size: 10px; }
  .grid.compact .cell .wind { font-size: 10.5px; }
  .grid.compact .ded-chart { display: block; width: 100%; }
  .grid.compact .ded-chart .dc-row, .grid.compact .ded-chart .dc-scale, .grid.compact .ded-chart .dc-axis { display: none; }
  .grid.compact .dc-stack { display: flex; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 2px; }
  .grid.compact .dc-stack span { display: block; height: 100%; background: var(--dc); }
  .grid.compact .dc-stack span + span { border-left: 1px solid var(--surface); }
}
.airport-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; max-width: 100%; }
.airport-label { font-size: 12px; color: var(--text-2); line-height: 1.2; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.airport-links { align-items: flex-end; gap: 8px 12px; }
@media (max-width: 520px) { .airport-label { max-width: 160px; font-size: 11px; } }
/* live radar */
.radar-card { padding: 16px; margin: 16px 0; }
.radar-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; margin-bottom: 8px; }
.radar-head h2 { margin: 0; font-size: 18px; }
.radar-ctl { display: flex; gap: 6px; flex-wrap: wrap; }
.radar-slider { width: 100%; margin: 4px 0 8px; accent-color: var(--accent); }
.radar-map { height: 420px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; background: #e8edf2; }
.radar-sig { margin-top: 8px; font-weight: 500; }
.radar-sig.warn { color: #b3261e; }
.radar-raw { white-space: pre-wrap; font: 11px/1.4 var(--font-mono); margin: 6px 0 0; max-height: 160px; overflow: auto; }
.radar-wpt { background: transparent; border: 0; box-shadow: none; font: 600 11px var(--font-mono); color: #0b2a44; text-shadow: 0 0 3px #fff, 0 0 3px #fff; padding: 0; }
.radar-wpt::before { display: none; }
@media (max-width: 520px) { .radar-map { height: 320px; } .radar-card { padding: 12px; } .radar-map .leaflet-control-attribution { font-size: 8px; line-height: 1.3; max-width: 70%; } }
.cell-when { display: block; font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.radar-wrap { position: relative; }
.radar-badge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 900; background: #6b3fa0; color: #fff; font: 700 12px var(--font-mono); letter-spacing: .04em; padding: 4px 10px; border-radius: 12px; pointer-events: none; }
#radarTime.fc { color: #6b3fa0; font-weight: 600; }
.radar-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* runway crosswind */
.rwy-panel .two { align-items: start; }
.rwy-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.rwy-svg { width: 200px; height: 200px; flex: none; }
.rwy-ring { fill: none; stroke: var(--line); stroke-dasharray: 3 4; }
.rwy-card { font-size: 11px; fill: var(--muted); text-anchor: middle; font-weight: 600; }
.rwy-strip { stroke: var(--muted); stroke-linecap: butt; }
.rwy-strip.best { stroke: #1f8a70; }
.rwy-id { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; font-size: 11px; text-anchor: middle; fill: var(--text); font-weight: 600; font-family: var(--font-mono); }
.rwy-id.best { fill: #1f8a70; }
.rwy-wind { stroke: #2563eb; stroke-width: 3; }
.rwy-arrowhead { fill: #2563eb; }
.rwy-wind-lab { display: flex; flex-direction: column; gap: 2px; }
.rwy-t tr.best td { font-weight: 600; }
.rwy-t td { white-space: nowrap; }
