/* Port pages - Persian Gulf Traffic.
   Formal: IBM Plex throughout (Sans Arabic for Persian/Arabic, Sans and Mono
   for Latin and codes), a navy brand bar, white cards on a cool grey page.
   Light is the default reading theme; dark keeps the app's navy/turquoise.
   Logical properties everywhere so fa/ar (RTL) and en (LTR) share one sheet. */
@import url('fonts/plex.css');

:root {
  color-scheme: light;
  --bg: #f2f5f9;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --line: #e2e8f0;
  --line-2: #edf1f6;
  --text: #0f1b2d;
  --text-2: #33445a;
  --muted: #5d6e84;
  --dim: #8a99ad;
  --brand: #0b1d39;
  --brand-2: #12305a;
  --accent: #0b9c8f;
  --accent-soft: #e3f5f2;
  --link: #1a5bb8;
  --link-soft: #e8f0fc;
  --ok: #138a52;
  --ok-soft: #e4f5ec;
  --warn: #b26b00;
  --warn-soft: #fdf1df;
  --bad: #c53030;
  --bad-soft: #fde8e8;
  --c-arr: #1f4f9c;
  --c-dep: #e0a326;
  --c-bar: #2f6fb3;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 16px rgba(15, 27, 45, .05);
  --shadow-up: 0 2px 4px rgba(15, 27, 45, .06), 0 12px 32px rgba(15, 27, 45, .10);
  --r: 12px;
  --font: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Plex Mono has Latin only: Persian/Arabic letters and digits in a code
     field fall through to Plex Sans Arabic, never to a system font */
  --mono: 'IBM Plex Mono', 'IBM Plex Sans Arabic', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070d1a;
  --card: #0e1728;
  --card-2: #111c30;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .05);
  --text: #e7eef6;
  --text-2: #c3cfdc;
  --muted: #8ea1b6;
  --dim: #63768c;
  --brand: #050b17;
  --brand-2: #0c1a33;
  --accent: #19d3c1;
  --accent-soft: rgba(25, 211, 193, .12);
  --link: #6eb1ff;
  --link-soft: rgba(110, 177, 255, .12);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .12);
  --warn: #f0b64b;
  --warn-soft: rgba(240, 182, 75, .13);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, .12);
  --c-arr: #5aa9ff;
  --c-dep: #f0b64b;
  --c-bar: #19d3c1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-up: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.pg { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.65 var(--font); overflow-x: hidden; }
