/* Load planning screen (decks + dock) and desktop shell. Loaded after app.css. */
.card { border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.ib.sm { width: 36px; height: 36px; border-radius: 10px; background: var(--card2); }
.ib:disabled { opacity: .3; } .ib.danger { color: var(--bad); } .ib.flip svg { rotate: 180deg; }
.btn.sm svg { width: 17px; height: 17px; }

.lw { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.lmain { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lb { display: flex; gap: 6px; align-items: center; flex: none; }
.lb .seg { min-height: 38px; width: 148px; flex: none; } .lb .seg button { min-height: 28px; font-size: 12.5px; }
.gauge { flex: 1; min-width: 0; display: grid; gap: 4px; background: var(--card); border-radius: 10px; padding: 6px 8px; }
.gr { display: grid; grid-template-columns: 28px 1fr 42px; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--mut); }
.gr .cgbar { height: 7px; margin: 0; } .gr em { font-style: normal; text-align: right; color: var(--tx); font-variant-numeric: tabular-nums; }

/* decks: fuselage outline, nose up */
.decks { flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.decks.all { grid-template-columns: 7fr 4.6fr; gap: 5px; }
.deck { border: 1px solid var(--line); border-radius: 46% 46% 14px 14px / 30px 30px 14px 14px; padding: 15px 4px 5px; background: linear-gradient(var(--card), color-mix(in srgb, var(--card) 70%, var(--bg))); }
.deck::before { display: none; }
.lw:not(.wide) .decks.all .deck { padding: 13px 2px 4px; }
.lw:not(.wide) .decks.all .cols, .lw:not(.wide) .decks.all .heads { gap: 2px; }
.lw:not(.wide) .decks.all .heads span { font-size: 6.5px; letter-spacing: 0; }
#app .p.on { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.p.pk { outline: 3px solid #fff; outline-offset: -2px; z-index: 3; } .p.pk::before { content: "✓"; position: absolute; top: 0; left: 3px; font-size: 10px; font-weight: 900; z-index: 2; }
.p.ret { border: 2px dashed var(--pri); background: color-mix(in srgb, var(--pri) 30%, var(--empty)); opacity: 1; z-index: 2; }
.p.on.no { opacity: .6; }
.p.over, .dock.over { outline: 3px solid var(--tx); outline-offset: -1px; z-index: 5; }
.p.over { scale: 1.08; }
body.dragging { user-select: none; -webkit-user-select: none; } body.dragging * { cursor: grabbing !important; }
.ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; margin: -70px 0 0 -46px; min-width: 92px; padding: 6px 10px; border-radius: 10px; background: var(--d0); color: #fff; font-size: 12px; text-align: center; box-shadow: 0 12px 32px #000b; rotate: -3deg; border: 2px solid #fff; }
.ghost b { display: block; } .ghost.d1 { background: var(--d1); } .ghost.d2 { background: var(--d2); } .ghost.d3 { background: var(--d3); }

/* dock: the ULD list that never leaves the screen */
.dock { flex: none; min-width: 0; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 6px 8px 8px; transition: background .15s; }
.dock.drop { border-style: dashed; border-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--card)); }
.dock.over { background: color-mix(in srgb, var(--warn) 30%, var(--card)); }
.dh, .strip { display: flex; align-items: center; gap: 6px; min-height: 38px; }
.fl { flex: 1; min-width: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; } .fl::-webkit-scrollbar, .chips2::-webkit-scrollbar { display: none; }
.fp { flex: none; height: 30px; padding: 0 10px; border-radius: 99px; background: var(--card2); font-size: 12px; font-weight: 700; color: var(--mut); display: inline-flex; align-items: center; gap: 5px; }
.fp[aria-pressed=true] { background: var(--tx); color: var(--bg); }
.fp i { width: 8px; height: 8px; border-radius: 50%; background: var(--d0); } .fp.d1 i { background: var(--d1); } .fp.d2 i { background: var(--d2); } .fp.d3 i { background: var(--d3); }
.strip .info { flex: 1; min-width: 0; line-height: 1.2; }
.strip .info b, .strip .info span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .strip .info b { font-size: 13.5px; } .strip .info span { font-size: 11px; color: var(--mut); }
.chips2 { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-height: 48px; align-items: stretch; }
.dock .u { position: relative; min-width: 96px; touch-action: pan-x; cursor: grab; user-select: none; -webkit-user-select: none; }
.dock .u b { white-space: nowrap; }
.dock .u em { font-style: normal; font-size: 9.5px; font-weight: 800; background: #0006; border-radius: 6px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.dock .u.pk { box-shadow: inset 0 0 0 2.5px #fff; } .dock .u.pk b::before { content: "✓ "; }
.dgm { font-style: normal; }
.dock .hint { color: var(--mut); font-size: 12.5px; margin: auto; padding: 6px; text-align: center; }
.dock.open .chips2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); max-height: 36dvh; overflow: hidden auto; }
.dock.open .u, .dock.side .u { touch-action: pan-y; }

