:root {
  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --line: #E3E3DF;
  --line-strong: #CFCFCA;
  --ink: #1C1D20;
  --ink-2: #45474C;
  --muted: #5F6167;
  --faint: #84868C;
  --accent: #2A2C30;
  --b: #4B5058;
  --bad: #A94C43;
  --radius: 14px;
  --pad-x: 40px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .05);
}
@media (max-width: 720px) { :root { --pad-x: 16px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'IBM Plex Sans', system-ui, sans-serif; overflow-x: hidden; }
h1, h2, .brand, .panel-title, .step, .code-big { font-family: 'Space Grotesk', system-ui, sans-serif; }
button, select { font: inherit; color: inherit; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.muted { color: var(--faint); }
[hidden] { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245, 245, 243, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 3px; position: relative; clip-path: polygon(0 0, 100% 0, 100% 100%, 28% 100%, 0 62%); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav a:hover { background: #EAEAE6; }
@media (max-width: 560px) { .topbar-inner { padding-top: 8px; padding-bottom: 8px; } .nav a { font-size: 13px; padding: 5px 10px; } }

/* Hero */
.hero { padding-top: 72px; padding-bottom: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin: 0; font-weight: 600; max-width: 16ch; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 58ch; margin: 20px 0 0; }

/* Sections */
.section { padding-top: 56px; padding-bottom: 24px; position: relative; }
/* A thin rule between sections so they don't blend together while scrolling */
.section + .section::before { content: ''; position: absolute; top: 0; left: var(--pad-x); right: var(--pad-x); border-top: 1px solid var(--line-strong); }
@media (max-width: 720px) { .section { padding-top: 40px; } }
.part { margin-top: 56px; display: flex; align-items: center; gap: 12px; font: 600 13px/1 'Space Grotesk', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.part span { background: var(--ink); color: var(--surface); border-radius: 999px; padding: 5px 11px; letter-spacing: .08em; }
.part::after { content: ''; flex: 1; border-top: 1px solid var(--ink); }
.part + .section { padding-top: 28px; }
@media (max-width: 720px) { .part { margin-top: 40px; } }
.ref-more { margin: 14px auto 0; display: block; }
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); }
.to-top[hidden] { display: none; }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.section-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.step { font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; margin-top: 6px; }
.section-head h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; font-weight: 600; }
.section-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel-title { font-weight: 600; font-size: 15px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Fields */
.field { display: block; margin-bottom: 14px; }
.field-label { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
select { width: 100%; appearance: none; -webkit-appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A7C82' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 38px 11px 14px; font-size: 15px; cursor: pointer; }
select:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch-a { background: #E6E6E1; border: 1.5px solid #3A3C40; }
.swatch-b { background: rgba(75, 80, 88, .3); border: 1.5px dashed var(--b); }

/* Explore */
.explore-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .explore-grid { grid-template-columns: 1fr; } .explore-grid .stage { order: -1; } }

.spec .code-row { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.code-big { font-size: 52px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.badge { display: inline-block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.spec-name { color: var(--ink-2); margin: 8px 0 16px; }
.weight { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.weight .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.weight .v { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.weight .v small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv div { background: var(--surface); padding: 10px 12px; }
.kv .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
.decode { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.decode > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2); min-width: 0; }
.decode .l { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.decode .t { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.note { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; }

.cmp { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.cmp th, .cmp td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp th:first-child, .cmp td:first-child { text-align: left; color: var(--muted); font-weight: 500; }
.cmp thead th { font-family: 'Space Grotesk', sans-serif; font-size: 14px; color: var(--ink); }
.cmp td { font-family: 'IBM Plex Mono', monospace; }
.cmp .delta { color: var(--muted); }
.cmp-empty { font-size: 13px; color: var(--muted); }

.stage { position: relative; overflow: hidden; min-width: 0; }
.stage-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.toolbar-right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.canvas-host { position: relative; height: 620px; background: radial-gradient(ellipse at 50% 40%, #FFFFFF 0%, #F1F1EE 100%); touch-action: none; }
@media (max-width: 720px) { .canvas-host { height: 420px; } }
.canvas-host canvas { display: block; }
.stage-legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); pointer-events: none; }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .8); padding: 4px 8px; border-radius: 8px; }

.seg { display: inline-flex; background: #EFEFEC; border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg button:disabled { opacity: .4; cursor: default; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-btn { border: 0; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link-btn:disabled { color: var(--faint); cursor: default; }

/* 3D labels */
.dim-label { font: 500 12px 'IBM Plex Mono', monospace; background: rgba(255, 255, 255, .92); color: var(--ink); border: 1px solid var(--line-strong); padding: 2px 7px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.dim-label.b { background: var(--b); color: #fff; border-color: var(--b); }
.scene-label { pointer-events: none; white-space: nowrap; }
.hold-label { font: 600 10px 'Space Grotesk', sans-serif; letter-spacing: .14em; color: var(--ink-2); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.hold-label.faint { color: var(--muted); }
.pos-label { font: 500 10px 'IBM Plex Mono', monospace; color: var(--ink); background: rgba(255, 255, 255, .85); padding: 0 4px; border-radius: 4px; }

/* Planner */
.aircraft-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.aircraft-tabs::-webkit-scrollbar { display: none; }
.ac-tab { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 10px 16px; cursor: pointer; text-align: left; }
.ac-tab .m { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ac-tab .n { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; }
.ac-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ac-tab.on .m { color: #B9BBC0; }

.config-row { margin-bottom: 16px; }
.config-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.configs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cfg { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cfg:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.cfg.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cfg b { display: block; font-weight: 600; font-size: 14px; }
.cfg span { font-size: 12.5px; color: var(--muted); }

.planner-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 16px; align-items: stretch; }
@media (max-width: 1180px) { .planner-grid { grid-template-columns: 220px minmax(0, 1fr); } .loadlist-panel { grid-column: 1 / -1; } }
@media (max-width: 760px) { .planner-grid { grid-template-columns: 1fr; } .palette-panel { order: 2; } .planner-stage { order: 1; } .loadlist-panel { order: 3; } }
.planner-stage { display: flex; flex-direction: column; }
.planner-host { height: auto; flex: 1; min-height: 640px; }
@media (max-width: 720px) { .planner-host { min-height: 460px; } }

.pal-group { margin-bottom: 14px; }
.pal-group-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pal-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pal { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 9px; cursor: grab; text-align: left; user-select: none; -webkit-user-select: none; }
.pal:hover { border-color: var(--line-strong); }
.pal b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 15px; }
.pal span { font-size: 11px; color: var(--muted); }
.pal.armed { background: var(--accent); color: #fff; border-color: var(--accent); }
.pal.armed span { color: #C5C7CB; }
.pal.dim { opacity: .45; }

.status { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: center; pointer-events: none; z-index: 3; }
.status span { background: rgba(28, 29, 32, .88); color: #fff; font-size: 13px; padding: 7px 12px; border-radius: 999px; max-width: 100%; }
.status span.bad { background: var(--bad); }

.totals { display: grid; grid-template-columns: 0.8fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.totals div { background: var(--surface); padding: 10px 8px; min-width: 0; }
.totals .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.totals .v { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; white-space: nowrap; }
.totals .k { white-space: nowrap; }
.loadlist { max-height: 420px; overflow: auto; margin: 0 -6px; }
.ll-hold { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 6px 4px; display: flex; justify-content: space-between; }
.ll-row { display: grid; grid-template-columns: 48px 1fr auto 22px; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.ll-row:hover { background: var(--surface-2); }
.ll-row.sel { background: #ECECE9; }
.ll-row .p { font-family: 'IBM Plex Mono', monospace; color: var(--muted); font-size: 12px; }
.ll-row .c { font-weight: 600; }
.ll-row .w { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-2); }
.ll-row .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.ll-row .x:hover { color: var(--ink); }
.ll-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.facts { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; font-size: 13px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.facts .k { color: var(--muted); }
.facts .v { text-align: right; }

/* Reference */
.decoder { padding: 20px; margin-bottom: 16px; }
.decoder-title { font-weight: 600; margin-bottom: 12px; }
.decoder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .decoder-grid { grid-template-columns: 1fr; } }
.decoder-grid .letter { float: left; font: 700 34px/1 'Space Grotesk', sans-serif; width: 50px; height: 50px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 10px; margin-right: 12px; }
.decoder-grid b { font-size: 13px; }
.decoder-grid p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 820px; }
.ref-table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ref-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ref-table tr:last-child td { border-bottom: 0; }
.ref-table tbody tr { cursor: pointer; }
.ref-table tbody tr:hover td { background: var(--surface-2); }
.ref-table .code { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; }
.ref-table .num { font-family: 'IBM Plex Mono', monospace; text-align: right; white-space: nowrap; }
.ref-table th.num { text-align: right; }
.ref-table .grp td { background: var(--surface-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: default; padding: 8px 14px; }
.disclaimer { font-size: 12.5px; color: var(--muted); max-width: 90ch; margin-top: 16px; }

.footer { color: var(--muted); font-size: 12.5px; padding-top: 40px; padding-bottom: 40px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13.5px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { .palette-panel, .loadlist-panel { max-height: 800px; overflow: auto; } }
@media (min-width: 981px) { .explore-grid .stage { position: sticky; top: 76px; } }
.show-pos .hold-label { display: none; }
@media (max-width: 760px) { .palette-panel { max-height: 380px; overflow: auto; } }
@media (max-width: 760px) { .configs { display: flex; overflow-x: auto; padding-bottom: 4px; } .cfg { flex: 0 0 240px; } }
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 16px 16px 4px; border-bottom: 1px solid var(--line); }
.picker .field { margin-bottom: 12px; min-width: 0; }
.gl-missing { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); font-size: 14px; }

/* Units */
.unit-badge { position: absolute; top: 12px; right: 12px; z-index: 3; pointer-events: none; font: 500 11.5px 'IBM Plex Mono', monospace; color: var(--ink-2); background: rgba(255, 255, 255, .88); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

/* Fit my cargo */
.fit-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .fit-grid { grid-template-columns: 1fr; } }
.fit-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fit-host { height: 520px; }
@media (max-width: 720px) { .fit-host { height: 400px; } }
.fit-picker { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fit-btn-wrap .btn-primary { width: 100%; }
.piece-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.piece-form .panel-title { grid-column: 1 / -1; margin-bottom: 12px; }
.piece-form .span-3 { grid-column: 1 / -1; }
.piece-form .field { margin-bottom: 12px; min-width: 0; }
.piece-form .field-label { font-size: 10.5px; letter-spacing: .06em; }
input[type=text], input[type=number] { width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font: 15px 'IBM Plex Mono', monospace; color: var(--ink); }
input[type=text] { font-family: 'IBM Plex Sans', sans-serif; }
input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-error { color: var(--bad); font-size: 13px; margin: 0 0 8px; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 8px; }
.btn-primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn-primary:hover { background: #111214; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.pieces { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.piece { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--surface-2); }
.piece.editing { border-color: var(--ink); }
.piece .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .35); }
.piece .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece .d { font: 12px 'IBM Plex Mono', monospace; color: var(--ink-2); }
.piece .f { font-size: 11.5px; color: var(--muted); }
.piece .acts { display: flex; gap: 2px; }
.piece .acts button { border: 0; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.piece .acts button:hover { background: #ECECE9; }
.pieces-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
.pieces-total { font-size: 13px; color: var(--ink-2); margin-top: 10px; font-variant-numeric: tabular-nums; }

.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.recs:empty { display: none; }
.recs-head { grid-column: 1 / -1; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rec { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; text-align: left; cursor: pointer; }
.rec:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.rec.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.rec .rank { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rec .best { color: var(--ink); font-weight: 600; }
.rec b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 20px; margin: 2px 0; }
.rec span.s { display: block; font-size: 12.5px; color: var(--ink-2); }
.fit-summary { padding: 18px 20px; }
.fit-summary h3 { margin: 0 0 4px; font: 600 18px 'Space Grotesk', sans-serif; }
.fit-summary .sub { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.unit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.unit .n { font-weight: 600; margin-bottom: 6px; }
.bar { display: grid; grid-template-columns: 70px 1fr 42px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bar i { display: block; height: 6px; border-radius: 3px; background: #ECECE9; overflow: hidden; }
.bar i b { display: block; height: 100%; background: var(--ink-2); }
.unfit { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.unfit .h { color: var(--bad); font-weight: 600; margin-bottom: 4px; }
.unfit li { color: var(--ink-2); margin: 2px 0; }

/* Selected ULD card in the planner */
.sel-card { position: absolute; top: 12px; left: 12px; z-index: 5; width: min(280px, calc(100% - 24px)); background: rgba(255, 255, 255, .96); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; }
.sel-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sel-card .code { font: 700 24px/1 'Space Grotesk', sans-serif; }
.sel-card .pos { font: 500 12px 'IBM Plex Mono', monospace; color: var(--ink-2); background: #EFEFEC; border-radius: 6px; padding: 2px 7px; }
.sel-card .name { color: var(--ink-2); margin: 4px 0 8px; }
.sel-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 10px; }
.sel-card dt { color: var(--muted); }
.sel-card dd { margin: 0; text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; }
.sel-card .row { display: flex; gap: 8px; }
.sel-card button { flex: 1; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.sel-card button.danger { color: var(--bad); }

.door-error { grid-column: 1 / -1; border: 1px solid var(--bad); background: #FBF3F2; color: var(--ink); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; font-size: 13.5px; }
.door-error .h { color: var(--bad); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.door-error p { margin: 4px 0; color: var(--ink-2); }
.door-error ul { margin: 6px 0; padding-left: 18px; }
.door-error .hint2 { color: var(--muted); font-size: 12.5px; }

/* Loadable volume */
.lv-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .lv-grid { grid-template-columns: 1fr; } }
.lv-explain p, .lv-explain li { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.lv-explain p { margin: 8px 0; }
.lv-explain ul { margin: 6px 0 12px; padding-left: 18px; }
.lv-explain li { margin: 4px 0; }
.lv-fig { width: 100%; max-width: 360px; display: block; margin: 8px 0; }
.lv-ceiling { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.2; }
.lv-floor { stroke: var(--ink); stroke-width: 2; }
.lv-box { fill: #D8D5CE; stroke: #3A3C40; stroke-width: 1.2; }
.lv-lost { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 3 2; }
.lv-hatch { stroke: var(--bad); stroke-width: 1.2; opacity: .45; }
.lv-t { font: 11px 'IBM Plex Sans', sans-serif; fill: var(--ink-2); }
.lv-formula { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px !important; }
.lv-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lv-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 4px 0 14px; }
.lv-totals > div { background: var(--surface); padding: 12px; }
.lv-totals .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lv-totals .v { font: 600 20px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.lv-totals .v small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.lv-totals > .hl { background: #EFEFEC; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.lv-table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lv-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lv-table .num { text-align: right; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.lv-table th.num { text-align: right; }
.lv-table .why { color: var(--muted); font-size: 12px; }
.lv-table .warn { color: var(--bad); }
.lv-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.lv-totals .warn { color: var(--bad); font-size: 13px; }

/* Keep inputs in a row aligned even when one label wraps to two lines */
.piece-form .field { display: flex; flex-direction: column; justify-content: flex-end; }

/* Top navigation scrolls sideways on narrow screens instead of overflowing */
@media (max-width: 760px) {
  .topbar-inner { gap: 12px; }
  .nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}
.lv-uld { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.unit .own { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.lv-uld a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sel-card .top { align-items: center; }
.sel-card .cc { color: var(--muted); font-size: 18px; }
.sel-card .pos { margin-left: auto; }
.sel-card .close { flex: 0 0 auto; border: 0; background: none; font-size: 20px; line-height: 1; padding: 0 2px; color: var(--muted); cursor: pointer; }
.sel-card .row button { flex: 1; }
.unit-badge { z-index: 2; }
.sel-card:not([hidden]) ~ .unit-badge { display: none; }
@media (max-width: 720px) {
  .sel-card { width: min(240px, calc(100% - 24px)); padding: 10px 12px; font-size: 12.5px; }
  .sel-card .code { font-size: 20px; }
  .sel-card .name { margin: 2px 0 6px; }
  .sel-card dl { gap: 2px 10px; margin-bottom: 8px; }
}
@media (max-width: 720px) {
  .sel-card { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
  .sel-card dl { grid-template-columns: auto 1fr auto 1fr; }
  .sel-card .wide { display: none; }
  .sel-card dd { white-space: nowrap; }
  .sel-card dt { white-space: nowrap; }
  .sel-card .row button { padding: 6px 8px; }
}
.ref-table td.code { white-space: nowrap; }

/* Quote request */
.quote-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.quote-bar p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 60ch; }
.quote-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(20, 22, 26, .25); color: var(--ink); background: var(--surface); }
.quote-dialog::backdrop { background: rgba(28, 29, 32, .35); }
.quote-dialog form { padding: 20px 22px; }
.qd-head { display: flex; align-items: center; justify-content: space-between; }
.qd-head h3 { margin: 0; font: 600 20px 'Space Grotesk', sans-serif; }
.qd-close { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.qd-sub { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.qd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .qd-grid { grid-template-columns: 1fr; } }
.quote-dialog textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font: 14px 'IBM Plex Sans', sans-serif; color: var(--ink); resize: vertical; }
.quote-dialog input[type=email], .quote-dialog input[type=tel], .quote-dialog input[type=date] { width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font: 15px 'IBM Plex Sans', sans-serif; color: var(--ink); }
.qd-actions { justify-content: flex-end; margin-top: 6px; }

/* Airport search */
.ap-wrap { position: relative; }
.ap-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.ap-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.ap-list li b { font-family: 'IBM Plex Mono', monospace; font-weight: 500; min-width: 36px; }
.ap-list li span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-list li.on, .ap-list li:hover { background: #EFEFEC; }
.quote-dialog { overflow: visible; }
.quote-dialog form { max-height: calc(100vh - 34px); overflow: auto; }

.cmp-wrap { overflow-x: auto; max-width: 100%; }
.cmp tr.txt td { white-space: normal; font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px; }
.pos-label.slot { background: rgba(255, 255, 255, .6); color: var(--muted); }

/* Weight limits */
.wt-warn:empty { display: none; }
.wt-warn { border: 1px solid var(--bad); background: #FBF3F2; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink); margin-bottom: 10px; }
.wt-warn b { color: var(--bad); }
.wt-warn ul { margin: 4px 0 0; padding-left: 16px; }
.wt-warn.soft { border-color: #C9A227; background: #FBF7EA; }
.wt-warn.soft b { color: #7A5E00; }
.ll-row .w small { color: var(--muted); }
.ll-row.over .w, .ll-row.over .p { color: var(--bad); font-weight: 600; }
.totals .v.over { color: var(--bad); }
.totals .v small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.sel-card .wt { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.sel-card .wt label { color: var(--muted); white-space: nowrap; }
.sel-card .wt input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 14px; }
.sel-card .wt .wt-unit { color: var(--muted); }
.sel-card .wt-msg { font-size: 12px; margin: -6px 0 8px; }
.sel-card .wt-msg.bad { color: var(--bad); }
.sel-card .wt-msg.ok { color: var(--muted); }
.loadlist-panel .panel-title-row { flex-wrap: wrap; gap: 4px 12px; }
.loadlist-panel .mini-actions { display: flex; flex-wrap: wrap; gap: 2px; }

/* Payload estimator */
.pl-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .pl-grid { grid-template-columns: 1fr; } }
.pl-route { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pl-route .field { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.pl-fuel { display: flex; align-items: center; gap: 8px; }
.pl-fuel .chip-btn { flex: 0 0 auto; }
.pl-fuel-input { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.pl-fuel-input input { font-size: 18px !important; font-weight: 500; text-align: right; }
.pl-fuel-input span { color: var(--muted); }
.pl-fuel-break { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0 0; font-size: 13px; }
.pl-fuel-break dt { color: var(--muted); }
.pl-fuel-break dd { margin: 0; text-align: right; font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.pl-fuel-break .tot { color: var(--ink); font-weight: 600; border-top: 1px solid var(--line); padding-top: 4px; }
.pl-fuel-break .sub { font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pl-hero { padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: end; }
@media (max-width: 560px) { .pl-hero { grid-template-columns: 1fr; } }
.pl-hero .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pl-hero .big { font: 700 44px/1.05 'Space Grotesk', sans-serif; letter-spacing: -.02em; }
.pl-hero .big small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.pl-hero .lim { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.pl-hero .lim b { color: var(--ink); }
.pl-hero .lim.bad, .pl-hero .lim.bad b { color: var(--bad); }
.pl-tag.over { background: var(--bad); color: #fff; border-color: var(--bad); }
.pl-hero .route { text-align: right; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
@media (max-width: 560px) { .pl-hero .route { text-align: left; } }
.pl-hero .route b { font: 600 16px 'Space Grotesk', sans-serif; color: var(--ink); }
.pl-hero .warn { grid-column: 1 / -1; color: var(--bad); font-size: 13.5px; }
.pl-table-card { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
.pl-table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pl-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pl-table tr:last-child td { border-bottom: 0; }
.pl-table .num { text-align: right; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-table th.num { text-align: right; }
.pl-table .sum td { font-weight: 600; background: #FAFAF8; }
.pl-table .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.pl-table .cargo td { font-weight: 600; }
.pl-bar { display: grid; grid-template-columns: minmax(60px, 1fr) 42px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pl-bar i { display: block; height: 7px; border-radius: 4px; background: #ECECE9; overflow: hidden; }
.pl-bar i b { display: block; height: 100%; background: var(--ink-2); }
.pl-bar.lim i b { background: var(--ink); }
.pl-bar.over i b { background: var(--bad); }
.pl-tag { display: inline-block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: 1px 7px; margin-left: 6px; font-weight: 600; }
@media (max-width: 560px) { .pl-route { grid-template-columns: 1fr; } }

.pl-sub { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0; margin: -4px 0 14px; background: var(--surface-2); }
.pl-sub > :not(summary) { margin-left: 14px; margin-right: 14px; }
.pl-sub[open] > :last-child { margin-bottom: 12px; }
.pl-sub summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; }
.pl-sub summary::-webkit-details-marker { display: none; }
.pl-sub summary:hover { background: #F0F0ED; }
.pl-sub summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pl-sub-text { display: flex; flex-direction: column; gap: 1px; font-size: 14px; color: var(--ink); }
.pl-sub-text span { font-size: 12.5px; color: var(--muted); }
.pl-sub-chev { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; transition: transform .2s; }
.pl-sub[open] .pl-sub-chev { transform: rotate(180deg); }
.pl-sub[open] summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .pl-sub-chev { transition: none; } }
.pl-sub .hint { margin: 0 14px 10px; }
.pl-sub-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pl-sub-foot.custom #plSubState { color: var(--ink); font-weight: 600; }
.pl-table .custom-tag { font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

/* Sources */
.src-line { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.src-line a, .source-list a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.source-list { list-style: none; margin: 0; padding: 4px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
.source-list li { padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.source-list li:target { background: var(--surface-2); }
.src-title { font-weight: 600; color: var(--ink); font-size: 14.5px; overflow-wrap: anywhere; }
.src-by { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.source-list p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }

/* Payload: winds, recommended aircraft, distance vs payload chart */
.pl-wind { margin-top: 4px; display: grid; gap: 10px; }
.pl-wind .hint { margin: 0; }
.pl-wind .hint b { color: var(--ink); font-weight: 600; }
.pl-rec { padding: 18px 20px; }
.pl-rec-best { margin: 8px 0 12px; font-size: 15px; color: var(--ink); }
.pl-rec-best b { font-weight: 600; }
.pl-rec-best span { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.pl-rec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pl-rec-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pl-rec-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pl-rec-table .num { text-align: right; font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-rec-table .sub { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pl-rec-table td:first-child { white-space: nowrap; }
.pl-rec-table .nm { display: block; }
.rec-tag { display: inline-block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--ink); border: 1px solid var(--ink); border-radius: 999px; padding: 0 6px; margin: 2px 0 1px; }
.pl-rec-table tr.mine td { background: #E6E6E2; }
.pl-rec-table tr.mine td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
.pl-rec-table tr.mine .nm { font-weight: 700; }
.sel-pill { display: inline-block; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.use-btn { border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font: 600 13px 'IBM Plex Sans', sans-serif; border-radius: 999px; padding: 5px 14px; cursor: pointer; min-height: 32px; }
.use-btn:hover { background: var(--ink); color: var(--surface); }
.use-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fit-yes, .fit-no { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.fit-yes { color: var(--ink); }
.fit-no { color: var(--bad); }
.pl-rec .hint { margin: 10px 0 0; }
.pl-chart-card { padding: 18px 20px; }
.pl-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.pl-chart-key { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.pl-chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.pl-chart-key i { display: inline-block; }
.k-line { width: 16px; height: 2px; background: var(--ink); }
.k-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.k-plan { width: 16px; border-top: 2px dashed var(--bad); }
.pl-chart-card .hint { margin: 4px 0 8px; }
.pl-chart { position: relative; }
.pl-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.pl-chart .grid { stroke: var(--line); stroke-width: 1; }
.pl-chart .ax { fill: var(--muted); font-size: 11px; font-family: 'IBM Plex Sans', sans-serif; }
.pl-chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pl-chart .plan { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pl-chart .route-rule { stroke: var(--line-strong); stroke-dasharray: 2 3; }
.pl-chart .route-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.pl-chart .lbl { fill: var(--ink-2); font-size: 11.5px; font-family: 'IBM Plex Sans', sans-serif; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.pl-chart .lbl.strong { fill: var(--ink); font-weight: 600; }
.pl-chart .zone.z0 { fill: #FFFFFF; }
.pl-chart .zone.z1 { fill: #EDEDEA; }
.pl-chart .zone.none { fill: #F7E9E7; }
.pl-chart .zone-edge { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.pl-chart .zt { fill: var(--ink); font-size: 11.5px; font-weight: 600; font-family: 'IBM Plex Sans', sans-serif; }
.pl-chart .area { fill: var(--ink); opacity: .05; }
.pl-zones { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.pl-zones-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pl-zone { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; }
.pl-zone .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-strong); margin-top: 2px; }
.pl-zone .sw.z0 { background: #FFFFFF; }
.pl-zone .sw.z1 { background: #EDEDEA; }
.pl-zone .sw.none { background: #F7E9E7; }
.pl-zone b { color: var(--ink); font-size: 14px; }
.pl-zone .rng { margin-left: 8px; font: 12.5px 'IBM Plex Mono', monospace; color: var(--ink-2); }
.pl-zone p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.pl-chart .xh { stroke: var(--ink-2); stroke-width: 1; }
.pl-chart .hd { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.pl-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; box-shadow: var(--shadow); display: grid; gap: 1px; white-space: nowrap; }
.pl-tip b { color: var(--ink); }
.pl-tip span { color: var(--ink-2); }
.pl-tip .m { color: var(--muted); font-size: 12px; }
.pl-rec-table .num .sub { font-family: 'IBM Plex Sans', sans-serif; }
.pl-rec-table td.act { text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .pl-rec { padding: 16px 14px; } .pl-rec-table th, .pl-rec-table td { padding-left: 5px; padding-right: 5px; } }

/* Load plan: weights typed in the list */
.ll-row .w { display: inline-flex; align-items: center; gap: 4px; }
.ll-row input.ll-wt[type=number] { width: 76px; font: 500 16px/1.2 'IBM Plex Mono', monospace; text-align: right; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); -moz-appearance: textfield; }
.ll-row .w small { white-space: nowrap; }
.ll-wt::-webkit-outer-spin-button, .ll-wt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ll-wt:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.ll-row.over input.ll-wt[type=number] { border-color: var(--bad); color: var(--bad); }

/* Centre of gravity check */
.cg-check:empty { display: none; }
.cg-check { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.cg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink); }
.cg-verdict { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid; }
.cg-verdict.ok { color: var(--ink); border-color: var(--ink); }
.cg-verdict.bad { color: #fff; background: var(--bad); border-color: var(--bad); }
.cg-bar { position: relative; height: 12px; margin: 14px 0 6px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; }
.cg-range { position: absolute; top: 0; bottom: 0; background: #DADAD5; border-radius: 999px; }
.cg-mark { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.cg-mark.bad { background: var(--bad); }
.cg-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 6px; }
.cg-dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0 0; font-size: 13px; }
.cg-dl dt { color: var(--ink-2); }
.cg-dl dd { margin: 0; text-align: right; font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.cg-advice { margin: 10px 0 0; font-size: 13px; color: var(--bad); }
.cg-advice b { color: var(--bad); }
.cg-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.pl-rec-table tbody tr { cursor: pointer; }
.pl-rec-table tbody tr:hover td { background: var(--surface-2); }
.pl-rec-table tr.charted:not(.mine) td { background: var(--surface-2); }
.pl-rec-table tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.on-chart { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.pl-rec .hint.pl-rec-tip { margin: 0 0 6px; }
.pl-rec-tip b { color: var(--ink); font-weight: 600; }
.disclaimer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.act-inline { display: none; }
@media (max-width: 560px) {
  .pl-rec-table td.act, .pl-rec-table th:last-child { display: none; }
  .act-inline { display: block; margin-top: 6px; }
}
.pl-rec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }

/* Load planner: position limits and export */
.ll-foot { margin: 8px 6px 0; font-size: 12px; color: var(--muted); }
.lp-export { width: 100%; margin-top: 14px; }
.pos-ref { margin-top: 16px; padding: 0; }
.pos-ref summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 14px; }
.pos-ref summary::-webkit-details-marker { display: none; }
.pos-ref summary:hover { background: var(--surface-2); }
.pos-ref summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pos-ref summary > span:first-child { display: grid; gap: 2px; }
.pos-ref summary b { font-size: 15px; color: var(--ink); }
.pos-ref-sub { font-size: 13px; color: var(--muted); }
.pos-ref[open] .pl-sub-chev { transform: rotate(180deg); }
.pos-ref > .table-wrap, .pos-ref > .hint { margin: 0 20px; }
.pos-ref > .hint { margin-bottom: 16px; margin-top: 10px; }
.pos-ref-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pos-ref-table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pos-ref-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pos-ref-table .num { text-align: right; font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-ref-table .sub { display: block; color: var(--muted); font-size: 12px; }
.pos-ref-table .codes { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--ink-2); }
.pos-ref-table tr.grp td { background: var(--surface-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; }
@media (max-width: 640px) {
  .pos-ref > .table-wrap, .pos-ref > .hint { margin: 0 14px; }
  .pos-ref > .hint { margin-bottom: 14px; margin-top: 10px; }
  .pos-ref summary { padding: 14px; }
  .pos-ref-table thead { display: none; }
  .pos-ref-table tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .pos-ref-table tr.grp { padding: 0; border: 0; }
  .pos-ref-table tr.grp td { display: block; }
  .pos-ref-table td { display: block; border: 0; padding: 2px 0; }
  .pos-ref-table td.num { text-align: left; }
  .pos-ref-table td[data-label]::before { content: attr(data-label) ': '; font-family: 'IBM Plex Sans', sans-serif; color: var(--muted); font-size: 12px; }
  .pos-ref-table td.pt { font-weight: 600; color: var(--ink); }
  .pos-ref-table td.pt .sub { font-weight: 400; }
  .pos-ref-table td.lim { font-weight: 600; color: var(--ink); }
}
.pl-export { width: 100%; }
.pl-rec .hint.pl-rec-out { margin: 0 0 6px; color: var(--ink-2); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.atlas-links a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* Cross-links between ULD Explorer and Load Plan */
.nav a.nav-out { font-weight: 600; color: var(--ink); }
.hero-link { margin: 14px 0 0; color: var(--ink-2); font-size: 15px; }
.hero-link a { color: var(--ink); font-weight: 600; }
.moved { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; padding: 20px 22px; text-decoration: none; color: inherit; border: 1.5px solid var(--ink); }
.moved:hover { background: #F6F6F3; }
.moved-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.moved-t b { display: block; color: var(--ink); font-size: 16px; }
.moved-t span { display: block; color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.moved-go { font-weight: 600; color: var(--ink); white-space: nowrap; }
@media (max-width: 720px) { .moved { grid-template-columns: auto minmax(0, 1fr); padding: 16px; } .moved-go { grid-column: 1 / -1; } }

/* Section links under the page title */
.page-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.page-nav a { text-decoration: none; color: var(--ink); border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 14px; }
.page-nav a:hover { background: #EAEAE6; }
