/* Mach Corridor — UI. Chart-room aesthetic: light instrument chrome around a night-blue map. */
:root {
  --paper: #f4f6f9; --surface: #ffffff; --surface-2: #eef1f5; --ink: #0f1b2d; --ink-2: #46546a; --ink-3: #5f6b81;
  --rule: #e2e7ee; --accent: #1f4fd8; --good: #0f7553; --bad: #c42b3a; --warn: #965a00; --mach: #17408f; --dis: #a21caf;
  --low-soft: rgba(10, 31, 92, .07); --float: rgba(255, 255, 255, .95);
  --stage: #061029; --coast: rgba(226, 235, 252, .62); --border-c: rgba(226, 235, 252, .2); --grat: rgba(226, 235, 252, .06); --casing: #061029;
  --route-boomless: #e0218a; --route-super: #13a89e; --route-sub: #f08a24;
  --text: var(--ink); --text-2: var(--ink-2); --muted: var(--ink-3); --line: var(--rule); --ocean: var(--stage);
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0f18; --surface: #111824; --surface-2: #182131; --ink: #e8eef7; --ink-2: #a6b2c4; --ink-3: #8492a8;
    --rule: #1f2a3b; --accent: #7ca2ff; --good: #3ccb8f; --bad: #ff6b78; --warn: #f0a33a; --mach: #9fbdf0; --dis: #f0abfc;
    --low-soft: rgba(159, 189, 240, .08); --float: rgba(17, 24, 36, .94);
    --route-boomless: #ff4fa8; --route-super: #2fd3c4; --route-sub: #ffa040;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0f18; --surface: #111824; --surface-2: #182131; --ink: #e8eef7; --ink-2: #a6b2c4; --ink-3: #8492a8;
  --rule: #1f2a3b; --accent: #7ca2ff; --good: #3ccb8f; --bad: #ff6b78; --warn: #f0a33a; --mach: #9fbdf0; --dis: #f0abfc;
  --low-soft: rgba(159, 189, 240, .08); --float: rgba(17, 24, 36, .94);
  --route-boomless: #ff4fa8; --route-super: #2fd3c4; --route-sub: #ffa040;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.5 "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-3); font-weight: 400; }
.fine { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.warn { color: var(--bad); font-weight: 500; }

.app { display: grid; grid-template-rows: 52px 1fr; height: 100vh; }

.bar { display: flex; align-items: center; gap: 28px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs button { border: 0; background: none; padding: 0 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.status { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.badge { border: 1px solid var(--rule); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--ink-2); }
.badge:hover { color: var(--ink); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 7px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 5px; padding: 3px 9px; font-size: 12.5px; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .14); font-weight: 500; }
.chip { border: 1px solid var(--rule); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 500; }
input[type=range] { accent-color: var(--ink); width: 100%; }
input[type=range]:disabled { opacity: .35; }
select, input[type=number], input[list], input:not([type]) { height: 32px; border: 1px solid var(--rule); border-radius: 7px; background: var(--surface); padding: 0 8px; width: 100%; min-width: 0; }
input[list], input:not([type]) { text-transform: uppercase; }
.btn { height: 34px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 0 14px; font-weight: 500; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn:disabled { opacity: .5; cursor: default; }
.icon { border: 0; background: none; width: 32px; height: 32px; border-radius: 7px; color: var(--ink-2); display: grid; place-items: center; }
.icon:hover { background: var(--surface-2); }
.chk { display: flex; gap: 7px; align-items: center; min-height: 24px; font-size: 12.5px; color: var(--ink-2); }

.mapview { display: grid; grid-template-columns: 1fr 400px; min-height: 0; }
.stage { position: relative; background: var(--stage); overflow: hidden; min-height: 420px; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.globe { position: absolute; inset: 0; }
.globe canvas { width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.float { position: absolute; background: var(--float); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 8px 28px rgba(2, 8, 24, .28); backdrop-filter: blur(8px); z-index: 2; }
.layers { top: 12px; left: 12px; padding: 10px 12px; display: grid; gap: 7px; width: 404px; }
#flSeg { flex-wrap: nowrap; }
.layers .row { display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; align-items: center; }
.layers .row.r4 { grid-template-columns: 76px 1fr auto auto; }
.layers .row > .seg, .layers .row > select { grid-column: 2 / 4; justify-self: start; }
.layers .k { font-size: 12px; color: var(--ink-3); }
.layers .v { font-size: 12.5px; min-width: 40px; text-align: right; color: var(--ink); }
.layers select { height: 28px; width: auto; }
.legend { left: 12px; bottom: 76px; padding: 10px 12px; width: 268px; font-size: 12px; }
.layersToggle { display: none; }
.chks { display: flex; flex-wrap: wrap; gap: 6px 14px; grid-column: 2 / 4; }
.pickhint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--route-boomless); color: #fff; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 999px; z-index: 3; }
#routeFromHere, #routeToHere { width: 100%; }
.lt { font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
#legendBar { display: block; width: 240px; height: 10px; border-radius: 2px; outline: 1px solid var(--rule); }
.lticks { width: 240px; height: 16px; position: relative; color: var(--ink-2); margin-top: 2px; }
.lticks span { position: absolute; transform: translateX(-50%); }
.lticks span:last-child { transform: translateX(-100%); }
.ln { margin: 4px 0 6px; color: var(--ink-3); line-height: 1.4; }
.legend .chk { margin-top: 2px; }
.timeline { left: 12px; right: 12px; bottom: 12px; padding: 8px 14px 6px 8px; display: flex; gap: 12px; align-items: center; }
.play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); display: grid; place-items: center; flex: none; }
.tl { flex: 1; min-width: 0; }
.tticks { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); }
.tticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tticks span:first-child { transform: none; }
.tval { font-size: 12.5px; white-space: nowrap; min-width: 150px; text-align: right; }
.hint { position: absolute; right: 14px; top: 12px; font-size: 12px; color: rgba(226, 235, 252, .7); z-index: 1; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 10px; font-size: 12px; box-shadow: 0 6px 18px rgba(2, 8, 24, .3); white-space: nowrap; z-index: 3; }
.tip b { font-size: 14px; }
.tip .muted { color: var(--ink-3); }

.drawer { background: var(--surface); border-left: 1px solid var(--rule); overflow-y: auto; }
.sec { padding: 18px 20px; border-bottom: 1px solid var(--rule); }
.sec h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
.sec h3 { font-size: 12.5px; margin: 18px 0 6px; color: var(--ink-2); font-weight: 500; }
.sec h3 span { color: var(--ink-3); font-weight: 400; }
.empty { color: var(--ink-3); margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sv { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.sk { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }
.insphead { display: flex; justify-content: space-between; align-items: baseline; }
.insphead span { color: var(--ink-3); font-size: 12.5px; }
.inspgrid { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; margin: 8px 0 12px; }
#polar { width: 150px; height: 150px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }
#open3d { width: 100%; }
#ts, #rprof, #rLadder { width: 100%; height: auto; overflow: visible; }
svg text { fill: var(--ink-2); font: 10px "IBM Plex Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.axis line, .axis path { stroke: var(--rule); }
.gridl { stroke: var(--rule); }
.routein { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: end; }
.btn.swap { padding: 0 9px; color: var(--ink-2); }
.btn.swap:hover { color: var(--ink); }
.routein label, .routeparams label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.routeparams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rsum { font-size: 13px; margin-top: 14px; line-height: 1.5; }
.rsum b { font-weight: 600; }
.verdict { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--good); background: var(--surface-2); border-radius: 0 7px 7px 0; }
.verdict.neg { border-left-color: var(--bad); }
.kgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; margin-top: 14px; }
.kgrid .kv { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.kgrid .kl { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.keyrow { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.keyrow.col { flex-direction: column; }
.sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 6px 6px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.tbl tr.hl td { font-weight: 600; }
.tbl tr.cur td { background: var(--surface-2); }
.tbl td.wrap { white-space: normal; min-width: 260px; text-align: left !important; color: var(--ink-3); font-size: 12px; }

.page { overflow-y: auto; padding: 32px 24px 48px; }
.page > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.page h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.phead p { margin: 0; color: var(--ink-2); max-width: 64ch; }
.einputs { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.einputs label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); width: 116px; }
.acchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.acchips button { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 9px; font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.acchips button i { width: 10px; height: 10px; border-radius: 50%; }
.acchips button.on { border-color: var(--ink); color: var(--ink); font-weight: 500; }
.progress { display: flex; align-items: center; gap: 12px; margin: 16px auto 4px; font-size: 12.5px; color: var(--ink-3); }
.pbar { width: 160px; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; flex: none; }
.pbar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.kpirow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.kpi { padding: 16px 18px; border-right: 1px solid var(--rule); }
.kpi:last-child { border-right: 0; }
.kpi .kl { font-size: 12px; color: var(--ink-3); }
.kpi .kv { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; }
.kpi .kd { font-size: 12px; margin-top: 4px; color: var(--ink-2); }
.pos { color: var(--good) !important; } .neg { color: var(--bad) !important; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panel { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 16px 10px; }
.panel figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.panel figcaption b { font-weight: 600; font-size: 14px; }
.panel figcaption span { font-size: 12.5px; color: var(--ink-3); }
.panel svg { width: 100%; height: auto; display: block; overflow: visible; }
.h2 { font-size: 17px; font-weight: 600; margin: 34px auto 12px; }
.h2 .muted { font-size: 13px; margin-left: 8px; }
.routegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.rcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; }
.rcard:hover { border-color: var(--ink-3); }
.rcard.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.rcard svg { display: block; width: 100%; height: auto; background: var(--stage); }
.rcard .rb { padding: 10px 12px 12px; }
.rcard .rt { display: flex; justify-content: space-between; align-items: baseline; }
.rcard .rt b { font-size: 14px; }
.rcard .rt span { font-size: 12px; color: var(--ink-3); }
.rcard .rn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.rcard .rn div { font-size: 11.5px; color: var(--ink-3); line-height: 1.25; }
.rcard .rn b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.rcard .open { font-size: 12px; margin-top: 8px; color: var(--accent); background: none; border: 0; padding: 0; }
.tscroll { overflow-x: auto; }
.method article { max-width: 680px; }
.method h2 { font-size: 17px; font-weight: 600; margin: 28px 0 6px; }
.method p, .method li { color: var(--ink-2); line-height: 1.65; }
.method .lead { font-size: 16.5px; color: var(--ink); }
.eq { font-size: 15px; background: var(--surface); border: 1px solid var(--rule); padding: 12px 14px; border-radius: 8px; overflow-x: auto; color: var(--ink) !important; }

dialog { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 16px 20px; }
dialog::backdrop { background: rgba(2, 8, 24, .55); }
dialog.big { width: min(1240px, 96vw); max-width: none; height: min(820px, 92vh); }
dialog.big[open] { display: flex; flex-direction: column; }
.d3head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.d3head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.d3head h2 span { color: var(--ink-3); font-weight: 400; }
.d3head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.d3body { flex: 1; display: grid; grid-template-columns: 1fr 300px; gap: 16px; min-height: 0; margin-top: 10px; }
.c3canvas { position: relative; background: var(--stage); border-radius: 10px; overflow: hidden; min-height: 300px; }
.c3canvas canvas { width: 100% !important; height: 100% !important; display: block; }
.c3side { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.c3side .k { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; }
.c3side .k output { color: var(--ink); font-weight: 500; }
.c3stats { font-size: 12.5px; line-height: 1.5; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
#c3Ceff { width: 100%; height: auto; margin-top: 4px; }

@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { height: auto; min-height: 100dvh; grid-template-rows: auto 1fr; }
  input, select, textarea { font-size: 16px !important; }
  .layersToggle { display: flex; gap: 8px; align-items: center; top: 10px; left: 10px; padding: 7px 12px; font-size: 13px; font-weight: 500; color: var(--ink); }
  .layers { top: 52px; left: 10px; right: 10px; width: auto; display: none; z-index: 4; max-height: calc(100% - 120px); overflow-y: auto; }
  .layers.open { display: grid; }
  .layers .row { grid-template-columns: 70px 1fr auto; }
  .layers .seg button { padding: 6px 9px; font-size: 13px; }
  .legend { display: block; left: auto; right: 10px; top: 10px; bottom: auto; width: auto; padding: 6px 9px 4px; font-size: 10.5px; }
  .legend .ln { display: none; }
  .legend .lt { font-size: 11px; margin-bottom: 4px; }
  #legendBar, .lticks { width: 132px; }
  .lticks { height: 13px; }
  .lticks span:nth-child(2) { display: none; }
  .layers .row > .seg { justify-self: stretch; display: flex; }
  .layers .row > .seg button { flex: 1; padding: 6px 4px; }
  .timeline { left: 10px; right: 10px; bottom: 10px; }
  .stage { min-height: 0; height: 64dvh; }
  .einputs { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; }
  .einputs label { width: auto; }
  .einputs .btn { grid-column: 1 / 4; }
  .progress { flex-wrap: wrap; }
  dialog.big { width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding: 12px; }
  .d3body { overflow-y: auto; }
  .c3canvas { min-height: 44dvh; }
  .routeparams { grid-template-columns: 1fr 1fr; }
  .routein { grid-template-columns: 1fr auto 1fr; }
  .routein #routeGo { grid-column: 1 / 4; }
  .bar { flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px 0; }
  .tabs { order: 3; width: 100%; height: 38px; }
  #runInfo { display: none; }
  .mapview { grid-template-columns: 1fr; }
  .hint { display: none; }
  .tval { min-width: 0; font-size: 11.5px; }
  .tticks { display: none; }
  .drawer { border-left: 0; border-top: 1px solid var(--rule); }
  .d3body { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 40px; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
#rprof { cursor: pointer; }
.c3route { border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 4px; }
#c3Strip { width: 100%; height: auto; overflow: visible; margin-top: 4px; }
.c3play { display: flex; gap: 10px; align-items: center; }
.c3play .play.on { background: var(--route-boomless); }
.c3pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c3pair .k { flex-direction: column; gap: 4px; }

.inset { position: absolute; right: 12px; bottom: 12px; width: 168px; height: 168px; z-index: 2; pointer-events: none;
  background: rgba(6, 16, 41, .78); border: 1px solid rgba(226, 235, 252, .22); border-radius: 50%; }

/* phone-only overrides that must follow the base rules above */
@media (max-width: 900px) {
  .inset { width: 104px; height: 104px; right: 8px; bottom: 8px; }
  .btn, .seg button, .play { min-height: 38px; }
  .chk { min-height: 32px; display: flex; align-items: center; gap: 8px; }
  .chk input { width: 18px; height: 18px; }
  .pickhint { top: 56px; max-width: calc(100% - 24px); text-align: center; }
}
@media (max-width: 420px) {
  .layers .row { grid-template-columns: 60px 1fr auto; }
}

@media (max-width: 900px) {
  .tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
  #c3Sub { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #c3Sub.open { -webkit-line-clamp: unset; }
  .acchips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .acchips button { flex: none; }
  .timeline { padding: 6px 10px 6px 6px; gap: 10px; }
  .timeline .play { width: 36px; height: 36px; min-height: 36px; }
}
@media (max-width: 600px) {
  /* keep chart text legible on phones: charts keep a minimum width and scroll sideways */
  .grid2 figure.panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .grid2 figure.panel > svg { min-width: 460px; }
  .grid2 figure.panel figcaption { position: sticky; left: 0; }
}

.plain { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: 10px; padding: 14px 18px 6px; margin: 16px 0 12px; }
.plain:empty { display: none; }
.plain h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.plain ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.plain li { padding-bottom: 8px; }
.plain b { color: var(--ink); }

.insights { padding-left: 22px; display: grid; gap: 10px; line-height: 1.55; margin: 8px 0 18px; }
.insights b { color: var(--ink); }

.c3phase { position: absolute; left: 14px; top: 12px; z-index: 3; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  color: #fff; background: rgba(6, 16, 41, .72); border: 1px solid rgba(226, 235, 252, .25); pointer-events: none; }
.c3phase[hidden] { display: none; }

.dirhint { right: 12px; top: 12px; padding: 7px 8px 7px 14px; display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); max-width: min(560px, calc(100% - 24px)); }
.dirhint[hidden] { display: none; }
.dirhint b { color: var(--ink); }
.dirhint span { flex: 1; min-width: 0; }
.dirhint .btn { white-space: nowrap; }
@media (max-width: 900px) { .dirhint { top: auto; bottom: 70px; left: 10px; right: 10px; max-width: none; font-size: 12px; } }

/* progress board (Method) */
.kpimeta { margin: -4px 0 10px; font-size: 13px; }
.kpiboard { display: grid; gap: 2px; margin: 0 0 26px; }
.kb { display: grid; grid-template-columns: minmax(0, 1fr) 100px 110px 70px 104px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.kb-n { font-size: 13.5px; color: var(--ink); line-height: 1.35; }
.kb-n span { display: block; font-size: 11.5px; color: var(--ink-3); }
.kb-v { white-space: nowrap; font-size: 17px; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.kb-t { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kb-m { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.kb-m i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--mach); }
.kb-m b { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.kb-s { font-size: 11.5px; font-weight: 500; }
.kb-s::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.kb-s.ok { color: var(--good); } .kb-s.gate { color: var(--warn); } .kb-s.wip { color: var(--ink-2); } .kb-s.na { color: var(--ink-3); }
@media (max-width: 640px) {
  .kb { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .kb-m { grid-column: 1 / 3; } .kb-t { display: none; } .kb-s { grid-column: 1 / 3; }
}
.tbl.rules th, .tbl.rules td { text-align: left; white-space: normal; vertical-align: top; }
.tbl.rules td:nth-child(2) { white-space: nowrap; }

/* physics tab */
.pctl { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.acbuild { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.acbuild label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.abgo { display: flex; gap: 14px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.tbar { fill: var(--accent); } .tbar.neg { fill: var(--warn); }
.twhisk { stroke: var(--ink-2); stroke-width: 1.2; }
.tlabel { font-size: 12px; fill: var(--ink); } .tval { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.zero { stroke: var(--ink-3); stroke-width: 1; }
.band { opacity: .12; } .lim { stroke: var(--bad); stroke-dasharray: 4 3; stroke-width: 1.2; }
.phys > .plain, .phys > .pctl, .phys > .acbuild, .phys > .kpirow, .phys > .abgo { margin-left: auto; margin-right: auto; max-width: 1180px; }
.phys > .plain { margin-top: 16px; margin-bottom: 12px; }

/* climatology (Physics tab) */
.phys > .climfig, .phys > .climtbl { margin-left: auto; margin-right: auto; max-width: 1180px; }
.climfig canvas { width: 100%; height: auto; display: block; border-radius: 6px; background: var(--surface-2); }
.cllegend { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.cllegend i { flex: 0 0 220px; height: 10px; border-radius: 5px; }
.climtbl { margin-top: 12px; margin-bottom: 8px; }
.climtbl td.cur, .climtbl th.cur { font-weight: 600; }
.h3 { font-size: 15px; font-weight: 600; margin: 24px auto 4px; }
.h3 .muted { font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.phys > .h3, .phys > .fine { margin-left: auto; margin-right: auto; max-width: 1180px; }
.setbl td, .setbl th { text-align: center; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.setbl td:first-child, .setbl th:first-child { text-align: left; white-space: nowrap; }

/* cockpit (EFB) view: large type, readable at arm's length */
dialog.efb[open] { gap: 10px; }
.efbpos { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.efbpos input { flex: 1; }
.efbpos span { min-width: 160px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.efbtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.efbtiles > div { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.efbtiles .v { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.efbtiles .l { font-size: 13px; color: var(--ink-3); }
.efbtiles .warn .v { color: var(--warn); }
#efbChart { width: 100%; height: auto; max-height: 52vh; }
.efbnext { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
@media (max-width: 760px) { .efbtiles { grid-template-columns: repeat(2, 1fr); } .efbtiles .v { font-size: 26px; } }

/* boom navlog (route panel) */
.navwrap { margin-top: 10px; }
.navwrap summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 6px 0; }
.navwrap summary .muted { font-weight: 400; margin-left: 6px; font-size: 12.5px; }
.navlog td, .navlog th { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; padding: 3px 6px; }
.navlog tr.bl td { background: color-mix(in srgb, var(--route-boomless, #4fb8e8) 10%, transparent); }
.item15 { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; margin: 4px 0 0; }
.btn.sm { padding: 2px 10px; font-size: 12px; min-height: 24px; }

.age.ok { color: var(--good); } .age.warn { color: var(--warn); font-weight: 600; } .age.bad { color: var(--bad); font-weight: 600; }

/* map styles: the switcher of live thumbnails (looks.js) and the wind-flow layer */
.flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.lens { right: 12px; bottom: 76px; padding: 8px; display: flex; gap: 6px; }
.lens button { appearance: none; border: 0; background: none; padding: 0; margin: 0; display: grid; gap: 4px; justify-items: center; cursor: pointer;
  color: var(--ink-3); font: 500 11.5px/1.2 inherit; font-family: inherit; }
.lens canvas { width: 64px; height: 40px; border-radius: 6px; display: block; box-shadow: 0 0 0 1px var(--rule); transition: box-shadow .15s; }
.lens button:hover canvas { box-shadow: 0 0 0 1px var(--ink-3); }
.lens button.on { color: var(--ink); }
.lens button.on canvas { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #3fc6f5; }
.lens button:focus-visible { outline: none; }
.lens button:focus-visible canvas { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
@media (max-width: 1180px) { .lens canvas { width: 52px; height: 33px; } .lens { gap: 4px; padding: 6px; } .lens button { font-size: 10.5px; } }
@media (max-width: 900px) {
  .lens { left: 10px; right: 10px; bottom: 64px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; padding: 6px 8px; }
  .lens button { flex: none; min-height: 0; }
}

/* route picking: a map button, then click start and destination (airports snap); route ends can be dragged */
.routeBtn { right: 12px; top: 12px; display: flex; gap: 7px; align-items: center; padding: 7px 12px; font: 500 13px/1 inherit; font-family: inherit; color: var(--ink); cursor: pointer; }
.routeBtn[aria-pressed="true"] { background: var(--route-boomless); color: #fff; border-color: transparent; }
.routeBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { right: 160px; }
.dirhint { top: 56px; }
@media (max-width: 900px) {
  .routeBtn { right: auto; left: 10px; top: 52px; padding: 7px 10px; }
  .pickhint { top: 96px; }
  .dirhint { top: auto; }
}

.lkey { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); }
.lkey .lk { display: inline-flex; align-items: center; gap: 5px; }
.lkey i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); background-color: #6a5a48; }
@media (max-width: 900px) { .lkey { display: none; } }

.routeparams .span2 { grid-column: 1 / -1; }

.machmax { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; }
.machmax output { justify-self: end; font-weight: 600; color: var(--ink); }
.machmax input { grid-column: 1 / -1; width: 100%; }

/* support link (support.js, only when MC_CONFIG.sponsorsUrl is set) and the single ad slot (ads.js, off by default) */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.badge.support { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--ink-2); }
.badge.support:hover { color: var(--ink); border-color: var(--ink-3); }
.badge.support:hover span:not(.sr) { text-decoration: underline; text-underline-offset: 2px; }
.badge.support svg { color: var(--bad); flex: none; }
.adslot .adhead { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 8px; }
.adslot .adbody { min-height: 100px; }
