@font-face { font-family: 'Karantina'; src: url('/fonts/karantina-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Karantina'; src: url('/fonts/karantina-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Miriam Libre'; src: url('/fonts/miriam-libre.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #1b2430; --muted: #5b6670; --faint: #9aa3ab; --line: #e2e6ea; --line-strong: #c9ced3;
  --brand: #b5177e; --brand-soft: #fbeff6; --track: #eef1f3;
  --inbound: #1f4fc2; --anchored: #c06a00; --berth: #0d7a52; --outbound: #4f7fd0; --lost: #75828f; --transit: #b4bcc3;
  --up: #1f5fa8; --down: #a85200;
  --display: 'Karantina', 'Arial Hebrew', sans-serif;
  --body: 'Miriam Libre', 'Arial Hebrew', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); }
body { font-family: var(--body); font-size: 15px; line-height: 23px; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.page { max-width: 1440px; margin: 0 auto; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.badge { font-size: 12px; line-height: 18px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 32px; padding: 18px 32px 0; border-bottom: 1px solid var(--line); }
.top-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 40px; }
.brand { font-family: var(--display); font-size: 52px; line-height: 44px; font-weight: 700; padding-bottom: 10px; color: var(--ink); text-decoration: none; }
.top-meta { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; font-size: 13px; line-height: 18px; color: var(--muted); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.tabs button { border: 0; background: transparent; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; padding: 8px 0; min-height: 40px; }
.tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 700; }
.tabs-ports button { font-family: var(--display); font-size: 28px; line-height: 28px; font-weight: 700; padding: 8px 0 12px; border-bottom-width: 4px; }
.tabs-small { gap: 4px 20px; }
.tabs-small button { font-size: 14px; line-height: 20px; }

/* map */
.map-section { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.map-col { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; }
.map-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 24px; padding: 2px 24px 0; border-bottom: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12px; line-height: 16px; padding: 6px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .n { color: var(--muted); }
.ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.map-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 380px; }
#map { position: absolute; inset: 0; background: #fff; }
.grat { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.grat span { position: absolute; direction: ltr; font-size: 11px; line-height: 14px; color: #5f7a90; background: rgba(255,255,255,.85); padding: 0 3px; }
.scale { position: absolute; bottom: 14px; left: 16px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.scale-bar { display: flex; height: 6px; border: 1px solid var(--ink); }
.scale-bar span { flex: 1; } .scale-bar span:first-child { background: var(--ink); } .scale-bar span:last-child { background: #fff; }
.scale-text { white-space: nowrap; font-size: 11px; line-height: 14px; background: rgba(255,255,255,.85); align-self: flex-start; padding: 0 3px; }
.maplibregl-ctrl-attrib { font-size: 11px; }

.ship { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; display: block; }
.ship svg { display: block; }
.ship.dim { opacity: .45; }
.ship.transit { width: 20px; height: 20px; cursor: default; }
.lbl { pointer-events: none; white-space: nowrap; }
.lbl-port { font-family: var(--display); font-size: 22px; line-height: 22px; font-weight: 700; color: var(--brand); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; display: flex; align-items: center; gap: 8px; }
.lbl-port i { width: 14px; height: 14px; border: 2.5px solid var(--brand); background: #fff; flex: none; }
.lbl-port.on i { background: var(--brand); }
.lbl-city { font-size: 14px; font-weight: 700; color: #6b6252; }
.lbl-zone { font-size: 13px; font-weight: 700; color: var(--brand); }
.lbl-sea { font-size: 16px; color: #5f7a90; letter-spacing: .25em; }

/* side panel */
.panel { flex: 1 1 320px; min-width: 0; max-width: 100%; border-right: 1px solid var(--line); padding: 20px 0 16px; max-height: 760px; overflow-y: auto; }
.panel h3 { margin: 0; padding: 0 24px 6px; font-family: var(--display); font-size: 32px; line-height: 32px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 14px 24px 4px; font-size: 13px; line-height: 18px; font-weight: 700; }
.group-head .n { font-weight: 400; color: var(--muted); }
.ship-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 6px 24px; border: 0; background: transparent; cursor: pointer; text-align: start; }
.ship-row:hover { background: var(--brand-soft); }
.ship-row .name { direction: ltr; unicode-bidi: isolate; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline-start: 17px; }
.ship-row .info { font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.ship-row .info.bad { color: var(--ink); font-weight: 700; }
.empty { padding: 12px 24px; color: var(--muted); }
.detail { display: flex; flex-direction: column; gap: 14px; padding: 0 24px 8px; }
.back { align-self: flex-start; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 13px; padding: 8px 0; min-height: 36px; }
.detail .vname { direction: ltr; unicode-bidi: isolate; text-align: right; font-family: var(--display); font-size: 36px; line-height: 34px; font-weight: 700; }
.detail .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: 13px; line-height: 18px; }
.detail .chips b { display: inline-flex; align-items: center; gap: 7px; }
.cargo { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 12px 0; }
.cargo .big { font-family: var(--display); font-size: 56px; line-height: 52px; font-weight: 700; direction: ltr; unicode-bidi: isolate; text-align: right; }
.cargo .big small { font-size: 26px; color: var(--muted); }
.bar { height: 6px; background: var(--track); margin-top: 8px; } .bar > span { display: block; height: 100%; background: var(--brand); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 14px; line-height: 20px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }

/* kpis */
.kpis { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.kpi { flex: 1 1 165px; min-width: 0; padding: 18px 22px 20px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; display: flex; flex-direction: column; gap: 2px; }
.kpi .l { font-size: 14px; line-height: 20px; color: var(--muted); }
.kpi .v { display: flex; align-items: baseline; gap: 8px; }
.kpi .v b { font-family: var(--display); font-size: clamp(44px, 4.2vw, 60px); line-height: 1; unicode-bidi: isolate; }
.kpi .v span { font-family: var(--display); font-size: 26px; line-height: 26px; color: var(--muted); unicode-bidi: isolate; }
.kpi .d { font-size: 13px; line-height: 18px; color: var(--muted); }
.up { color: var(--up) !important; } .down { color: var(--down) !important; }

/* comparison */
.compare { padding: 44px 32px 0; display: flex; flex-direction: column; gap: 36px; }
.compare-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px; }
.compare-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.compare h2 { margin: 0; font-family: var(--display); font-size: 52px; line-height: 46px; }
.two { display: flex; flex-wrap: wrap; gap: 36px 56px; }
.block { min-width: 0; }
.block-wide { flex: 999 1 520px; } .block-narrow { flex: 1 1 400px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.block-head h3 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 32px; }
.block-head span { font-size: 12px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 13px; line-height: 18px; font-weight: 700; color: var(--muted); padding: 10px; vertical-align: bottom; }
th:first-child, td:first-child { padding-right: 0; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
thead tr { border-bottom: 1px solid var(--line-strong); }
tr.me { background: var(--brand-soft); }
tr.me td:first-child { font-weight: 700; }
.num { direction: ltr; unicode-bidi: isolate; text-align: right; }
.league { min-width: 900px; }
.league thead tr { border-bottom: 2px solid var(--ink); }
.league th button { border: 0; background: transparent; cursor: pointer; text-align: start; padding: 0; min-height: 40px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--muted); }
.league th button b { color: inherit; font-size: 13px; }
.league th button[aria-pressed="true"] { color: var(--ink); }
.league th small { font-size: 12px; font-weight: 400; color: var(--muted); }
.league td.port { font-family: var(--display); font-size: 26px; line-height: 24px; font-weight: 700; padding: 14px 8px 14px 0; }
.league tr.me td.port { color: var(--brand); }
.league td { padding: 14px 10px; font-size: 16px; }
.rk { font-size: 12px; font-weight: 700; color: var(--faint); margin-inline-start: 8px; }
.rk.first { color: var(--brand); }
.best { font-weight: 700; }
.dots-row { display: grid; grid-template-columns: 104px 1fr 92px; align-items: center; gap: 12px; padding: 2px 0; }
.dots-row .t { font-size: 13px; line-height: 18px; }
.dots-row .v { text-align: left; font-size: 14px; font-weight: 700; }
.scale-line { position: relative; height: 46px; }
.scale-line::before { content: ''; position: absolute; top: 22px; left: 0; right: 0; height: 1px; background: var(--line-strong); }
.pt { position: absolute; top: 22px; width: 0; height: 0; }
.pt i { position: absolute; background: #8a949e; }
.pt.me i { background: var(--brand); }
.pt em { position: absolute; right: -26px; width: 52px; text-align: center; font-style: normal; font-size: 11px; line-height: 14px; color: var(--muted); }
.pt.me em { color: var(--brand); font-weight: 700; }
.trend svg { display: block; width: 100%; height: auto; margin-top: 14px; }
.origin-bar { display: flex; align-items: center; gap: 10px; }
.origin-bar i { flex: 1; height: 8px; background: var(--track); position: relative; }
.origin-bar i b { position: absolute; inset: 0 0 0 auto; background: #8a949e; }
.foot { margin-top: 48px; padding: 16px 32px 28px; border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--muted); }

@media (max-width: 700px) {
  .top, .compare { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 44px; }
  .tabs-ports { gap: 4px 18px; }
  .tabs-ports button { font-size: 24px; }
  .map-tools { padding: 2px 16px 0; }
  .panel { border-right: 0; border-top: 1px solid var(--line); max-height: none; }
  .compare h2 { font-size: 44px; line-height: 40px; }
  .foot { padding: 16px; }
}