/* ── desktop / tablet landscape ── */
@media (min-width: 900px) {
  #app { max-width: none; }
  #app[data-view=flight] { grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #app[data-view=flight] > header.bar { grid-column: 2; grid-row: 1; padding-left: 20px; padding-right: 20px; }
  #app[data-view=flight] > main { grid-column: 2; grid-row: 2; }
  #app[data-view=flight] > nav.tabs { grid-column: 1; grid-row: 1 / 3; grid-auto-flow: row; grid-auto-rows: 76px; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding: 64px 8px 0; gap: 4px; }
  #app[data-view=flight] > nav.tabs button { height: auto; border-radius: 14px; } #app[data-view=flight] > nav.tabs button[aria-current] { background: color-mix(in srgb, var(--pri) 16%, transparent); }
  #app[data-view=home] > header.bar, #app[data-view=home] > main { width: 100%; max-width: 920px; margin: 0 auto; }
  #app[data-view=flight] > main:not(.fit) { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-content: start; padding: 8px 20px 24px; }
  #app[data-view=flight] > main:not(.fit) .card { margin: 0; }
  main.fit { padding: 4px 20px 16px; }
  .lw.wide { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; }
  .lw.wide .decks.all { grid-template-columns: 7fr 5fr; gap: 14px; }
  .lw.wide .deck { padding: 22px 8px 8px; border-radius: 46% 46% 18px 18px / 44px 44px 18px 18px; }
  .dock.side { height: 100%; min-height: 0; padding: 10px; gap: 10px; }
  .dock.side .chips2 { flex: 1; min-height: 0; flex-direction: column; overflow: hidden auto; gap: 5px; align-items: stretch; }
  .dock.side .u { min-height: 48px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 6px 12px; flex: none; }
  .dock.side .u b { font-size: 13.5px; } .dock.side .u span { font-size: 12px; text-align: right; }
  .dock.side .u:hover { filter: brightness(1.12); } #app .p:not(.blk):hover { filter: brightness(1.15); }
}
.paper .deck { border-radius: 6px; padding: 4px; background: #fff; } .paper .p i.lv { display: none; }

/* live capacity, what-if preview, optimiser */
.gauge { overflow: hidden; } .gauge > * { min-width: 0; }
.gk span:last-child { display: none; }
.gk { display: flex; justify-content: space-between; gap: 6px; overflow: hidden; font-size: 9.5px; font-weight: 700; color: var(--mut); white-space: nowrap; } .gk b { color: var(--tx); font-variant-numeric: tabular-nums; } .gk .tbad b { color: var(--bad); }
.cgbar u { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--warn); display: none; } .gr em.pre { color: var(--warn); }
.p.lim s { color: var(--warn); font-weight: 800; } .p.full { opacity: .5; } .p.full s { color: var(--bad); font-weight: 800; }
.p.can s { color: var(--tx); font-weight: 800; }
.p.can.risk { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 24%, var(--empty)); animation: none; } .p.on.can.risk { box-shadow: inset 0 0 0 2px var(--warn); }
.p.best { box-shadow: 0 0 0 2px var(--ok), 0 0 14px var(--ok); z-index: 3; } .p.best::after { content: "★"; position: absolute; top: -1px; right: 2px; font-size: 10px; color: var(--ok); }

