:root {
  --n950: #060b13; --n900: #0a121e; --n800: #111d2e; --n700: #1a2940; --n600: #253954;
  --line: rgba(255, 255, 255, .08);
  --ink: #f1f5f9; --ink2: #cbd5e1; --muted: #8494a7;
  --cyan: #38bdf8; --cyan-d: #0284c7; --amber: #fbbf24; --green: #34d399; --green-d: #059669; --red: #f87171; --red-d: #b91c1c;
  --f: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--n950); color: var(--ink); font: 14px/1.4 var(--f);
  display: flex; flex-direction: column; overflow: hidden;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.muted { color: var(--muted); }
.cyan { color: var(--cyan); } .amber { color: var(--amber); } .green { color: var(--green); }
.glass { background: rgba(10, 18, 30, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); }

/* header */
.top { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-width: 0 0 1px; z-index: 30; }
.brand { display: flex; align-items: center; min-width: 0; }
.brand-pill { display: flex; align-items: center; background: var(--n800); border: 1px solid rgba(14, 165, 233, .3); padding: 6px 12px; border-radius: 8px; letter-spacing: .06em; font-size: 13px; white-space: nowrap; }
.brand-pill svg { width: 18px; height: 18px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linejoin: round; }
.sep { width: 1px; height: 16px; background: var(--n600); }
.route-title { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-title b { color: var(--ink2); }
.status { display: flex; align-items: center; }
.badge { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.warn { background: rgba(245, 158, 11, .18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, .45); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .55; } }
/* storm simulation: the button, and a red frame around the map so nobody takes it for the real forecast */
.sim-btn { height: 34px; padding: 0 12px; border-radius: 8px; background: var(--n800); border: 1px solid #334155; color: var(--ink2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sim-btn.on { background: var(--red-d); border-color: var(--red); color: #fff; animation: blink 2s ease-in-out infinite; }
body.sim .mapwrap::after { content: "SIMULACIJA · NI PRAVA NAPOVED"; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 15; pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(239, 68, 68, .85); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; color: rgba(252, 165, 165, .9); }
.clock { text-align: right; font-size: 12px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.clock .muted { font-size: 10px; font-weight: 500; }

main { flex: 1; display: flex; min-height: 0; position: relative; }

/* sidebar */
/* on a short screen (or the overform.si frame) the whole panel scrolls; the analysis keeps a minimum height */
.side { width: 320px; flex: none; display: flex; flex-direction: column; border-width: 0 1px 0 0; z-index: 20; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.side > .block { flex: none; }
/* right panel: route risk analysis */
.side-r { width: 300px; border-width: 0 0 0 1px; }
.block { padding: 12px; border-bottom: 1px solid rgba(30, 41, 59, .9); }
.side > .block.grow { flex: 1 1 0; min-height: 160px; overflow-y: auto; border-bottom: 0; }
.side, .side > .block.grow { scrollbar-width: thin; scrollbar-color: var(--n600) transparent; }
.side::-webkit-scrollbar, .block.grow::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb, .block.grow::-webkit-scrollbar-thumb { background: var(--n600); border-radius: 3px; }
.side::-webkit-scrollbar-track, .block.grow::-webkit-scrollbar-track { background: transparent; }
/* app.js fitPanels(): let the analysis take its natural height while measuring */
main.fit-measure .side > .block.grow { flex: none; min-height: 0; overflow: visible; }
.block.foot { border-top: 1px solid rgba(30, 41, 59, .9); border-bottom: 0; background: var(--n950); }
.h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.seg2, .grid2, .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { min-height: 40px; border-radius: 8px; background: var(--n800); border: 1px solid #334155; color: var(--ink2); font-size: 12px; font-weight: 600; }
.seg.on { background: var(--cyan-d); border-color: var(--cyan-d); color: #fff; box-shadow: 0 6px 16px rgba(2, 132, 199, .3); }
.seg.on.safe { background: var(--green-d); border-color: var(--green-d); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.tile { background: rgba(10, 18, 30, .9); border: 1px solid #1e293b; border-radius: 12px; padding: 10px; position: relative; }
.lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.val { font-size: 24px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.steps { position: absolute; top: 6px; right: 6px; display: flex; }
.steps button { width: 26px; height: 26px; border-radius: 6px; background: var(--n700); color: var(--cyan); font-weight: 700; }
.toggle { min-height: 40px; padding: 6px 10px; border-radius: 8px; background: var(--n900); border: 1px solid #334155; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; position: relative; }
.toggle::after { content: ""; position: absolute; right: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; border: 2px solid #475569; }
.toggle.on { background: #082f49; border-color: rgba(14, 165, 233, .5); color: #7dd3fc; }
.toggle.on::after { background: var(--cyan); border-color: var(--cyan); }

.risk { padding: 12px; border-radius: 12px; border: 1px solid; font-size: 12px; color: var(--ink2); }
.risk b { display: block; font-size: 12px; margin-bottom: 4px; }
.risk.none { border-color: #334155; background: rgba(30, 41, 59, .4); }
.risk.ok { border-color: rgba(16, 185, 129, .5); background: rgba(6, 78, 59, .35); } .risk.ok b { color: #6ee7b7; }
.risk.caution { border-color: rgba(245, 158, 11, .5); background: rgba(120, 53, 15, .35); } .risk.caution b { color: #fcd34d; }
.risk.danger { border-color: rgba(239, 68, 68, .5); background: rgba(127, 29, 29, .4); } .risk.danger b { color: #fca5a5; }
.leave-card { display: block; padding: 12px; border-radius: 12px; border: 1px solid; color: var(--ink2); font-size: 12px; }
.leave-card .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.leave-card b { display: block; font-size: 18px; font-weight: 800; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.leave-card.ok { border-color: rgba(16, 185, 129, .5); background: rgba(6, 78, 59, .35); } .leave-card.ok b { color: #6ee7b7; }
.leave-card.caution { border-color: rgba(245, 158, 11, .5); background: rgba(120, 53, 15, .35); } .leave-card.caution b { color: #fcd34d; }
.leave-card.danger { border-color: rgba(239, 68, 68, .5); background: rgba(127, 29, 29, .4); } .leave-card.danger b { color: #fca5a5; }
.wps { margin-top: 10px; background: rgba(10, 18, 30, .6); border: 1px solid #1e293b; border-radius: 12px; padding: 10px; }
.wps-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink2); border-bottom: 1px solid #1e293b; padding-bottom: 6px; margin-bottom: 6px; }
.wp { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; color: var(--ink2); }
.wp i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.wp.l1 i { background: var(--amber); } .wp.l2 i { background: var(--red); }
.wp .t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.wp.l1 .t { color: var(--amber); font-weight: 700; } .wp.l2 .t { color: var(--red); font-weight: 700; }
.wp .w { grid-column: 2 / 4; font-size: 10px; color: var(--muted); margin-top: -2px; }
.btn { min-height: 40px; padding: 8px 14px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.btn.green { background: var(--green-d); color: #fff; width: 100%; }
.btn.ghost { background: rgba(69, 10, 10, .6); color: var(--ink2); width: 40px; }
.src { font-size: 10px; margin-top: 8px; text-align: center; }

.dest-row { display: flex; }
.dest-row select { flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 8px; background: var(--n800); border: 1px solid #334155; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; }
.seg.pick { flex: none; padding: 0 12px; }
.seg.pick.on { background: var(--cyan-d); border-color: var(--cyan-d); color: #fff; }
.dest-note { font-size: 11px; color: var(--amber); margin-top: 6px; }

/* map */
.mapwrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; }
.leaflet-container { background: var(--n950); font-family: var(--f); }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .5) !important; }
.leaflet-control-zoom a { background: var(--n800) !important; color: var(--cyan) !important; border: 1px solid rgba(255, 255, 255, .1) !important; width: 44px !important; height: 44px !important; line-height: 42px !important; font-size: 20px !important; border-radius: 8px !important; margin-bottom: 4px; }
.leaflet-control-attribution { background: rgba(6, 11, 19, .7) !important; color: var(--muted) !important; font-size: 9px; }
.leaflet-control-attribution a { color: var(--ink2) !important; }

.vessel { position: relative; width: 32px; height: 32px; }
.vessel .ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: rgba(14, 165, 233, .5); animation: pulse 2s ease-in-out infinite; }
.vessel .core { position: absolute; top: 4px; right: 4px; bottom: 4px; left: 4px; border-radius: 50%; background: var(--cyan); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; }
.vessel .core svg { width: 12px; height: 12px; fill: var(--n950); }
@keyframes pulse { 0%, 100% { transform: scale(.95); opacity: .8; } 50% { transform: scale(1.35); opacity: .2; } }
.dest-pin { width: 30px; height: 30px; }
.dest-pin svg { width: 30px; height: 30px; fill: var(--green); stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.dest-pin circle { fill: var(--n950); stroke: none; }
.picking, .picking .leaflet-interactive { cursor: crosshair !important; }
.pick-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; padding: 6px 6px 6px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.pick-hint .btn.ghost { min-height: 32px; width: 32px; padding: 0; background: var(--n700); }
.wind { display: flex; align-items: center; background: rgba(10, 18, 30, .82); border: 1px solid rgba(71, 85, 105, .6); border-radius: 5px; padding: 1px 5px; font-size: 10px; font-weight: 700; color: #fcd34d; white-space: nowrap; width: max-content; }
.wind svg { width: 11px; height: 11px; fill: var(--amber); flex: none; }
.wind.l1 { color: #fdba74; border-color: rgba(249, 115, 22, .6); } .wind.l2 { color: #fca5a5; border-color: rgba(239, 68, 68, .7); }

.alert { position: absolute; top: 16px; left: 24px; right: 76px; z-index: 20; display: flex; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(153, 27, 27, .88); border: 1px solid rgba(248, 113, 113, .4); backdrop-filter: blur(12px); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.alert-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(220, 38, 38, .5); border: 1px solid rgba(248, 113, 113, .5); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; }
.alert-txt { flex: 1; min-width: 0; font-size: 12px; }
.alert-txt p { margin: 2px 0 0; color: var(--ink); }
.alert-txt b { color: #fecaca; }
.tag { background: #ef4444; color: #fff; font-size: 10px; font-weight: 900; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; letter-spacing: .04em; }
.alert-act { display: flex; flex: none; }
.alert-act .btn.green { width: auto; background: #10b981; color: var(--n950); }

.timeline { position: absolute; left: 24px; right: 24px; bottom: 24px; z-index: 20; display: flex; align-items: center; padding: 12px 14px; border-radius: 16px; border-color: rgba(51, 65, 85, .6); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.play { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--cyan-d); color: #fff; font-size: 16px; }
.tl-label { width: 132px; flex: none; }
.tl-label #tlLabel { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-slider { flex: 1; min-width: 0; }
.ticks { position: relative; height: 14px; margin-top: 4px; font-size: 10px; font-weight: 600; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span.now { color: var(--cyan); }
.ticks span.first { transform: none; } .ticks span.last { transform: translateX(-100%); }
.ticks span.bad { color: var(--red); font-weight: 800; }
.ticks span.eta { color: var(--ink2); }
.ticks span.leave { color: var(--green); font-weight: 800; }
.hist { height: 44px; flex: none; padding: 0 10px; border-radius: 12px; background: var(--n700); color: var(--muted); font-size: 12px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .06); }
.hist.on { background: rgba(56, 189, 248, .18); color: var(--cyan); border-color: rgba(56, 189, 248, .5); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; margin: 0; height: 28px; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; background: var(--n700); border-radius: 4px; border: 1px solid rgba(255, 255, 255, .05); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(56, 189, 248, .5); }
input[type=range]::-moz-range-track { height: 8px; background: var(--n700); border-radius: 4px; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--cyan); }
.side-legend { margin-top: 10px; font-size: 11px; color: var(--ink2); }
.side-legend .lbl { margin-bottom: 4px; }
.rain-bar { height: 8px; border-radius: 4px; opacity: .85; background: linear-gradient(90deg, #ded097 0 12%, #88ddee 12%, #00a3e0 24%, #005588 37%, #ffee00 37%, #ff8100 55%, #ff4400 55%, #5d0000 75%, #ffaaff 75%, #ff4eff 100%); }
.rain-ticks { position: relative; height: 14px; margin-top: 3px; font-size: 10px; color: var(--muted); }
.rain-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.hist.speed { min-width: 44px; color: var(--ink2); }


/* flex gap is missing in the evo3S browser: spacing via margins instead */
.brand > * + * { margin-left: 12px; }
.brand-pill > * + * { margin-left: 8px; }
.status > * + * { margin-left: 16px; }
.steps > * + * { margin-left: 4px; }
.wind > * + * { margin-left: 3px; }
.alert > * + * { margin-left: 14px; }
.alert-act > * + * { margin-left: 8px; }
.timeline > * + * { margin-left: 16px; }
.timeline > .hist + .hist, .timeline > .play + .hist { margin-left: 8px; }
.dest-row > * + * { margin-left: 8px; }
.pick-hint > * + * { margin-left: 12px; }

@media (max-width: 1100px) { .side { width: 290px; } .side-r { width: 270px; } }
@media (max-width: 820px) {
  main { flex-direction: column; }
  .mapwrap { order: 1; }
  .side { order: 2; width: auto; height: 28%; border-width: 1px 0 0; }
  .side-r { order: 3; width: auto; height: 24%; }
  .route-title, .sep { display: none; }
  .alert { left: 12px; right: 12px; flex-wrap: wrap; }
  .timeline { left: 12px; right: 12px; bottom: 12px; }
  .timeline > * + * { margin-left: 10px; }
  .tl-label { width: 84px; }
}

/* left panel: the departure card fills the space under the layers */
.side > .block.leave-block { flex: 1 0 auto; border-bottom: 0; }
.leave-block:empty, .leave-block .leave-card[hidden] { display: none; }