html[lang="en"] body.pg { font-family: var(--font-en); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 600; }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: .01em; }
bdi { unicode-bidi: isolate; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* ── brand bar ───────────────────────────────────────── */
.pg-top { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; position: sticky; top: 0; z-index: 40; }
.pg-top::after { content: ''; display: block; height: 2px; background: linear-gradient(90deg, transparent, #19d3c1 30%, #19d3c1 70%, transparent); opacity: .7; }
.pg-top-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 22px; }
.pg-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 15.5px; white-space: nowrap; }
.pg-brand:hover { text-decoration: none; }
.pg-brand img { border-radius: 7px; background: rgba(255,255,255,.08); }
.pg-nav { display: flex; gap: 2px; background: rgba(255,255,255,.07); padding: 3px; border-radius: 999px; }
.pg-nav a { color: rgba(255,255,255,.78); padding: 5px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; }
.pg-nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.pg-nav a.is-on { background: rgba(25, 211, 193, .22); color: #fff; }
.pg-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.pg-langs { display: flex; gap: 2px; background: rgba(255,255,255,.07); padding: 3px; border-radius: 999px; }
.pg-langs a { color: rgba(255,255,255,.72); font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.pg-langs a:hover { text-decoration: none; color: #fff; }
.pg-langs a.is-on { background: #fff; color: var(--brand); font-weight: 600; }
.pg-icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.pg-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; } :root[data-theme="dark"] .ic-moon { display: none; }

main.pg-main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 48px; }

/* ── breadcrumb + header ─────────────────────────────── */
.pg-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.pg-crumbs a { color: var(--muted); }
.pg-crumbs span[aria-current] { color: var(--text); font-weight: 500; }
.pg-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.pg-head-main { flex: 1; min-width: 0; display: flex; gap: 14px; }
.pg-flag { width: 46px; height: 34px; border-radius: 5px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; flex: none; margin-top: 5px; }
.pg-title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
.pg-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 14px; margin-top: 2px; }
.pg-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.pg-sub .code { font-family: var(--mono); color: var(--text); font-weight: 500; letter-spacing: .06em; }
.pg-alt { color: var(--muted); font-size: 13.5px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.btn:hover { text-decoration: none; border-color: var(--link); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.btn-primary { background: var(--link); border-color: var(--link); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--link) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--link); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.off { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.badge.live { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.live i, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.8s infinite; }
.badge.replay { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .badge.live i, .live-dot { animation: none; } }
.pg-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── tabs ────────────────────────────────────────────── */
.pg-tabs { display: flex; gap: 4px; margin: 20px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; position: sticky; top: 58px; z-index: 30; background: var(--bg); }
.pg-tabs::-webkit-scrollbar { display: none; }
.pg-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px; color: var(--muted); font-weight: 500; font-size: 14.5px; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pg-tabs a:hover { text-decoration: none; color: var(--text); }
.pg-tabs a.is-on { color: var(--link); border-bottom-color: var(--link); }
.pg-tabs .count { font-size: 11.5px; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pg-tabs a.is-on .count { background: var(--link-soft); border-color: transparent; color: var(--link); }

/* ── layout + cards ──────────────────────────────────── */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { font-size: 15.5px; font-weight: 600; }
.card-h .note { font-size: 12.5px; color: var(--muted); }
.card-b { padding: 14px 18px; }
.card-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 22px 18px; text-align: center; }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── port monitor (map + replay) ─────────────────────── */
.monitor { position: relative; height: clamp(360px, 58vh, 560px); background: #cfdbe6; }
.monitor .maplibregl-map { position: absolute; inset: 0; }
.monitor canvas { cursor: default; }
.monitor .maplibregl-ctrl-attrib { font-size: 10px; }
.mon-loading { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 10px; color: #33445a; font-size: 13.5px;
  background: linear-gradient(110deg, #cfdbe6 30%, #dde7f0 50%, #cfdbe6 70%); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
:root[data-theme="dark"] .mon-loading { color: #c3cfdc; background: linear-gradient(110deg, #0f1a2e 30%, #16243d 50%, #0f1a2e 70%); background-size: 200% 100%; }
.mon-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(26, 91, 184, .2); border-top-color: var(--link); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mon-chips { position: absolute; z-index: 3; inset-inline-start: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; max-width: 70%; }
.mon-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(8, 18, 36, .78); color: #fff; font-size: 12.5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mon-chip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.mon-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mon-mode { position: absolute; z-index: 3; inset-inline-end: 12px; top: 12px; }
.mon-mode .badge { height: 28px; border: 0; background: rgba(8, 18, 36, .82); backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.mon-mode .badge.replay { color: #ffd27a; }
.mon-mode .badge.live { color: #6ff3e4; }
.player { position: absolute; z-index: 4; inset-inline: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(8, 18, 36, .86); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); direction: ltr; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.player button { flex: none; height: 32px; min-width: 32px; padding: 0 9px; border-radius: 8px; border: 0; background: rgba(255,255,255,.1); color: #fff; font: 600 12.5px var(--font-en); cursor: pointer; display: inline-grid; place-items: center; }
.player button:hover { background: rgba(255,255,255,.18); }
.player button svg { width: 16px; height: 16px; fill: currentColor; }
.player .live-btn { gap: 6px; display: inline-flex; align-items: center; background: rgba(25, 211, 193, .16); color: #6ff3e4; }
.player .live-btn.is-on { background: #19d3c1; color: #04201d; }
.player .t-label { flex: none; font: 500 13px var(--font); font-variant-numeric: tabular-nums; min-width: 132px; text-align: center; color: #dce8f3; unicode-bidi: isolate; white-space: nowrap; }
.timeline { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; }
.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.timeline .head { position: absolute; top: 2px; bottom: 2px; width: 2px; background: #19d3c1; box-shadow: 0 0 0 3px rgba(25,211,193,.25); border-radius: 2px; transform: translateX(-1px); }
.map-tip { position: absolute; z-index: 6; width: 270px; padding: 12px 14px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-up); font-size: 13px; }
.map-tip .tip-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; padding-inline-end: 18px; }
.map-tip .tip-name img { width: 20px; height: 15px; border-radius: 2px; }
.map-tip dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.map-tip dt { color: var(--muted); }
.map-tip dd { margin: 0; }
.map-tip .tip-x { position: absolute; inset-inline-end: 8px; top: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.map-tip .tip-link { display: inline-block; margin-top: 8px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }

/* ── tables ──────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font-weight: 500; font-size: 12.5px; color: var(--muted); text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: end; white-space: nowrap; }
.tbl .c { text-align: center; }
.vname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vname img.flag { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); flex: none; }
.vname .flag-ph { width: 22px; height: 16px; border-radius: 2px; background: var(--line); flex: none; }
.vname b { font-weight: 600; display: block; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.vname a:hover { text-decoration: none; }
.vname a:hover b { text-decoration: underline; }
.vname small { display: block; font-size: 12px; color: var(--muted); }
.vname .anon b { color: var(--text-2); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st[data-s="ANCHORED"] { color: #2f5fb3; background: #e8effb; }
.st[data-s="BERTHED"] { color: var(--ok); background: var(--ok-soft); }
.st[data-s="ARRIVING"], .st[data-s="UNDERWAY_INSIDE_PORT"] { color: var(--accent); background: var(--accent-soft); }
.st[data-s="DEPARTING"] { color: var(--warn); background: var(--warn-soft); }
:root[data-theme="dark"] .st[data-s="ANCHORED"] { color: #8fb8ff; background: rgba(110,160,255,.13); }
.src { font-size: 10.5px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); font-family: var(--font-en); }
.bound { color: var(--dim); font-family: var(--mono); }
.ct-ic { width: 20px; height: 20px; display: inline-grid; place-items: center; }
.ct-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.is-call { color: var(--link); } .is-transit { color: var(--dim); }
.login-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 18px; background: var(--link-soft); color: var(--text-2); font-size: 13px; }

/* ── KPI blocks ──────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card-2); }
.tile { padding: 10px 14px; border-inline-start: 1px solid var(--line); }
.tile:first-child { border-inline-start: 0; }
.tile small { display: block; font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.tile b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--muted); }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
.kv li > span:first-child { color: var(--muted); }
.kv li > span:last-child { font-weight: 600; text-align: end; }
.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 12px 0 10px; }
.stack i { display: block; height: 100%; transition: width .6s ease; }
.stack-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13px; }
.stack-legend span { display: flex; align-items: center; gap: 7px; }
.stack-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.stack-legend b { margin-inline-start: auto; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi small { display: block; font-size: 12px; color: var(--muted); }
.kpi b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 11.5px; color: var(--dim); }

/* ── events feed ─────────────────────────────────────── */
.feed { list-style: none; margin: 0; padding: 4px 0; max-height: 340px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 18px; font-size: 13px; animation: slidein .35s ease both; }
.feed li + li { border-top: 1px solid var(--line-2); }
.feed .ev-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.feed .ev-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feed .ev-in { color: var(--ok); background: var(--ok-soft); }
.feed .ev-out { color: var(--warn); background: var(--warn-soft); }
.feed .ev-anchor { color: #2f5fb3; background: #e8effb; }
.feed .ev-berth { color: var(--accent); background: var(--accent-soft); }
.feed b { font-weight: 600; }
.feed small { color: var(--muted); display: block; }
.feed time { color: var(--dim); font-size: 12px; white-space: nowrap; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }

/* ── photo ───────────────────────────────────────────── */
.photo { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(160deg, #d6e6f0, #8fbfcf); margin: 0; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 22px 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: 12px; }
.photo-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.photo-ph svg { width: 72px; height: 72px; opacity: .9; }

/* ── filters ─────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.filters label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.filters select, .filters input[type="date"], .filters input[type="search"] { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; }
.filters input[type="search"] { min-width: 240px; flex: 1; }
.filters .grow { margin-inline-start: auto; font-size: 12.5px; color: var(--dim); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.seg button.is-on { background: var(--card); color: var(--link); font-weight: 600; box-shadow: var(--shadow); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; align-items: center; }
.pager button { height: 30px; min-width: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ── charts ──────────────────────────────────────────── */
.chart { position: relative; height: 230px; padding: 10px 14px 6px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 32%) minmax(0, 1fr) 76px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { display: block; height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--c-bar); transition: width .7s ease; }
.bar-row b { font-weight: 600; text-align: end; font-variant-numeric: tabular-nums; }
.bar-row b small { color: var(--muted); font-weight: 400; margin-inline-start: 6px; }

/* ── information + equipment ─────────────────────────── */
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: minmax(120px, 36%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 8px; color: var(--text-2); line-height: 1.9; }
.equip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.equip li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.equip img, .equip .eq-ph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--accent-soft); }
.equip strong { display: block; } .equip p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.device { margin-top: 14px; }
.device details summary { cursor: pointer; color: var(--link); font-size: 13px; }
.device .pt-mod { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.device .pt-mod-head { display: none; }

/* ── areas ───────────────────────────────────────────── */
.areas { list-style: none; margin: 0; padding: 0; }
.areas li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.areas li:last-child { border-bottom: 0; }
.areas i { width: 10px; height: 10px; border-radius: 3px; }
.areas b { font-weight: 600; }
.areas small { color: var(--muted); display: block; font-size: 12px; }
.areas .num { color: var(--muted); }

/* ── ports index ─────────────────────────────────────── */
.pi-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 6px; }
.pi-head h1 { font-size: 28px; }
.pi-head .count { color: var(--muted); font-size: 15px; }
.pi-intro { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }
.pi-thumb { width: 64px; height: 42px; border-radius: 6px; object-fit: cover; background: linear-gradient(160deg, #d9e8f1, #9cc4d4); display: block; }
.pi-anchor { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; background: #1f6fb2; color: #fff; box-shadow: 0 2px 6px rgba(31,111,178,.35); }
.pi-anchor:hover { text-decoration: none; filter: brightness(1.1); }
.pi-anchor svg { width: 17px; height: 17px; }
.inside-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.inside-n.zero { color: var(--dim); font-weight: 400; }

.pg-foot { max-width: 1280px; margin: 0 auto; padding: 18px 20px 34px; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.pg-foot a { color: var(--muted); }
.pg-foot .grow { margin-inline-start: auto; }

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pg-top-in { gap: 10px; padding: 0 12px; }
  .pg-brand span, .pg-nav { display: none; }
  main.pg-main { padding: 12px 12px 36px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .pg-head { gap: 12px; }
  .pg-actions { width: 100%; }
  .pg-actions .btn-primary { flex: 1; justify-content: center; }
  .pg-tabs { top: 58px; }
  .monitor { height: 380px; }
  .player { inset-inline: 8px; bottom: 8px; gap: 6px; padding: 6px; }
  .player .t-label { min-width: 0; font-size: 11px; }
  .player .spd { display: none; }
  .mon-chips { max-width: calc(100% - 24px); }
  .tbl th, .tbl td { padding: 8px 9px; }
  .vname b { max-width: 150px; }
  .tile b { font-size: 21px; }
  .card-h, .card-b, .card-f, .filters, .pager { padding-inline: 13px; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
  .hide-sm { display: none; }
}
@media print {
  .pg-top, .pg-tabs, .player, .monitor { display: none !important; }
  .pg-panel[hidden] { display: block !important; }
}
