/* Navo Loading app. Layout follows Navo Carbon / Maps Platform: sidebar left, 3D stage right. DS tokens from navo-ds.css. */
:root { --side-w: 460px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font-sans, Switzer, system-ui, sans-serif); color: var(--text-primary); background: var(--bg-sunken); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, select, input { font-family: inherit; }
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--bg-base); border-right: 1px solid var(--border-default); z-index: 5; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
.side-head > div { flex: 1; }
.brand-mark { flex: none; height: 28px; width: auto; }
.brand-title { font-family: var(--font-display, Ranade, serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--text-tertiary); }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-track); color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; flex: none; }
.side-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.side-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 20px; font-size: 12px; color: var(--text-tertiary); border-top: 1px solid var(--border-default); }
.side-foot b { color: var(--text-secondary); font-weight: 600; }
.side-foot a { color: var(--link); text-decoration: none; }

/* stepper */
.steps { display: flex; gap: 4px; margin: 0 20px; padding: 4px; border-radius: 999px; background: var(--bg-track); }
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 999px; background: none; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; }
.step b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-base); color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
.step.active { background: var(--bg-base); color: var(--text-primary); box-shadow: var(--shadow-1); }
.step.active b { background: var(--accent); color: #fff; }
.step.done b { background: var(--accent-wash); color: var(--accent); }
.step[disabled] { opacity: .5; cursor: default; }

.pane { display: flex; flex-direction: column; gap: 12px; }
.label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hint { margin: 0; font-size: 12px; color: var(--text-tertiary); min-height: 16px; line-height: 1.5; }
.hint.err { color: var(--badge-error-text); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: var(--bg-track); color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--accent-wash); color: var(--accent); border-color: var(--accent-wash-border); }

.eq-list { display: flex; flex-direction: column; gap: 8px; }
.eq { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: 16px; background: var(--bg-base); text-align: left; cursor: pointer; color: var(--text-primary); }
.eq:hover { border-color: var(--border-strong); }
.eq.on { border-color: var(--accent); background: var(--accent-wash); }
.eq svg { width: 52px; height: 30px; color: var(--text-tertiary); }
.eq.on svg { color: var(--accent); }
.eq b { display: block; font-size: 14px; font-weight: 600; }
.eq small { display: block; color: var(--text-tertiary); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.eq .code { font-size: 12px; color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }

/* cargo lines */
.units { display: flex; gap: 6px; }
.units select { height: 30px; padding: 0 10px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-base); color: var(--text-primary); font-size: 12px; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { border: 1px solid var(--border-default); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-base); }
.line-head { display: flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.line-head input { flex: 1; min-width: 0; height: 32px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--text-primary); outline: none; padding: 0; }
.line-head select { height: 30px; padding: 0 8px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-base); color: var(--text-secondary); font-size: 12px; }
.x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--text-tertiary); cursor: pointer; font-size: 18px; line-height: 1; }
.x:hover { background: var(--bg-track); color: var(--text-primary); }
.dims { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dims label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.dims input { width: 100%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-base); color: var(--text-primary); font-size: 13px; font-variant-numeric: tabular-nums; outline: none; }
.dims input:focus, .line-head select:focus, .units select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.flags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-secondary); }
.flags label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.flags input { accent-color: var(--accent); }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.totals { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.totals b { color: var(--text-primary); font-weight: 600; }

/* buttons */
.btn-primary, .btn-secondary, .btn-tertiary { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 22px; border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent-hover); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-secondary { background: var(--bg-base); color: var(--text-primary); box-shadow: var(--shadow-surface-rest); }
.btn-secondary:hover { box-shadow: var(--shadow-surface-hover); }
.btn-tertiary { background: var(--bg-track); color: var(--text-primary); }
.sm { height: 32px; padding: 0 14px; font-size: 12px; }

/* result */
.card { background: var(--bg-base); border: 1px solid var(--border-subtle-line); border-radius: var(--r-card, 24px); padding: 20px; box-shadow: var(--shadow-surface-rest); }
.card h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); }
.big { font-family: var(--font-display, Ranade, serif); font-size: 38px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.big small { font-size: 16px; color: var(--text-secondary); font-weight: 500; margin-left: 4px; }
.sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.meter span { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.meter span b { color: var(--text-primary); }
.bar { height: 8px; border-radius: 999px; background: var(--bg-track); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.kv dt { color: var(--text-tertiary); } .kv dd { margin: 0; text-align: right; }
.mini-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--badge-neutral-bg); color: var(--badge-neutral-text); }
.mini-badge.success { background: var(--badge-success-bg); color: var(--badge-success-text); }
.mini-badge.warning { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.mini-badge.error { background: var(--badge-error-bg); color: var(--badge-error-text); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.legend-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--divider); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.legend-row:first-of-type { border-top: 0; }
.legend-row small { display: block; color: var(--text-tertiary); font-size: 12px; }
.legend-row.dim { opacity: .45; }
.alt { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--divider); }
.alt:first-of-type { border-top: 0; }
.alt.best b { color: var(--accent); }
.alt small { color: var(--text-tertiary); }
.issues { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.issues li { padding-left: 14px; position: relative; }
.issues li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); }
.issues li.blk::before { background: var(--badge-error-text); }
.issues li.wrn::before { background: var(--badge-warning-text); }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.checks div { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.checks small { display: block; color: var(--text-tertiary); font-size: 12px; }
.ck { width: 16px; height: 16px; margin-top: 2px; }
.ck.pass { color: var(--badge-success-text); } .ck.warn { color: var(--badge-warning-text); } .ck.fail { color: var(--badge-error-text); } .ck.na { color: var(--text-tertiary); }
details.card > summary { cursor: pointer; list-style: none; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); font-weight: 600; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 12px; }
.seqlist { display: flex; flex-direction: column; font-size: 13px; font-variant-numeric: tabular-nums; }
.seqlist div { display: grid; grid-template-columns: 28px 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--divider); }
.seqlist div:first-child { border-top: 0; }
.seqlist small { color: var(--text-tertiary); }
.note { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; margin: 0; }
.tab-num { font-variant-numeric: tabular-nums; }