/* ── position cells: legibility first ──
   Every cell is a size container, so the layout adapts to the box it gets:
   narrow (All view on a phone) → name + weight · normal → name, weight / ULD no, dest · tall → three rows. */
:root { --d1: #1d4ed8; --d2: #b45309; --d3: #7e22ce; --d0: #475569; --empty: #1c2947; --cap: #a9b7d0; }
:root[data-theme="light"] { --empty: #e3e9f3; --cap: #55637c; --d0: #475569; }
.p { container-type: size; padding: 0; }
.pc { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 1.1; min-width: 0; }
.pc b { font-size: 12px; font-weight: 800; }
.pc s { font-size: 10px; font-weight: 600; color: var(--cap); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p.blk .pc b { opacity: .3; font-weight: 600; } .p.blk .pc s { display: none; }
.p.lim .pc s { color: var(--warn); font-weight: 800; } .p.full .pc s { color: var(--bad); font-weight: 800; } .p.can .pc s { color: var(--tx); font-weight: 800; }

.p.on { border: 1px solid #ffffff59; box-shadow: none; }
.p.on .pc { display: grid; grid-template: "n k" 1fr "u d" 1fr / auto 1fr; align-items: center; justify-items: start; gap: 1px 3px; padding: 0 3px 1px; color: #fff; line-height: 1; overflow: hidden; align-content: center; }
.p.on .pc b { grid-area: n; font-size: 10.5px; line-height: 1.15; padding: 0 3px; border-radius: 3px; background: #0000006b; }
.p.on .pc s { grid-area: k; justify-self: end; font-size: 12px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.p.on .pc em { grid-area: u; font-style: normal; font-size: 9.5px; font-weight: 700; color: #fff; opacity: .95; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p.on .pc em u { display: none; text-decoration: none; }
.p.on .pc q { grid-area: d; justify-self: end; quotes: none; font-size: 9.5px; font-weight: 800; color: #fff; }
.p i.lv { position: absolute; left: 0; bottom: 0; height: 2px; background: #fff; opacity: .8; pointer-events: none; } .p i.lv.hi { background: #ffb02e; opacity: 1; }
.p.on.dg { box-shadow: inset 4px 0 0 #ff4d5e; } .p.on.dg::after { display: none; } .p.on.dg .pc { padding-left: 6px; }

.deck .heads, .deck .cols { transition: grid-template-columns .2s; }
/* medium boxes: name + weight / ULD number (destination = colour) */
@container (max-width: 61.9px) {
  .p.on .pc { grid-template: "n k" 1fr "u u" 1fr / auto 1fr; gap: 1px; padding: 0 1px 1px; }
  .p.on .pc b { font-size: 9px; padding: 0 2px; } .p.on .pc s { font-size: 11px; letter-spacing: -.03em; }
  .p.on .pc em { justify-self: center; font-size: 9.5px; } .p.on .pc q { display: none; }
}
/* narrow boxes: name over weight */
@container (max-width: 40px) {
  .pc b { font-size: 10px; } .pc s { font-size: 8.5px; }
  .p.on .pc { grid-template: "n" auto "k" 1fr / 1fr; justify-items: center; padding: 0 0 2px; }
  .p.on .pc b { font-size: 9px; } .p.on .pc s { justify-self: center; font-size: 10px; }
  .p.on .pc em { display: none; }
}
/* tall boxes: name + destination / weight / ULD */
@container (min-height: 40px) and (min-width: 40.1px) {
  .p.on .pc { grid-template: "n d" auto "k k" 1fr "u u" auto / auto 1fr; padding: 1px 3px 2px; }
  .p.on .pc s { justify-self: center; font-size: 14px; } .p.on .pc em { justify-self: center; } .p.on .pc q { display: block; font-size: 9.5px; }
}
@container (min-width: 62px) and (min-height: 40px) { .p.on .pc em u { display: inline; } }
/* roomy boxes (tablet / desktop, or a widened column) */
@container (min-width: 84px) {
  .pc b { font-size: 13.5px; } .pc s { font-size: 11.5px; }
  .p.on .pc { padding: 2px 5px 5px; } .p.on .pc b { font-size: 12px; padding: 0 4px; } .p.on .pc s { font-size: 16px; }
  .p.on .pc em, .p.on .pc q { font-size: 11.5px; } .p.on .pc em u { display: inline; }
}
@container (min-width: 84px) and (min-height: 40px) { .p.on .pc s { font-size: 20px; } }
.paper .p.on .pc, .paper .p.on .pc s, .paper .p.on .pc em, .paper .p.on .pc q { color: #000; } .paper .p.on .pc b { background: none; padding: 0; }
.paper .p.on.d2 .pc b { background: #000; color: #fff; padding: 0 3px; } .paper .p.on.dg { box-shadow: inset 0 0 0 1.5px #000; }

/* an empty list gives its space back to the decks */
.dock:not(.drop):not(.side) .chips2:has(> .hint) { display: none; }

/* ── loaded ULD = one clear full-width row at its physical station ── */
header.bar.min { min-height: 0; padding: var(--sat) 0 4px; }
.lb .seg { width: 132px; }
.cols.main { position: relative; }
.bars { position: absolute; inset: 0; pointer-events: none; z-index: 1; } .bars .p { pointer-events: auto; left: auto; right: auto; }
.cols.main .col .p:not(.blk) { z-index: 2; }
.p.on { border: 1.5px solid #ffffff73; border-radius: 6px; }
@container (min-width: 180px) {
  .p.on .pc { grid-template: "n u d k" 1fr / auto 1fr auto auto; gap: 0 8px; padding: 0 8px 0 3px; }
  .p.on .pc b { font-size: 12.5px; line-height: 1; padding: 3px 5px; min-width: 32px; text-align: center; border-radius: 4px; background: #00000080; }
  .p.on .pc em { justify-self: start; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; } .p.on .pc em u { display: inline; }
  .p.on .pc q { display: block; font-size: 12.5px; } .p.on .pc s { justify-self: end; font-size: 15px; }
}
@container (min-width: 180px) and (min-height: 40px) {
  .p.on .pc b { font-size: 14px; } .p.on .pc em { font-size: 14.5px; } .p.on .pc q { font-size: 14px; } .p.on .pc s { font-size: 19px; }
}
@container (min-width: 300px) { .p.on .pc { gap: 0 12px; padding-right: 10px; } .p.on .pc em { font-weight: 700; } }

.p.blk .pc b { opacity: 0; }                       /* blocked alternatives: hatch only, no text noise between the rows */
.lb .seg { width: 120px; } .lb .seg button { font-size: 12px; }

/* decks must always fit: flexible rows may shrink below their content */
.deck { grid-template-rows: auto minmax(0, 1fr); } .deck .cols { min-height: 0; }
/* one-line rows: digits only until there is room for type + owner tag */
@container (min-width: 180px) { .p.on .pc em u { display: none; } }
@container (min-width: 216px) { .p.on .pc em u { display: inline; } }
@container (min-width: 84px) and (max-width: 179.9px) { .p.on .pc s { font-size: 15px; } }
@container (min-width: 84px) and (max-width: 179.9px) and (min-height: 40px) { .p.on .pc s { font-size: 18px; } }
/* short boxes (small phones) */
@container (max-height: 23.9px) {
  .pc { flex-direction: row; gap: 3px; } .pc b { font-size: 10.5px; } .pc s { font-size: 8.5px; }
  .p.on .pc b { padding: 1px 4px; font-size: 11.5px; }
}
@container (max-height: 23.9px) and (min-width: 180px) { .p.on .pc s { font-size: 14px; } .p.on .pc em, .p.on .pc q { font-size: 12px; } }
@container (max-height: 23.9px) and (max-width: 179.9px) {
  .p.on .pc { grid-template: "n k" 1fr / auto 1fr; padding: 0 3px; gap: 0 3px; }
  .p.on .pc em, .p.on .pc q { display: none; } .p.on .pc s { justify-self: end; font-size: 12.5px; }
}
@container (max-height: 23.9px) and (max-width: 40px) {
  .pc { flex-direction: column; gap: 0; } .pc s { display: none; }
  .p.on .pc { grid-template: "n" 1fr "k" 1fr / 1fr; padding: 0; gap: 0; justify-items: center; }
  .p.on .pc b { font-size: 8.5px; padding: 0; background: none; } .p.on .pc s { display: block; justify-self: center; font-size: 9px; }
}

@container (min-width: 84px) and (max-width: 179.9px) { .p.on .pc { padding: 0 5px 1px; } }
@container (min-height: 40px) and (min-width: 40.1px) and (max-width: 179.9px) { .p.on .pc { padding: 0 3px 1px; gap: 0 3px; } .p.on .pc s { font-size: 13.5px; } }
@container (min-height: 48px) and (min-width: 84px) and (max-width: 179.9px) { .p.on .pc s { font-size: 18px; } }

/* ── loaded rows, refined: tinted row + destination stripe & pill, white position tag,
      type scales with the row height (cqh), DG / overhang badges, weight as the right-hand column ── */
.p.on { --dc: var(--d0); } .p.on.d1 { --dc: var(--d1); } .p.on.d2 { --dc: var(--d2); } .p.on.d3 { --dc: var(--d3); }
.deck .p.on { background: color-mix(in srgb, var(--dc) 40%, #0c1428); border: 1px solid color-mix(in srgb, var(--dc) 78%, #fff 22%); box-shadow: inset 5px 0 0 color-mix(in srgb, var(--dc) 80%, #fff 20%); }
.deck .p.on .pc, .deck .p.on.dg .pc { padding-left: 9px; }
.p.on .pc b { background: #fff; color: #0b1220; }
.pc .tg { display: none; grid-area: t; gap: 4px; min-width: 0; overflow: hidden; align-items: center; }
.tg i { font-style: normal; font-size: 10.5px; font-weight: 800; line-height: 1; background: #e11d48; color: #fff; border-radius: 4px; padding: 3px 5px; white-space: nowrap; } .tg i.o { background: #ffffff2e; }
.pc s small { display: none; font-size: .55em; font-weight: 600; opacity: .65; margin-left: 5px; letter-spacing: 0; }
.p.on.dg::before { content: ""; position: absolute; top: 0; right: 0; border: 5px solid; border-color: #ff4d5e #ff4d5e transparent transparent; z-index: 1; }
@container (min-width: 180px) {
  .p.on .pc { grid-template: "n u d t k" 1fr / auto auto auto 1fr auto; gap: 0 9px; padding: 0 9px; }
  .p.on .pc b { font-size: clamp(11.5px, 46cqh, 17px); min-width: 2.7em; padding: .2em .4em; border-radius: 5px; }
  .p.on .pc em { font-size: clamp(12px, 46cqh, 17px); font-weight: 700; letter-spacing: .02em; }
  .p.on .pc q { justify-self: start; font-size: clamp(10.5px, 40cqh, 14.5px); line-height: 1; padding: .28em .65em; border-radius: 99px; background: color-mix(in srgb, var(--dc) 70%, #fff 30%); color: #fff; }
  .p.on .pc s { font-size: clamp(13.5px, 60cqh, 24px); letter-spacing: -.01em; }
}
@container (min-width: 250px) { .pc .tg { display: flex; } .p.on.dg::before { display: none; } }
@container (min-width: 430px) { .pc s small { display: inline; } .p.on .pc { gap: 0 14px; padding: 0 14px 0 12px; } }
.paper .deck .p.on { box-shadow: inset 0 0 0 1.5px #000; border-color: #000; } .paper .pc q { background: none !important; padding: 0 !important; color: #000 !important; }
.paper .tg i { background: none; color: #000; border: 1px solid #000; }

/* mid-width boxes (half rows in the All view): digits only, tighter tag */
@container (min-width: 62px) and (max-width: 129.9px) { .p.on .pc { padding: 0 3px 1px 7px; gap: 1px 3px; } .p.on .pc em u { display: none; } .p.on .pc s { font-size: 13px; } .p.on .pc b { font-size: 10px; padding: 0 3px; } .p.on .pc em, .p.on .pc q { font-size: 10px; } }

/* ═════════ Corporate light theme (the only theme) ═════════ */
:root:root {
  color-scheme: light;
  --bg: #f2f4f8; --card: #ffffff; --card2: #eef1f6; --line: #d8dee8; --tx: #0f1b33; --mut: #5a677f;
  --pri: #12408f; --pri-tx: #fff; --ok: #0e8a5c; --warn: #b7791f; --bad: #c62838;
  --d1: #1d4ed8; --d2: #c2410c; --d3: #7e22ce; --d0: #475569; --empty: #f5f7fb; --blocked: #ffffff; --cap: #5a677f;
}
html, body { background: var(--bg); }
header.bar:not(.min) { background: #fff; border-bottom: 1px solid var(--line); }
header.bar h1 { letter-spacing: -.01em; }
nav.tabs { background: #fff; }
.card { box-shadow: 0 1px 2px #0f1b330d; border-color: var(--line); }
.card > h2 { color: var(--pri); }
.ib, .btn { background: #fff; border: 1px solid var(--line); } .ib.sm { background: #fff; }
.btn.pri { border-color: var(--pri); background: var(--pri); }
label.f > input, label.f > select, label.f > textarea, .inp { background: #fff; }
.seg { background: var(--card2); border-color: var(--line); }
.chip { background: #fff; }
.kpi, .menu button, .fp { background: var(--card2); }
.toast { background: #0f1b33; }
dialog#sheet { background: #fff; }
.fab { box-shadow: 0 8px 22px #12408f55; }
.cgbar { background: #e3e8f0; } .cgbar i { background: color-mix(in srgb, var(--ok) 42%, transparent); }
.gauge { background: #fff; border: 1px solid var(--line); }
#doc { background: #e6eaf1; } #doc .dbar { border-bottom: 1px solid var(--line); }

.deck { background: #fff; border-color: #c9d1de; box-shadow: 0 1px 3px #0f1b3312; }
.deck .heads span { color: var(--mut); }
.p { background: var(--empty); border-color: var(--line); color: var(--tx); }
.p.blk { background: repeating-linear-gradient(135deg, #fff 0 5px, #edf0f5 5px 6px); }
.deck .p.on { background: color-mix(in srgb, var(--dc) 8%, #fff); border: 1px solid color-mix(in srgb, var(--dc) 42%, #fff); box-shadow: inset 5px 0 0 var(--dc), 0 1px 2px #0f1b3318; }
.p.on .pc, .p.on .pc s, .p.on .pc em { color: var(--tx); }
.p.on .pc b { background: var(--tx); color: #fff; }
.p.on .pc q { color: var(--dc); }
@container (min-width: 180px) { .p.on .pc q { background: var(--dc); color: #fff; } }
.pc s small { opacity: 1; color: var(--mut); }
.tg i.o { background: #e2e8f0; color: #334155; }
.p.lim .pc s { color: #b45309; }
.p.can { background: color-mix(in srgb, var(--ok) 13%, #fff); } .p.can .pc s { color: #0b6b47; }
.p.can.risk { background: color-mix(in srgb, var(--warn) 18%, #fff); } .p.can.risk .pc s { color: #8a5a12; }
.p.on.can { box-shadow: inset 5px 0 0 var(--dc), inset 0 0 0 2px var(--ok); }
.p.sel { outline-color: #f59e0b; } .p.pk { outline-color: var(--pri); } .p.on.oh { outline-color: #94a3b8; }
.p.on.no { opacity: .45; } .p.no { opacity: .4; }
.p.ret { background: color-mix(in srgb, var(--pri) 12%, #fff); }
.dock { background: #fff; border-color: #c9d1de; box-shadow: 0 1px 3px #0f1b3312; }
.dock.drop { background: #fff8eb; } .dock.over { background: #fde9c4; }
.gr em.pre, .cgbar u { color: #b45309; } .cgbar u { background: #f59e0b; }
@media (min-width: 900px) { #app[data-view=flight] > nav.tabs button[aria-current] { background: color-mix(in srgb, var(--pri) 10%, #fff); } }
.pc .tg { margin-right: 6px; }
@container (max-width: 359.9px) { .tg i:nth-child(n+3) { display: none; } }

/* legacy (PHP-identical) sheets: scaled to the screen, true size on paper */
.legacy { width: fit-content; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 10px #0f1b3326; }
@media print { .legacy { zoom: 1 !important; margin: 0; box-shadow: none; } .legacy .lts { margin: 16px 0 0 100px; } }

.paper.elts { max-width: 820px; padding: 22px 26px; overflow-x: auto; } .paper.elts pre { font: 600 13px/1.38 "Courier New", Consolas, monospace; white-space: pre; color: #000; }
@media (max-width: 620px) { .paper.elts { padding: 12px 10px; } .paper.elts pre { font-size: calc((100vw - 44px) / 39); } }
@media print { .paper.elts pre { font-size: 12.5pt; } }

/* badges give way first: the flexible column may shrink to nothing, weight never wraps or overlaps */
@container (min-width: 180px) { .p.on .pc { grid-template-columns: auto auto auto minmax(0, 1fr) auto; } .p.on .pc s { white-space: nowrap; } .p.on .pc em { min-width: 0; overflow: hidden; text-overflow: clip; } }
.pc .tg { flex-wrap: nowrap; } .tg i { flex: none; }

/* one-line rows: type is bounded by the row width as well as its height, so nothing collides in short-and-wide or tall-and-narrow boxes */
@container (min-width: 180px) {
  .p.on .pc b { font-size: clamp(11px, min(46cqh, 6.2cqw), 17px); } .p.on .pc em { font-size: clamp(11.5px, min(46cqh, 6.2cqw), 17px); }
  .p.on .pc q { font-size: clamp(10px, min(40cqh, 5.4cqw), 14.5px); } .p.on .pc s { font-size: clamp(13px, min(60cqh, 8.6cqw), 24px); }
}
@container (min-width: 180px) and (max-width: 239.9px) { .p.on .pc { gap: 0 6px; padding: 0 6px 0 8px; } .p.on .pc b { min-width: 0; padding: .2em .35em; } .p.on .pc q { padding: .28em .5em; } }

@container (min-width: 180px) {
  .p.on .pc b { font-size: clamp(11px, min(46cqh, 4.3cqw), 17px); } .p.on .pc em { font-size: clamp(11.5px, min(46cqh, 4.3cqw), 17px); }
  .p.on .pc q { font-size: clamp(10px, min(40cqh, 3.8cqw), 14.5px); } .p.on .pc s { font-size: clamp(13px, min(60cqh, 6cqw), 24px); }
}

.pc .tg { justify-self: stretch; max-width: 100%; margin-right: 0; }   /* stay inside its own column; extra badges are clipped, never drawn over the weight */

/* information form V.1 (A4 portrait) and tie-down table */
.paper.info { max-width: 794px; padding: 34px 44px 60px; font: 12px/1.35 "Open Sans", "Segoe UI", Arial, sans-serif; }
.paper.info table { margin-top: 16px; } .paper.info td, .paper.info th { border: 1px solid #000; padding: 7px 8px; font-size: 12px; background: #fff; }
.paper.info .ttl td { text-align: center; font-weight: 700; font-size: 15px; padding: 9px; } .paper.info .ttl .ver { width: 74px; }
.paper.info .frm th { text-align: center; font-weight: 700; } .paper.info .frm td.l { text-align: left; font-weight: 700; } .paper.info .frm td.top { vertical-align: top; }
.paper.info .frm td.v { text-align: center; font-weight: 700; height: 31px; } .paper.info .frm td.opt { text-align: left; font-weight: 400; line-height: 1.9; }
.paper.info .cb { font-size: 17px; vertical-align: -2px; margin: 0 3px 0 10px; } .paper.info .opt b + .cb { margin-left: 8px; }
.paper.info .note { text-align: right; margin-top: 14px; } .paper.info .sg { display: grid; grid-template-columns: 1.5fr 1fr; margin-top: 12px; } .paper.info .sg p { margin: 12px 0 0; }
.paper.tiep { max-width: 794px; }
.paper .tie td, .paper .tie th { text-align: center; font-size: 12px; padding: 3px 4px; height: 21px; } .paper .tie .hd1 { background: #fff; font-size: 14px; }
.paper .tie td.lb { text-align: center; font-weight: 700; text-decoration: underline; } .paper .tie td.blk { font-weight: 700; text-align: center; }
.paper .tie td.op { font-size: 11px; } .paper .tie td.st { border-left: 0; font-weight: 700; } .paper .tie tr.sh td { background: #d9d9d9; }
.paper .tie .act { background: #000; color: #fff; padding: 1px 4px; display: inline-block; } .paper .tie .tot td { font-weight: 700; text-align: center; }
.paper .tie td { background: #fff; } .paper .tie tr.sh td, .paper .tie tr.sh td.lb { background: #d9d9d9; } .paper .tie td.lb { border-width: 1px; }

/* field with a fixed prefix (flight number) */
.pre { display: flex; align-items: stretch; } .pre span { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--line); border-right: 0; border-radius: 11px 0 0 11px; background: var(--card2); font-size: 16px; font-weight: 700; color: var(--tx); }
.pre .inp { border-radius: 0 11px 11px 0; min-width: 0; }
label.f > input[type=date] { text-transform: none; -webkit-appearance: none; appearance: none; }
input, select, textarea { font-size: 16px; }                                    /* never below 16px: stops iOS zooming on focus */

/* live ULD check in the editor */
#uldLive:empty { display: none; }
.meter { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .15s; }
.meter.warn i { background: #f59e0b; } .meter.bad i { background: var(--bad); }
.mrow { display: flex; justify-content: space-between; font-size: 12.5px; margin-top: 4px; color: var(--mut); } .mrow b { color: var(--tx); font-variant-numeric: tabular-nums; }
.what { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .what span { background: var(--card2); border-radius: 8px; padding: 4px 9px; font-size: 12px; color: var(--mut); } .what b { color: var(--tx); } .what .tbad, .what .tbad b { color: var(--bad); }
ul.msgs.sm { margin-top: 8px; gap: 4px; } ul.msgs.sm li { padding: 7px 10px; font-size: 13px; }
label.f > input.err, .inp.err { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, #fff); color: var(--bad); }
