/* Layout: one-screen chart table. Sea chart on top (or left on desktop), dispatch panel below with tabs. */
:root {
  --paper: #eef3f2;
  --card: #ffffff;
  --sea: #d4e5e9;
  --shoal: #b5d2db;
  --land: #e8dcb5;
  --land-edge: #9a8857;
  --ink: #12242b;
  --muted: #5a6d73;
  --line: #cddadd;
  --accent: #d4470e;
  --accent-ink: #ffffff;
  --ok: #2c7a39;
  --bad: #bf3424;
  --grid: rgba(18, 36, 43, .11);
  --storm: rgba(52, 62, 110, .20);
  --storm-edge: rgba(52, 62, 110, .55);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --f-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #081117; --card: #0f1b22; --sea: #0b1922; --shoal: #10303b; --land: #24261a; --land-edge: #5a5a3b;
    --ink: #d4e1e4; --muted: #7d9399; --line: #1c2e37; --accent: #ff7a36; --accent-ink: #1b0b02;
    --ok: #5fcf74; --bad: #ff6f5f; --grid: rgba(212, 225, 228, .07); --storm: rgba(150, 165, 230, .16); --storm-edge: rgba(170, 185, 240, .5);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --paper: #081117; --card: #0f1b22; --sea: #0b1922; --shoal: #10303b; --land: #24261a; --land-edge: #5a5a3b;
  --ink: #d4e1e4; --muted: #7d9399; --line: #1c2e37; --accent: #ff7a36; --accent-ink: #1b0b02;
  --ok: #5fcf74; --bad: #ff6f5f; --grid: rgba(212, 225, 228, .07); --storm: rgba(150, 165, 230, .16); --storm-edge: rgba(170, 185, 240, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 14px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { position: fixed; inset: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); display: flex; flex-direction: column; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

header.bar { display: flex; flex-direction: column; gap: 8px; padding-block: 10px 9px; border-bottom: 1px solid var(--line); }
.row1, .row2 { display: flex; align-items: center; gap: 14px; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: .05em; text-transform: uppercase; }
.brand span { color: var(--accent); }
.envtag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: #e8a500; color: #1b1300; white-space: nowrap; max-width: 46vw; align-self: flex-start; overflow: hidden; text-overflow: ellipsis; }
.brandbox { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "brand brand" "tag tag" "name name"; align-items: center; gap: 4px 8px; min-width: 0; }
.brandbox.notag { grid-template-areas: "brand brand" "name name"; }
.brandbox .brand { grid-area: brand; }
.brandbox .envtag { grid-area: tag; justify-self: start; }
.rederi { grid-area: name; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 560px) {
  .brandbox { grid-template-columns: auto auto; grid-template-areas: "brand tag" "name name"; justify-content: start; }
  .envtag { max-width: 260px; }
}
.envtag .br { text-transform: none; letter-spacing: 0; font-weight: 600; }
.stats { margin-left: auto; display: flex; gap: 16px; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.lbl { font-family: var(--f-body); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { font-weight: 600; font-size: 15px; }
.stat b.neg { color: var(--bad); }
.goal { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.goal .lbl { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.cashstat { align-items: flex-start; min-width: 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.cashstat b { font-size: clamp(13px, 4vw, 16px); white-space: nowrap; }
.row2 { gap: 10px; }
@media (max-width: 385px) { .row2 .sound { width: 34px; } .row2 .speed button { width: 33px; } .row2 { gap: 8px; } }
.row2 .sound { margin-left: auto; }
.sound { border: 1px solid var(--line); background: transparent; border-radius: 8px; width: 40px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: none; }
.sound .m { display: none; }
.sound[aria-pressed="false"] .w { display: none; }
.sound[aria-pressed="false"] .m { display: block; }
.sound[aria-pressed="false"] { color: var(--muted); }
.speed { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.speed button { border: 0; background: transparent; width: 40px; height: 32px; font-family: var(--f-mono); font-size: 12px; font-weight: 600; cursor: pointer; display: grid; place-items: center; }
.speed button + button { border-left: 1px solid var(--line); }
.speed button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mapwrap { position: relative; flex: 0 0 auto; height: min(34dvh, 90vw); background: var(--sea); transition: height .25s; }
.mapwrap.big { height: min(62dvh, 118vw); }
.boatinfo { position: absolute; z-index: 5; pointer-events: none; width: max-content; max-width: min(250px, calc(100% - 16px)); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18); display: grid; gap: 4px; font-size: 12.5px; line-height: 1.35; }
.boatinfo .bi-h { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.boatinfo .bi-h small { font-weight: 500; font-size: 12px; color: var(--muted); }
.boatinfo .bi-cap { font-family: var(--f-mono); font-size: 12px; }
.boatinfo .bi-cap b { font-size: 15px; }
.boatinfo .bi-row { display: flex; justify-content: space-between; gap: 12px; }
.boatinfo .bi-row span:first-child { color: var(--muted); }
.boatinfo .bi-st { color: var(--muted); }
.boatinfo .bi-free { color: var(--ok); font-weight: 700; }
.idlechip { position: absolute; top: 8px; right: 8px; border: 0; background: var(--ok); color: #fff; border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.state { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; flex: none; }
.state.free { background: var(--ok); color: #fff; }
.state.busy { background: var(--line); color: var(--muted); }
.state.yard { background: #e8a500; color: #1b1300; }
.cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cond .cbar { flex: 1; min-width: 80px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.cond .cbar i { display: block; height: 100%; background: var(--ok); }
.cond.mid .cbar i { background: #e8a500; }
.cond.bad .cbar i { background: var(--bad); }
.cond b { font-family: var(--f-mono); font-size: 12.5px; min-width: 38px; }
.cond.bad b { color: var(--bad); }
.rep.diesel b { color: var(--ink); }
.rep.diesel.up b { color: var(--bad); }
.rep.diesel.down b { color: var(--ok); }
.boat.free { border-color: var(--ok); }
.freetxt { color: var(--ok); font-weight: 700; }
.mapsize { position: absolute; bottom: 8px; right: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.mapwrap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.mapctl { position: absolute; right: 8px; bottom: 46px; display: flex; flex-direction: column; gap: 6px; }
.mapctl button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.toasts { position: absolute; left: 10px; right: 52px; bottom: 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); font-size: 12.5px; padding: 7px 11px; border-radius: 7px; max-width: 100%; box-shadow: 0 4px 14px rgba(0,0,0,.18); animation: tin .25s ease-out; }
.toast.t-pay { background: var(--ok); color: #fff; }
.toast.t-bad { background: var(--bad); color: #fff; }
@keyframes tin { from { transform: translateY(6px); opacity: 0; } }

.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--paper); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: transparent; padding: 11px 4px 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .n { font-family: var(--f-mono); font-size: 11px; margin-left: 4px; color: var(--accent); }
.body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-block: 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.body > * { flex-shrink: 0; }

.hint { border: 1px dashed var(--muted); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.hint p { margin: 0; flex: 1; }
.x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--paper); border: 0; border-radius: 99px; padding: 5px 10px 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 2px; line-height: 1.5; }

.job { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.job.open { border-color: var(--accent); }
.job-head { display: grid; gap: 5px; width: 100%; text-align: left; background: transparent; border: 0; padding: 11px 12px; cursor: pointer; }
.l1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.gname { font-weight: 700; font-size: 15px; }
.tons { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.pill { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); }
.pay { margin-left: auto; font-family: var(--f-mono); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.l2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.l2 svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.nm { margin-left: auto; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.l3 { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.l3 .soon { color: var(--bad); }
.assign { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; gap: 7px; }
.assign .lbl { margin-bottom: 1px; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 9px 10px; cursor: pointer; min-height: 44px; }
.pick:hover:not(:disabled) { border-color: var(--ink); }
.pick:disabled { opacity: .5; cursor: not-allowed; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pick .pn { font-weight: 600; }
.pick > span:nth-child(2) { min-width: 0; }
.pick .pe { flex: none; margin-left: auto; font-size: 12px; font-family: var(--f-mono); text-align: right; }
.pe .ok { color: var(--ok); }
.pe .late { color: var(--bad); }
.pe .stops { color: var(--muted); }
.stat b { white-space: nowrap; }

.boat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; display: grid; gap: 7px; }
.boat.sel { border-color: var(--accent); }
.bh { display: flex; align-items: center; gap: 9px; }
.bh .bn { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bh .sell { white-space: nowrap; flex: none; }
.bh .bt { font-size: 12px; color: var(--muted); }
.bh .sell { margin-left: auto; }
.bst { font-size: 13px; }
.autob { justify-self: start; }
.bst .storm { color: var(--bad); font-weight: 600; }
.bar2 { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar2 i { display: block; height: 100%; width: 0; }
.specs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); }
.queue { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12.5px; }
.queue li { color: var(--muted); }
.queue li::before { content: "Neste: "; font-weight: 600; color: var(--ink); }

.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 38px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 5px 10px; min-height: 30px; font-size: 12px; }

.yard-intro { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.ship { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.ship h3 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 21px; letter-spacing: .03em; text-transform: uppercase; }
.ship p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ship .specs { grid-column: 1 / -1; }
.ship .price { font-family: var(--f-mono); font-weight: 600; text-align: right; font-size: 13px; }

.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.log li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.log .d { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); padding-top: 1px; }
.log .l-pay { color: var(--ok); }
.log .l-bad { color: var(--bad); }
.rep { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.rep b { font-family: var(--f-mono); color: var(--ok); font-size: 15px; white-space: nowrap; }
.rep span { color: var(--muted); }
.job.sos { border-color: var(--bad); }
.pill.sos { background: var(--bad); color: #fff; }
.pill.kai { background: var(--ink); color: var(--paper); }
.pill.mk { background: var(--web, #1c6ed6); color: #fff; text-transform: none; letter-spacing: 0; }
h4.sect { margin: 8px 0 0; font-family: var(--f-display); font-weight: 800; font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }
.quays { display: grid; gap: 6px; }
.quay { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 12px; }
.quay .qn { font-weight: 700; }
.quay .qi { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); }
.quay > div { min-width: 0; flex: 1; }
.quay .own { font-size: 12px; font-weight: 700; color: var(--ok); }
.regions { display: grid; gap: 8px; }
.region { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.region.own { border-color: var(--ok); }
.region h3 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; }
.region p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.region .rports { color: var(--ink); font-weight: 600; }
.region .rbuy { display: grid; justify-items: end; gap: 4px; }
.region .price { font-family: var(--f-mono); font-weight: 600; font-size: 13px; }
.region .own { font-size: 12px; font-weight: 700; color: var(--ok); }
.region .rneed { font-size: 12px; color: var(--muted); text-align: right; max-width: 110px; }
.testtools { display: flex; flex-wrap: wrap; gap: 8px; }
.leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lead { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: grid; gap: 2px; min-width: 0; }
.lead .who { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .who.me { color: var(--accent); }
.lead .val { font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.lead .you { font-size: 11.5px; color: var(--muted); }
.chartbox { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 6px; display: grid; gap: 6px; position: relative; }
.chartbox .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink); }
.chartbox .legend span { display: inline-flex; align-items: center; gap: 5px; }
.chartbox .legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chartbox svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chartbox .ax { fill: var(--muted); font-family: var(--f-mono); font-size: 10px; }
.chartbox .gl { stroke: var(--line); stroke-width: 1; }
.chartbox .dl { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chartbox .xh { stroke: var(--muted); stroke-width: 1; }
.chartbox .tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.15); display: grid; gap: 2px; min-width: 120px; }
.chartbox .tip b { font-family: var(--f-mono); }
.chartbox .tip .row { display: flex; align-items: center; gap: 6px; }
.chartbox .tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chartbox .tip .t { color: var(--muted); }
.fleetov { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.fo-head { display: flex; align-items: baseline; gap: 10px; }
.fo-head b { font-size: 15px; }
.fo-head span { color: var(--muted); font-size: 13px; }
.fo-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.fo-t th, .fo-t td { text-align: left; padding: 5px 4px; border-top: 1px solid var(--line); }
.fo-t thead th { border-top: 0; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.fo-t td:nth-child(2) { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.fo-t tbody th { font-weight: 600; white-space: nowrap; }
.fo-tip { margin: 0; font-size: 12.5px; color: var(--ink); background: var(--paper); border-radius: 8px; padding: 7px 9px; line-height: 1.45; }
.why { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.perf { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--muted); }
.perf b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; }
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; gap: 2px; min-width: 0; }
.summary b { font-family: var(--f-mono); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.modal { position: fixed; inset: 0; background: rgba(5, 12, 16, .55); display: grid; place-items: center; padding: 20px; z-index: 20; }
.sheet { background: var(--card); color: var(--ink); border-radius: 14px; padding: 22px 20px 18px; max-width: 380px; width: 100%; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.sheet h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 32px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.sheet p { margin: 0; line-height: 1.5; font-size: 14px; color: var(--muted); }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; }

.auth { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.auth label { display: grid; gap: 4px; }
.auth input { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 40px; width: 100%; }
.auth input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.authmode { align-self: start; }
.authmode button { width: auto; padding: 0 14px; font-family: var(--f-body); font-size: 13px; }
.auth .row { display: flex; gap: 8px; flex-wrap: wrap; }
.authmsg { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.authmsg.bad { color: var(--bad); }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.me span { flex: 1; min-width: 0; }
.lb { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lb li { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.lb li.self { border-color: var(--accent); }
.lb .rk { font-family: var(--f-mono); font-weight: 600; color: var(--muted); }
.lb .nmx { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; }
.lb .ks { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.lb .sub { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }

@media (min-width: 900px) {
  .main { flex-direction: row; }
  .mapwrap { flex: 1; height: auto; }
  .panel { flex: 0 0 430px; border-top: 0; border-left: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .track i { transition: none; } }
.rs-top { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; display: grid; gap: 7px; }
.rs-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rs-head span { color: var(--muted); font-size: 13px; font-family: var(--f-mono); }
.rs-cur { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rs-n { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.rs-eta { margin: 0; font-size: 13px; color: var(--muted); }
.tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tcol { display: grid; gap: 6px; align-content: start; }
.tnode { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; gap: 4px; }
.tnode .tn { font-weight: 700; font-size: 14px; }
.tnode .td { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tnode .tst { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tnode.have { border-color: var(--ok); }
.tnode.have .tst { color: var(--ok); }
.tnode.now { border-color: var(--accent); }
.tnode.now .tst { color: var(--accent); }
.tnode.later { opacity: .55; border-style: dashed; }
.tnode .btn { justify-self: start; }
@media (max-width: 420px) { .tabs button { font-size: 12.5px; padding-inline: 2px; } .tabs .n { margin-left: 2px; } }

/* events: offers and crises at the top of Oppdrag */
.evcard { background: var(--card); border: 1px solid var(--accent); border-left-width: 4px; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.evcard.bad { border-color: var(--bad); }
.evcard b { display: block; font-size: 14px; }
.evcard p { margin: 4px 0 8px; color: var(--muted); }
.evcard .row { display: flex; flex-wrap: wrap; gap: 8px; }
.evk { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.evcard.bad .evk { color: var(--bad); }
.evon { display: flex; flex-wrap: wrap; gap: 6px; }
.evon span { font-size: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 10px; color: var(--muted); }
.pill.rush { background: #e8a500; color: #1b1300; }

/* fixed routes and passive income */
.pass { font-size: 11px; color: var(--ok); font-weight: 600; white-space: nowrap; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pass.neg { color: var(--bad); }
.fo-pass { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.fo-pass b { color: var(--ok); font-family: var(--f-mono); }
.rt-on { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; font-size: 13px; background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 8px; padding: 6px 8px 6px 10px; }
.rt-on b { color: var(--ink); }
.rt-btn { justify-self: start; }
#mb .rt-intro, #mb .rt-sel, #mb .rt-est { display: block; }
#mb .rt-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
#mb .rt-sel label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
#mb .rt-sel select { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 40px; width: 100%; }
#mb .rt-est b.ok { color: var(--ok); }
#mb .rt-est b.neg { color: var(--bad); }

/* offices: trade prices and the bank */
.prices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.prices span { font-size: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 10px; color: var(--muted); }
.prices b { font-family: var(--f-mono); color: var(--ink); }
.prices .up b { color: var(--ok); }
.prices .down b { color: var(--bad); }
.bank { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.bank .lbl { display: block; font-size: 11px; color: var(--muted); }
.bank b { font-family: var(--f-mono); font-size: 13px; }