/* stage */
.stage { position: relative; min-width: 0; background: var(--bg-sunken); }
#view { position: absolute; inset: 0; }
#view canvas { display: block; outline: none; }
.stage-top { position: absolute; top: 16px; left: 16px; display: flex; gap: 6px; flex-wrap: wrap; padding: 4px; border-radius: 999px; background: var(--bg-base); box-shadow: var(--shadow-surface-rest); }
.stage-top button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.stage-top button.on { background: var(--accent-wash); color: var(--accent); }
.stage-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-base); box-shadow: var(--shadow-surface-rest); }
.tool { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; }
.tool.on, .tool:hover { background: var(--bg-track); color: var(--text-primary); }
.stage-play { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(560px, calc(100% - 32px)); padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--bg-base); box-shadow: var(--shadow-surface-hover); }
.stage-play input { flex: 1; accent-color: var(--accent); }
.stage-play span { font-size: 12px; color: var(--text-secondary); white-space: nowrap; min-width: 92px; text-align: right; }
.stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 12px; }
.stage-empty h2 { margin: 8px 0 0; font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.015em; max-width: 520px; }
.stage-empty p { margin: 0 0 8px; color: var(--text-secondary); max-width: 460px; line-height: 1.5; }
.stage-empty img { height: 56px; width: auto; }
.tip { position: absolute; pointer-events: none; z-index: 10; padding: 8px 12px; border-radius: var(--r-float, 12px); background: var(--bg-raised); box-shadow: var(--shadow-surface-hover); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.tip b { font-weight: 600; }

.ovl { position: fixed; inset: 0; background: rgba(11,13,16,.4); display: grid; place-items: center; z-index: 100; }
.ovl-card { background: var(--bg-base); border-radius: var(--r-modal, 20px); padding: 28px; max-width: 420px; box-shadow: var(--shadow-ovl); }
.ovl-card h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 24px; }
.ovl-card p { color: var(--text-secondary); margin: 0 0 18px; line-height: 1.5; }
.ovl-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: sp .8s linear infinite; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .side { border-right: 0; order: 2; } .stage { order: 1; height: 56vh; } .side-scroll { overflow: visible; }
  .stage-empty h2 { font-size: 24px; }
  .dims { grid-template-columns: repeat(3, 1fr); }
}
.v2d-wrap { position: absolute; inset: 0; overflow: auto; padding: 72px 32px 32px; display: flex; flex-direction: column; gap: 20px; }
.v2d { margin: 0; background: var(--bg-base); border-radius: var(--r-card, 24px); padding: 16px 20px 20px; box-shadow: var(--shadow-surface-rest); }
.v2d figcaption { font-size: 12px; color: var(--text-tertiary); margin-bottom: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.v2d svg { width: 100%; height: auto; display: block; }
.stage-empty h2 { text-wrap: balance; }

.seg.sub { margin-top: 8px; }
.seg.sub button { height: 28px; padding: 0 12px; }
.eq.off { cursor: default; opacity: .55; }
.eq.off:hover { border-color: var(--border-default); }

/* 6 equipment tabs in one row (Stefan 27.10) */
#cats { flex-wrap: nowrap; gap: 4px; }
#cats button { flex: 1 1 auto; min-width: 0; padding: 0 8px; white-space: nowrap; }

/* ===== Navo mobile app mode (html.in-app: framed by ai.navo24.com or ?app=1). Website layout untouched. Stefan 28.10.2026 ===== */
.app-only { display: none; }
html.in-app, html.in-app body { height: auto; min-height: 100%; background: var(--bg-base); }
html.in-app .app { display: flex; flex-direction: column; grid-template-columns: none; height: auto; min-height: 100dvh; }
html.in-app .side { order: 2; border: 0; flex: 1; }
html.in-app .side-head, html.in-app .side-foot { display: none; }
html.in-app .steps { position: sticky; top: 0; z-index: 20; margin: 0; border-radius: 0; padding: 8px 12px; background: var(--bg-base); border-bottom: 1px solid var(--border-subtle-line); gap: 6px; }
html.in-app .steps .step { flex: 1; height: 36px; border-radius: 999px; background: var(--bg-track); justify-content: center; }
html.in-app .steps .step.active { background: var(--accent-wash); color: var(--accent); }
html.in-app .side-scroll { overflow: visible; padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); }
html.in-app .stage { order: 1; display: none; height: 46vh; min-height: 280px; }
html.in-app[data-step="3"] .stage { display: block; }
html.in-app[data-step="3"] .steps { order: 0; }
html.in-app #cats { flex-wrap: wrap; gap: 6px; }
html.in-app #cats::-webkit-scrollbar { display: none; }
html.in-app #cats button { flex: 1 1 28%; height: 36px; padding: 0 10px; }
html.in-app .eq { padding: 14px; min-height: 64px; }
html.in-app .dims input, html.in-app .line-head input, html.in-app select { font-size: 16px; } /* no iOS zoom on focus */
html.in-app .dims input { height: 44px; }
html.in-app .x { width: 40px; height: 40px; }
html.in-app .row-btns .btn-tertiary { height: 40px; flex: 1 1 auto; }
html.in-app #toCargo, html.in-app #go { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; height: 52px; font-size: 16px; box-shadow: none; }
html.in-app #s1[hidden] ~ * #toCargo { display: none; }
html.in-app .app-sample { display: block; width: 100%; margin: 14px 0 0; height: 44px; border: 1px dashed var(--border-default); border-radius: 14px; background: none; color: var(--link, var(--accent)); font-size: 14px; font-weight: 500; cursor: pointer; }
html.in-app .stage-empty { display: none; }
html.in-app .stage-top { top: 10px; left: 10px; right: 10px; overflow-x: auto; flex-wrap: nowrap; }
html.in-app .stage-tools { top: auto; bottom: 64px; right: 10px; }
html.in-app .stage-play { bottom: 10px; width: calc(100% - 20px); }
html.in-app .stage-play span { min-width: 0; }
html.in-app .v2d-wrap { padding: 56px 12px 12px; }
html.in-app .card { padding: 16px; border-radius: 18px; }
html.in-app .big { font-size: 32px; }
html.in-app .ovl { place-items: end stretch; }
html.in-app .ovl-card { max-width: none; border-radius: 20px 20px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
html.in-app .ovl-btns > * { flex: 1; }
html.in-app .tip { display: none; }
html.in-app .nai-btn { display: none !important; } /* the app has its own AI Mode, no launcher inside the frame */
html.in-app .steps .step { min-width: 0; padding: 0 6px; font-size: 13px; }
html.in-app .dims { grid-template-columns: repeat(3, 1fr); gap: 8px; }
html.in-app .stage .v2d-wrap { overflow: auto; }
html.in-app:not([data-step="3"]) body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; height: calc(84px + env(safe-area-inset-bottom)); background: var(--bg-base); border-top: 1px solid var(--border-subtle-line, rgba(0,0,0,.08)); }
html.in-app .side { z-index: auto; } /* flex item with z-index traps the fixed CTA under the footer bar */
html.in-app .stage-play { box-sizing: border-box; gap: 8px; padding: 6px 14px 6px 6px; }
html.in-app .stage-play input { min-width: 0; width: auto; }
html.in-app .stage-play span { flex: 0 1 auto; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }

/* manual layout editor */
.stage-edit { position: absolute; left: 16px; bottom: 76px; z-index: 5; display: flex; flex-direction: column; gap: 4px; padding: 8px; max-width: min(460px, calc(100% - 32px)); border-radius: var(--r-float, 12px); background: var(--bg-base); box-shadow: var(--shadow-surface-hover); }
.stage-edit[hidden] { display: none; }
.ed-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ed-head { justify-content: space-between; gap: 12px; padding: 2px 6px 4px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ed-head b { color: var(--text-primary); font-weight: 600; }
.stage-edit .tool { background: var(--bg-sunken); }
.stage-edit .tool:disabled { opacity: .4; cursor: default; }
.stage-edit .tool.on { background: var(--accent-wash); color: var(--accent); }
.stage-edit .ed-save { background: var(--accent); color: #fff; }
.edit-msg { padding: 6px 8px; border-radius: 8px; font-size: 12px; line-height: 1.4; word-break: break-word; }
.edit-msg.ok { background: var(--accent-wash); color: var(--text-primary); }
.edit-msg.bad { background: rgba(229,72,77,.12); color: #C2272D; }
.edit-msg[hidden] { display: none; }
.tray-row button { margin-left: auto; }
.payg { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.payg[hidden] { display: none; }
.payg-h { margin: 0; font-size: 13px; font-weight: 600; }
.payg-o { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.payg-msg { margin: 0; font-size: 12px; color: var(--text-secondary); }
@media (max-width: 900px) {
  .stage-edit { left: 8px; right: 8px; bottom: 64px; max-width: none; padding: 6px; }
  .stage-edit .tool { height: 34px; padding: 0 10px; }
}
html.in-app .stage-edit { left: 6px; right: 6px; bottom: 56px; max-width: none; }

/* manual layout editor on phones: the panel goes under the 3D view instead of covering it (Callum 05.11.2026) */
@media (max-width: 900px) {
  .stage.editing { height: auto; display: flex; flex-direction: column; }
  .stage.editing #view { position: relative; inset: auto; height: 52vh; min-height: 300px; }
  .stage.editing .stage-edit { position: static; margin: 8px; max-width: none; box-shadow: none; border: 1px solid var(--border-subtle-line); }
  .stage.editing .stage-play { display: none; }
}
html.in-app .stage.editing { height: auto; }
html.in-app .stage.editing #view { height: 44vh; min-height: 260px; }
html.in-app .stage.editing .stage-tools { bottom: auto; }
