/* ===========================================================================
   AVARN OMC — CCTV Environment Documentation
   Professional static documentation theme.
   =========================================================================== */

:root {
  /* ---- AVARN dark palette: charcoal · teal ---- */
  --bg:            #15171a;
  --bg-side:       #1b1e1f;       /* sidebar — darkest layer */
  --bg-side-2:     #2a2e2f;
  --panel:        #262b2c;        /* cards — lifted above the page */
  --content-bg:   #1d2021;        /* page background */
  --ink:          #e8eeed;
  --ink-soft:     #a6b1af;
  --ink-faint:    #7c8886;
  --line:         #333a3b;
  --line-strong:  #444b4c;
  --brand:        #2bb3b6;        /* AVARN teal */
  --brand-dark:   #157a7d;
  --accent:       #4ccfd2;        /* teal, brightened for readable links on dark */
  --accent-soft:  #173a3c;
  --ok:           #4ccfd2;        /* on-brand teal stands in for "success" */
  --ok-soft:      #173a3c;
  --warn:         #5bd0d2;
  --warn-soft:    #173a36;
  --danger:       #e8eeed;        /* light text carries "serious" on dark */
  --danger-soft:  #33292a;
  --side-ink:     #c9d2d1;
  --side-ink-dim: #828d8b;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 2px rgba(0,0,0,.30), 0 8px 24px rgba(0,0,0,.35);
  --mono:         "SFMono-Regular", ui-monospace, "Cascadia Code", "Consolas", monospace;
  --sans:         "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--content-bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 312px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-side);
  color: var(--side-ink);
  border-right: 1px solid #000;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: center;
}
.brand .brand-logo {
  display: block; width: 100%; max-width: 150px; margin: 2px auto 12px;
}
.brand .logo {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; letter-spacing: .4px; color: #fff; font-size: 14px;
  text-transform: uppercase;
}
.brand .logo .mark {
  color: var(--brand); font-weight: 900; letter-spacing: .5px;
}
.brand .sub { color: var(--side-ink-dim); font-size: 12px; margin-top: 5px; }

.search-wrap { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.search-wrap input {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: var(--bg-side-2);
  color: #fff; font-size: 13.5px; outline: none;
}
.search-wrap input::placeholder { color: var(--side-ink-dim); }
.search-wrap input:focus { border-color: var(--accent); }

.nav { overflow-y: auto; padding: 10px 10px 40px; flex: 1; }
.nav::-webkit-scrollbar { width: 9px; }
.nav::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 8px; }

.nav-group { margin: 10px 6px 4px; }
.nav-group > .grp-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--side-ink-dim);
  padding: 10px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--side-ink); font-size: 14px; line-height: 1.3;
  border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(92,196,198,.20), rgba(92,196,198,.04));
  color: #fff; border-color: rgba(92,196,198,.40);
}
.nav-item .ic { width: 18px; text-align: center; flex: none; }
.nav-item.hide { display: none; }
.nav-group.hide { display: none; }

.side-foot {
  padding: 12px 18px; font-size: 11.5px; color: var(--side-ink-dim);
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ---------- Content ---------- */
.content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(244,246,249,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 38px; display: flex; align-items: center; gap: 14px;
  font-size: 13px; color: var(--ink-soft);
}
.crumb { color: var(--ink-faint); }
.crumb b { color: var(--ink); }
.topbar .spacer { flex: 1; }
.pill {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #b9e0e1;
}

.page { max-width: 980px; margin: 0 auto; padding: 34px 38px 90px; }

.page h1 {
  font-size: 30px; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -.4px;
}
.page-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 6px; }
.page-head h1 { margin: 0; }
.page-logo {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px;
  object-fit: contain; background: #fff; padding: 6px;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.page-ico {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
@media (max-width: 880px) { .page-logo, .page-ico { width: 44px; height: 44px; } }
.page .lead { color: var(--ink-soft); font-size: 16px; margin: 0 0 26px; max-width: 70ch; }
.page h2 {
  font-size: 20px; margin: 38px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); letter-spacing: -.2px;
}
.page h3 { font-size: 16px; margin: 24px 0 10px; }
.page p { margin: 0 0 14px; }
.page ul, .page ol { margin: 0 0 14px; padding-left: 22px; }
.page li { margin: 4px 0; }
.muted { color: var(--ink-soft); }

/* ---------- Cards / blocks ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin: 0 0 16px;
}

/* server card */
.srv {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin: 0 0 14px; overflow: hidden;
}
.srv.local   { border-left-color: #6b7574; }
.srv.ai      { border-left-color: var(--brand-dark); }
.srv.nas     { border-left-color: var(--brand); }
.srv.mgmt    { border-left-color: var(--brand); }
.srv-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.srv-host { font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.srv-ip {
  font-family: var(--mono); font-size: 13.5px; cursor: pointer;
  background: #f1f4f9; border: 1px solid var(--line-strong);
  padding: 3px 9px; border-radius: 7px; color: var(--ink);
}
.srv-ip:hover { background: var(--accent-soft); border-color: #9ad6d7; }
.srv-ip::after { content: " ⧉"; color: var(--ink-faint); font-size: 11px; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge.role { background: var(--accent-soft); color: var(--accent); }
.badge.exposed { background: var(--danger-soft); color: var(--danger); }
.badge.internal { background: #eef1f5; color: var(--ink-soft); }
.badge.managed { background: var(--ok-soft); color: var(--ok); }
.srv-body { padding: 14px 18px; }
.srv-body .row { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.srv-body .row .k { width: 150px; flex: none; color: var(--ink-soft); font-weight: 600; }
.srv-body .row .v { color: var(--ink); }

/* credentials block */
.creds {
  margin-top: 12px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: #fbfcfe;
}
.creds summary {
  cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 13.5px;
  color: var(--ink-soft); list-style: none; display: flex; align-items: center; gap: 8px;
}
.creds summary::-webkit-details-marker { display: none; }
.creds summary .lock { color: var(--warn); }
.creds[open] summary { border-bottom: 1px dashed var(--line-strong); }
.creds table { width: 100%; border-collapse: collapse; }
.creds td { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.creds td.k { width: 190px; color: var(--ink-soft); font-weight: 600; }
.creds td.v { font-family: var(--mono); }
.fill { color: var(--warn); font-style: italic; font-family: var(--sans); }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; margin: 0 0 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); background: #f7f9fc; padding: 11px 14px; border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl code { font-family: var(--mono); font-size: 13px; background: #f1f4f9; padding: 1px 6px; border-radius: 5px; }

/* callouts */
.callout { border-radius: var(--radius); padding: 14px 18px 14px 16px; margin: 0 0 16px;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--accent-soft); }
.callout .ct { font-weight: 700; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.callout p:last-child { margin-bottom: 0; }
.callout.info    { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.warn    { border-left-color: var(--warn);   background: var(--warn-soft); }
.callout.danger  { border-left-color: var(--danger); background: var(--danger-soft); }
.callout.success { border-left-color: var(--ok);     background: var(--ok-soft); }

/* code */
pre.code {
  background: #23282a; color: #e3edec; border-radius: var(--radius);
  padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
  line-height: 1.55; margin: 0 0 16px; border: 1px solid #383c3e;
}
pre.code .cmt { color: #8a9694; }
code.inline { font-family: var(--mono); font-size: .9em; background: #eef1f5; padding: 1px 6px; border-radius: 5px; }

/* link list */
.links { display: grid; gap: 10px; margin: 0 0 16px; }
.linkrow {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.linkrow .ic { font-size: 18px; }
.linkrow .t { font-weight: 600; }
.linkrow .d { color: var(--ink-soft); font-size: 13px; }

/* cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin: 0 0 16px; }
.minicard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); }
.minicard .h { font-weight: 700; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.minicard .h .card-logo {
  width: 24px; height: 24px; flex: none; border-radius: 5px;
  object-fit: contain; background: #fff; padding: 2px; border: 1px solid var(--line);
}
.minicard .b { color: var(--ink-soft); font-size: 13.5px; }
.minicard .big { font-size: 26px; font-weight: 800; color: var(--brand); letter-spacing: -.5px; }

/* KPI stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px;
}
.stat-n { font-size: 40px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; color: var(--brand-dark); }
.stat-l { font-weight: 700; font-size: 13.5px; margin-top: 10px; }
.stat-s { color: var(--ink-soft); font-size: 12px; margin-top: 3px; }

/* hierarchy tree — dark, structure-first */
.tree {
  background: linear-gradient(180deg, #25282c, #1e2123); border: 1px solid #34383c;
  border-radius: var(--radius); padding: 18px 20px; margin: 0 0 22px;
  box-shadow: 0 10px 34px rgba(0,0,0,.20);
}
.tree-root {
  display: inline-block; font-family: var(--mono); font-weight: 800; font-size: 13px; color: #fff;
  background: var(--brand-dark); padding: 6px 14px; border-radius: 8px; margin-bottom: 14px;
}
.tree-branches { display: grid; gap: 10px; }
.tree-group { background: rgba(255,255,255,.03); border: 1px solid #34383c; border-radius: 10px; padding: 11px 13px; }
.tree-ghead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tree-logo { width: 22px; height: 22px; border-radius: 5px; background: #fff; padding: 2px; object-fit: contain; flex: none; }
.tree-ic { font-size: 16px; }
.tree-gname { font-weight: 700; color: #eef2f1; font-size: 13.5px; }
.tree-count {
  margin-left: auto; background: var(--brand); color: #08312f; font-weight: 800; font-size: 12px;
  padding: 2px 11px; border-radius: 999px; min-width: 26px; text-align: center;
}
.tree-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tree-node {
  background: #2b2f33; border: 1px solid #3a3f43; border-left: 3px solid var(--brand);
  border-radius: 9px; padding: 9px 12px;
}
.tn-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tree-host { font-family: var(--mono); font-weight: 700; color: #fff; font-size: 12.5px; }
.tree-node .srv-ip { font-size: 12.5px; }
.tree-role { color: #8a9694; font-size: 11px; margin-top: 6px; }

/* topology diagram — dark AVARN style, grouped into platform lanes */
.topo {
  background: linear-gradient(180deg, #25282c, #1e2123);
  border: 1px solid #34383c; border-radius: var(--radius);
  padding: 20px; margin: 0 0 16px;
  box-shadow: 0 10px 34px rgba(0,0,0,.20);
}
.topo .tier {
  margin: 0 0 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid #34383c; border-radius: 12px;
  padding: 14px 16px 16px;
}
.topo .tier:last-child { margin-bottom: 0; }
.topo .tier-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand); margin-bottom: 12px;
}
.topo .tier-label .tl-logo {
  width: 22px; height: 22px; border-radius: 5px; background: #fff;
  padding: 2px; object-fit: contain; flex: none;
}
.topo .tier-label .tl-ic { font-size: 15px; }
.topo .nodes { display: flex; gap: 12px; flex-wrap: wrap; }
.node {
  border: 1px solid #3a3f43; border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 10px 14px; min-width: 162px;
  background: #2b2f33; color: #eef2f1;
}
.node .nm { font-family: var(--mono); font-weight: 700; font-size: 13.5px; color: #fff; }
.node .ip { font-family: var(--mono); font-size: 12px; color: #9fb0ad; }
.node .rl { font-size: 11.5px; color: #8a9694; margin-top: 2px; }
.node.b-red { border-left-color: var(--brand); }
.node.b-green { border-left-color: #2bb3b6; }
.node.b-purple { border-left-color: var(--brand-dark); }
.node.b-cyan { border-left-color: #2bb3b6; }
.node.b-gray { border-left-color: #6b7574; }
.node.fw { background: #15171a; border-color: #34383c; border-left-color: var(--brand); }
.node.fw .nm { color: #fff; }
.node.off { border-style: dashed; background: #24272b; }
.flowdown { text-align: center; color: var(--brand); font-size: 18px; margin: 2px 0 12px; }

/* platform group header (used in IP index, grouped by VMS platform) */
.plat-head { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; }
.plat-head:first-child { margin-top: 6px; }
.plat-head .plat-logo {
  width: 36px; height: 36px; border-radius: 8px; background: #fff; padding: 4px;
  object-fit: contain; border: 1px solid var(--line); box-shadow: var(--shadow); flex: none;
}
.plat-head .plat-ic {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.plat-head .plat-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.plat-head .plat-sub { font-size: 12.5px; color: var(--ink-soft); }

.tag { display:inline-block; font-family: var(--mono); font-size: 12px; background:#f1f4f9;
  border:1px solid var(--line-strong); padding: 2px 7px; border-radius: 6px; margin: 2px 4px 2px 0; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.no-results { text-align:center; color: var(--side-ink-dim); padding: 24px 10px; font-size: 13px; display:none; }
.no-results.show { display: block; }

/* ===========================================================================
   Overview landing page — hero, platform tiles, jump cards, scroll reveal
   =========================================================================== */

/* scroll reveal (applied to every #page child) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 18px; margin: 0 0 26px;
  background: linear-gradient(135deg, #1b1d1e 0%, #243a3b 55%, #157a7d 130%);
  border: 1px solid #34383c;
  box-shadow: 0 18px 50px rgba(8,24,24,.28);
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 90% at 82% 10%, rgba(43,179,182,.42), transparent 60%),
    radial-gradient(50% 80% at 12% 95%, rgba(43,179,182,.22), transparent 60%);
  animation: heroGlow 9s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  from { transform: translate3d(0,0,0) scale(1); opacity: .85; }
  to   { transform: translate3d(0,-12px,0) scale(1.06); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero-bg { animation: none; } }
.hero-inner { position: relative; padding: 46px 44px 40px; }
.hero-logo {
  width: 78px; height: 78px; margin-bottom: 18px;
  border-radius: 16px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 22px rgba(0,0,0,.30);
}
.hero-kicker {
  text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; font-weight: 700;
  color: #7fe3e4; margin-bottom: 12px;
}
.hero-title {
  font-size: 46px; line-height: 1.05; font-weight: 800; letter-spacing: -1.2px;
  color: #fff; margin: 0 0 14px;
}
.hero-sub { color: #d4e6e6; font-size: 16.5px; line-height: 1.55; max-width: 60ch; margin: 0 0 22px; }
.hero-meta {
  display: inline-block; font-family: var(--mono); font-size: 12.5px; color: #bfe0e0;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  padding: 6px 14px; border-radius: 999px;
}
@media (max-width: 880px) {
  .hero-inner { padding: 34px 24px 30px; }
  .hero-title { font-size: 34px; }
}

/* platform tiles */
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0 0 22px; }
.plat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.plat-tile:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: #9ad6d7; box-shadow: 0 10px 26px rgba(20,134,138,.18);
}
.plat-tile-logo {
  width: 40px; height: 40px; border-radius: 9px; object-fit: contain;
  background: #fff; padding: 5px; border: 1px solid var(--line); margin-bottom: 8px;
}
.plat-tile-ic {
  width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--accent-soft); border: 1px solid var(--line); margin-bottom: 8px;
}
.plat-tile-name { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; }
.plat-tile-sub { color: var(--ink-soft); font-size: 12.5px; }

/* AI site cards */
.sitecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 0 0 22px; }
.sitecard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.sc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sc-logo {
  width: 46px; height: 46px; flex: none; border-radius: 10px; object-fit: contain;
  background: #fff; padding: 5px; border: 1px solid var(--line);
}
.sc-logo-ic { display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--accent-soft); }
.sc-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sc-name { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.sc-badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line-strong);
}
.sc-badge.central { background: rgba(43,179,182,.16); color: var(--brand); border-color: rgba(43,179,182,.4); }
.sc-rows { display: grid; gap: 0; }
.sc-row { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.sc-row:first-child { border-top: none; }
.sc-row .k { width: 78px; flex: none; color: var(--ink-soft); font-weight: 600; }
.sc-row .v { color: var(--ink); min-width: 0; }
.sitecard .creds { margin-top: 12px; }

/* jump cards */
.jumpgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 22px; }
.jumpcard {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.jumpcard:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: #9ad6d7; box-shadow: 0 10px 26px rgba(20,134,138,.15);
}
.jumpcard .jc-ic {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.jumpcard .jc-body { display: flex; flex-direction: column; min-width: 0; }
.jumpcard .jc-h { font-weight: 700; font-size: 14.5px; }
.jumpcard .jc-d { color: var(--ink-soft); font-size: 12.5px; }
.jumpcard .jc-arrow { margin-left: auto; color: var(--brand); font-weight: 800; font-size: 18px; transition: transform .18s ease; }
.jumpcard:hover .jc-arrow { transform: translateX(4px); }

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .page, .topbar { padding-left: 18px; padding-right: 18px; }
}

/* ===========================================================================
   Dark-theme patches for the few hardcoded light surfaces
   =========================================================================== */
.topbar { background: rgba(21,23,26,.82); }

.srv-ip { background: #2f3537; border-color: var(--line-strong); color: var(--ink); }
.srv-ip:hover { background: var(--accent-soft); border-color: var(--brand); }

table.tbl th { background: #21282a; color: var(--ink-soft); }
table.tbl code { background: #2f3537; color: var(--ink); }

.creds { background: #20292b; }
.creds summary { color: var(--ink-soft); }

code.inline { background: #2f3537; color: var(--ink); }

.badge.internal { background: #2f3537; color: var(--ink-soft); }
.badge.exposed  { background: var(--danger-soft); color: #f3c9c0; }

.tag { background: #2f3537; border-color: var(--line-strong); color: var(--ink); }

.stat-n { color: var(--brand); }

.pill { border-color: rgba(43,179,182,.35); }

.plat-tile:hover { border-color: var(--brand); box-shadow: 0 10px 26px rgba(43,179,182,.20); }
.jumpcard:hover  { border-color: var(--brand); box-shadow: 0 10px 26px rgba(43,179,182,.16); }

/* =========================================================================
   Clickable stats → detail panels
   ========================================================================= */
.stat.clickable { cursor: pointer; position: relative; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.stat.clickable:hover, .stat.clickable:focus-visible { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 0 1px var(--brand) inset; outline: none; }
.stat.clickable::after { content: "↗"; position: absolute; top: 12px; right: 14px; color: var(--ink-faint); font-size: 14px; transition: color .18s; }
.stat.clickable:hover::after { color: var(--brand); }
.stat-cta { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--accent); opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; }
.stat.clickable:hover .stat-cta, .stat.clickable:focus-visible .stat-cta { opacity: 1; transform: none; }

body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,11,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 32px 20px; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card { width: min(1180px, 100%); max-height: calc(100vh - 64px); overflow: auto; background: var(--content-bg); border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(18px) scale(.985); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.modal.open .modal-card { transform: none; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 16px; align-items: flex-start; padding: 22px 26px 16px; background: linear-gradient(var(--content-bg) 80%, rgba(29,32,33,0)); border-bottom: 1px solid var(--line); }
.modal-head h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.modal-head .lead { margin: 6px 0 0; font-size: 14px; max-width: 70ch; }
.modal-head .page-ico { font-size: 30px; line-height: 1; margin-top: 2px; }
.modal-close { margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--accent-soft); border-color: var(--brand); color: var(--accent); }
.modal-body { padding: 18px 26px 30px; }
.modal-body > * + * { margin-top: 18px; }
.modal-body .tbl { width: 100%; }
.modal-body .minicard .b { line-height: 1.7; }
.modal-body .minicard .b a { color: var(--accent); }
.mono { font-family: var(--mono); }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.st.on { background: var(--ok-soft); color: var(--ok); }
.st.idle { background: #3a3530; color: #e0b76f; }

.tree-open { margin-left: auto; font-size: 11.5px; color: var(--accent); text-decoration: none; font-weight: 600; }
.tree-open:hover { text-decoration: underline; }
.tree-note { color: var(--ink-soft); font-size: 12px; margin: -4px 0 10px; }

/* ---- SVG network map ---- */
.netmap-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 10px; overflow-x: auto; }
.netmap { display: block; width: 100%; height: auto; margin: 0 auto; font-family: var(--sans); }
.nm-cloud rect { fill: #232829; stroke: var(--line-strong); stroke-width: 1.2; }
.nm-cloud.exposed rect { fill: #33292a; stroke: #c98a7b; stroke-dasharray: 5 4; }
.nm-ct { fill: var(--ink); font-size: 13px; font-weight: 700; }
.nm-cs { fill: var(--ink-soft); font-size: 10.5px; font-family: var(--mono); }
.nm-link { fill: none; stroke: var(--ink-faint); stroke-width: 1.6; color: var(--ink-faint); stroke-dasharray: 6 5; animation: nmflow 1.4s linear infinite; }
.nm-link.exposed { stroke: #e0917d; color: #e0917d; }
.nm-link.store { stroke: var(--brand); color: var(--brand); }
@keyframes nmflow { to { stroke-dashoffset: -22; } }
.nm-bus line { stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.nm-bus rect { fill: var(--brand-dark); }
.nm-bt { fill: #fff; font-size: 12px; font-weight: 700; font-family: var(--mono); }
.nm-drop { stroke: var(--brand); stroke-width: 1.6; opacity: .7; }
.nm-group rect { fill: rgba(255,255,255,.03); stroke: var(--line-strong); stroke-width: 1; }
.nm-group.g-ms rect { stroke: #b08bd9; } .nm-group.g-wn rect { stroke: #e6a23c; }
.nm-group.g-gt rect { stroke: #5fa8ff; } .nm-group.g-nas rect { stroke: var(--brand); } .nm-group.g-ai rect { stroke: #ff7eb6; }
.nm-gt { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.nm-gc { fill: var(--ink-faint); font-size: 12px; font-weight: 700; font-family: var(--mono); }
.nm-node { cursor: pointer; }
.nm-node rect { fill: #2b3132; stroke: var(--line-strong); stroke-width: 1; transition: fill .15s, stroke .15s; }
.nm-node:hover rect { fill: var(--accent-soft); stroke: var(--brand); }
.nm-node .nm-dot { fill: var(--ok); }
.nm-node.idle .nm-dot { fill: #e0b76f; }
.nm-node.idle rect { stroke-dasharray: 4 3; opacity: .85; }
.nm-node.exposed .nm-dot { fill: #e0917d; }
.nm-node.exposed rect { stroke: #c98a7b; }
.nm-host { fill: #fff; font-size: 12.5px; font-weight: 700; font-family: var(--mono); }
.nm-ip { fill: var(--ink-soft); font-size: 11.5px; font-family: var(--mono); }
.nm-tag { fill: #e0b76f; font-size: 9.5px; font-weight: 800; letter-spacing: .6px; }
.nm-tag.exp { fill: #e0917d; font-family: var(--mono); }
.netmap-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 4px 0; font-size: 11.5px; color: var(--ink-soft); }
.netmap-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.netmap-legend .dot.on { background: var(--ok); } .netmap-legend .dot.idle { background: #e0b76f; } .netmap-legend .dot.exp { background: #e0917d; }

@media (max-width: 720px) {
  .modal { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-head .lead { display: none; }
}
@media (prefers-reduced-motion: reduce) { .nm-link { animation: none; } }
.nm-ll { fill: var(--brand); font-size: 9.5px; font-weight: 700; letter-spacing: .4px; }

/* =========================================================================
   Hero background image layer (generated art) + AI theme
   ========================================================================= */
.hero-img {
  position: absolute; inset: 0; pointer-events: none;
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.75) 35%, #000 60%);
          mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.75) 35%, #000 60%);
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}
@keyframes heroDrift { to { transform: scale(1.08) translateX(-1.5%); } }
.hero .hero-img + .hero-bg {
  background:
    linear-gradient(90deg, rgba(21,23,26,.96) 0%, rgba(21,23,26,.82) 38%, rgba(21,23,26,.25) 70%, rgba(21,23,26,.05) 100%),
    linear-gradient(0deg, rgba(21,23,26,.75) 0%, transparent 40%);
  animation: none;
}
.hero-inner { min-height: 300px; }

/* AI hero — detection-overlay aesthetic */
.hero-ai { border-color: rgba(43,179,182,.35); box-shadow: 0 0 0 1px rgba(43,179,182,.12), 0 24px 70px rgba(8,40,40,.45), inset 0 0 120px rgba(43,179,182,.06); }
.hero-ai .hero-inner { padding-top: 54px; padding-bottom: 48px; }
.hero-ai .hero-kicker { color: #7fe3e4; display: inline-flex; align-items: center; gap: 8px; }
.hero-ai .hero-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ccfd2; box-shadow: 0 0 0 3px rgba(76,207,210,.2), 0 0 14px #4ccfd2; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hero-ai .hero-title { font-size: 50px; background: linear-gradient(90deg, #fff 0%, #bff3f4 60%, #4ccfd2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-ai .hero-meta { background: rgba(43,179,182,.12); border-color: rgba(76,207,210,.35); color: #cdf2f2; }
.hb { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(76,207,210,.8); pointer-events: none; filter: drop-shadow(0 0 6px rgba(76,207,210,.6)); }
.hb.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.hb.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 4px; }
.hb.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 4px; }
.hb.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }
.hero-scan {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
}
.hero-scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; top: -2px;
  background: linear-gradient(90deg, transparent, rgba(76,207,210,.9), transparent);
  box-shadow: 0 0 18px rgba(76,207,210,.8);
  animation: scan 5.5s linear infinite;
}
@keyframes scan { to { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .hero-img, .hero-scan::after, .hero-ai .hero-kicker::before { animation: none; } }

/* AI page backdrop: faint grid + glow */
.page.theme-ai {
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(43,179,182,.10), transparent 70%),
    linear-gradient(rgba(43,179,182,.045) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(43,179,182,.045) 1px, transparent 1px) 0 0 / 40px 40px;
  -webkit-mask-image: linear-gradient(#000 70%, rgba(0,0,0,.6));
          mask-image: linear-gradient(#000 70%, rgba(0,0,0,.6));
}
.theme-ai .stat { background: linear-gradient(180deg, rgba(43,179,182,.08), rgba(38,43,44,0)) , var(--panel); border-color: rgba(43,179,182,.22); }
.theme-ai .stat-n { text-shadow: 0 0 22px rgba(76,207,210,.45); }
.theme-ai h2 { display: flex; align-items: center; gap: 12px; }
.theme-ai h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(76,207,210,.5), transparent); }

/* ---- detection pipeline ---- */
.pipe { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 6px 2px 14px; margin: 0 0 18px; }
.pipe-node {
  flex: 1 0 150px; min-width: 150px; position: relative;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.pipe-node:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 26px rgba(0,0,0,.4), 0 0 0 1px rgba(43,179,182,.3) inset; }
.pipe-node.local  { border-color: rgba(76,207,210,.5); background: linear-gradient(180deg, rgba(43,179,182,.12), var(--panel)); }
.pipe-node.gemini { border-color: rgba(176,139,217,.6); background: linear-gradient(180deg, rgba(176,139,217,.14), var(--panel)); }
.pipe-node.omc    { border-color: rgba(224,183,111,.6); background: linear-gradient(180deg, rgba(224,183,111,.12), var(--panel)); }
.pipe-ic { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.pipe-h { font-weight: 800; font-size: 13.5px; letter-spacing: -.2px; }
.pipe-d { color: var(--ink-soft); font-size: 11.5px; line-height: 1.35; }
.pipe-arrow { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; position: relative; }
.pipe-arrow i {
  display: block; width: 100%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 11px);
  background-size: 22px 2px; animation: flow 1.1s linear infinite; position: relative;
}
.pipe-arrow i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--brand); }
@keyframes flow { to { background-position: 22px 0; } }
@media (prefers-reduced-motion: reduce) { .pipe-arrow i { animation: none; } }

/* ---- AI site cards ---- */
.sitecard.ai { position: relative; overflow: hidden; border-color: rgba(43,179,182,.25);
  background: linear-gradient(180deg, rgba(43,179,182,.06), transparent 45%), var(--panel);
  transition: transform .2s, box-shadow .2s, border-color .2s; }
.sitecard.ai:hover { transform: translateY(-3px); border-color: rgba(76,207,210,.7); box-shadow: 0 16px 40px rgba(0,0,0,.45), 0 0 30px rgba(43,179,182,.12); }
.sitecard.ai::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}
.sitecard.ai::after {
  content: ""; position: absolute; left: -20%; right: -20%; height: 40px; top: -50px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(76,207,210,.12), transparent);
  opacity: 0; transition: opacity .2s;
}
.sitecard.ai:hover::after { opacity: 1; animation: cardscan 1.6s linear infinite; }
@keyframes cardscan { to { top: 110%; } }
.cb { position: absolute; width: 12px; height: 12px; border: 1.5px solid rgba(76,207,210,.55); pointer-events: none; opacity: 0; transition: opacity .2s; }
.sitecard.ai:hover .cb { opacity: 1; }
.cb.tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; }
.cb.tr { top: 7px; right: 7px; border-left: 0; border-bottom: 0; }
.cb.bl { bottom: 7px; left: 7px; border-right: 0; border-top: 0; }
.cb.br { bottom: 7px; right: 7px; border-left: 0; border-top: 0; }
.sitecard.ai .sc-logo { box-shadow: 0 0 0 1px rgba(76,207,210,.35), 0 0 18px rgba(43,179,182,.25); }
.sitecard.ai .sc-row .k { width: 70px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); padding-top: 2px; }
.sc-engine {
  margin-left: auto; align-self: flex-start; flex: none;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  padding: 4px 9px; border-radius: 6px; border: 1px solid; white-space: nowrap;
}
.sc-engine.local  { color: #4ccfd2; border-color: rgba(76,207,210,.45); background: rgba(43,179,182,.12); }
.sc-engine.gemini { color: #c9aef0; border-color: rgba(176,139,217,.5); background: rgba(176,139,217,.14); }
.sc-engine.hybrid { color: #ffd39a; border-color: rgba(224,183,111,.5); background: rgba(224,183,111,.12); }
.sitecard.ai .sc-head { flex-wrap: wrap; row-gap: 8px; }
.sitecard.ai .sc-id { flex: 1 1 auto; }
.pipe-node { flex: 1 1 0; min-width: 112px; padding: 12px 11px 10px; }
.pipe-arrow { flex: 0 0 24px; }
.pipe-h { font-size: 12.5px; }
.pipe-d { font-size: 11px; }

/* ---- sign out (topbar) ---- */
.signout { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); font: 600 12px var(--sans); cursor: pointer; }
.signout:hover { border-color: var(--brand); color: var(--accent); background: var(--accent-soft); }
.signout .who { color: var(--ink-faint); font-weight: 500; }
.signout .who:not(:empty)::after { content: " ·"; }

/* =========================================================================
   WIDE LAYOUT — use the full viewport, denser spacing, 12-column block grid
   ========================================================================= */
.app { grid-template-columns: 256px 1fr; }
.sidebar .brand-logo { max-width: 110px; margin-bottom: 8px; }
.sidebar .brand { padding-top: 14px; padding-bottom: 8px; }
.page { max-width: none; margin: 0; padding: 18px 26px 40px; }
.page, .page.theme-ai { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; align-content: start; }
.page > .blk { min-width: 0; }
.page > .blk > :first-child { margin-top: 0; }
.page > .blk > :last-child { margin-bottom: 0; }
.blk-head { margin-bottom: -2px; }
.page h1 { font-size: 26px; }
.page .lead { font-size: 14.5px; margin: 4px 0 0; max-width: 110ch; }
.page h2 { font-size: 17px; margin: 6px 0 0; padding-bottom: 6px; }
.page h3 { margin: 0 0 8px; }
.prose > h2:only-child { margin: 0; }
.theme-ai h2 { margin-top: 6px; }

/* heroes shorter */
.hero { margin: 0; }
.hero-inner { min-height: 0; padding: 28px 34px 26px; }
.hero-ai .hero-inner { padding-top: 30px; padding-bottom: 28px; }
.hero-logo { width: 56px; height: 56px; margin-bottom: 10px; }
.hero-title { font-size: 36px; margin-bottom: 8px; }
.hero-ai .hero-title { font-size: 40px; }
.hero-sub { font-size: 14.5px; margin-bottom: 14px; max-width: 80ch; }
.hero-kicker { margin-bottom: 8px; }

/* stats / tiles / cards denser */
.stats { margin: 0; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { padding: 12px 16px 12px; }
.stat-n { font-size: 34px; }
.stat-l { margin-top: 6px; }
.platforms { margin: 0; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.plat-tile { padding: 12px 12px 10px; }
.jumpgrid { margin: 0; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sitecards { margin: 0; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid { margin: 0; gap: 12px; }
.callout { margin: 0; padding: 12px 16px 12px 14px; }
.callout p { margin-bottom: 8px; }
.tbl { margin: 0; }
.links { margin: 0; }
.pipe { margin: 0; padding-bottom: 4px; }
.card { margin: 0; }
.pre, .code { margin: 0; }

/* servers: multi-column grid */
.srvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.srvgrid .srv { margin: 0; }
.srvgrid .srv:only-child { grid-column: 1 / -1; }
.srv-body { padding: 12px 16px; }
.srv-body .row { padding: 4px 0; font-size: 13.5px; }
.srv-body .row .k { width: 130px; }
.srv-head { flex-wrap: wrap; gap: 8px; }

/* pdf button */
.pdfbtn { margin-left: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(43,179,182,.45); background: rgba(43,179,182,.12); color: var(--accent); font: 700 12px var(--sans); cursor: pointer; text-decoration: none; }
.pdfbtn:hover { background: rgba(43,179,182,.22); border-color: var(--brand); }
.pdfbtn.busy { opacity: .6; cursor: progress; }
.pdfbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1100px) { .page > .blk { grid-column: span 12 !important; } }
@media (max-width: 880px) { .app { grid-template-columns: 1fr; } .page { padding: 14px 14px 30px; } }
.jumpgrid.col { grid-template-columns: 1fr; gap: 8px; }
.jumpgrid.col .jumpcard { padding: 10px 12px; }
.srvgrid { grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); }
.stat { min-height: 0; }

/* ---- download progress panel ---- */
.dl { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 340px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px 14px 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .25s, transform .25s; }
.dl.show { opacity: 1; transform: none; pointer-events: auto; }
.dl-ic { font-size: 22px; line-height: 1; margin-top: 2px; }
.dl-body { flex: 1; min-width: 0; }
.dl-t { font-weight: 700; font-size: 13.5px; }
.dl-s { color: var(--ink-soft); font-size: 12px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-bar { height: 6px; border-radius: 999px; background: #2f3537; overflow: hidden; margin-top: 8px; position: relative; }
.dl-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #7fe3e4); transition: width .2s ease; }
.dl-bar.indet i { width: 40% !important; position: absolute; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { left: -40%; } 100% { left: 100%; } }
.dl.done .dl-bar i { background: var(--ok); }
.dl.done .dl-t { color: var(--ok); }
.dl.error .dl-bar i { background: #e0917d; }
.dl.error .dl-t { color: #f3c9c0; }
.dl-x { background: transparent; border: 0; color: var(--ink-faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.dl-x:hover { color: var(--ink); }

/* =========================================================================
   MOBILE — off-canvas nav, safe areas, touch targets, scroll containers
   ========================================================================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
.menu-btn { display: none; }
.scrim { display: none; }
.tbl-wrap, .modal-body .tbl, .page .tbl { max-width: 100%; }
input, select, textarea, button { font-size: max(16px, 1em); }   /* prevents iOS zoom-on-focus */
.search-wrap input { font-size: 16px; }

@media (max-width: 880px) {
  /* layout */
  .app { grid-template-columns: 1fr; min-height: 100dvh; }
  .content { min-width: 0; }

  /* off-canvas sidebar */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); height: 100dvh; z-index: 60;
    transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 60px rgba(0,0,0,.6);
    padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8,10,11,.6); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .sidebar .brand { padding: 14px 16px 10px; }
  .sidebar .brand-logo { max-width: 84px; }
  .nav-item { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .side-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* hamburger */
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; margin: -8px 0 -8px -8px;
    padding: 0 10px; border: 0; background: transparent; cursor: pointer; border-radius: 10px; flex: none; }
  .menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s, opacity .2s; }
  .menu-btn:active { background: rgba(255,255,255,.06); }
  body.nav-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* topbar */
  .topbar { padding: 10px 12px 10px calc(12px + env(safe-area-inset-left)); padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; font-size: 12.5px; }
  .topbar .pill { display: none; }
  .topbar #crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumb { display: inline; }
  .pdfbtn { margin-left: 0; padding: 9px 11px; min-height: 40px; }
  .pdfbtn svg { width: 16px; height: 16px; }
  .pdfbtn .lbl, .pdfbtn-text { display: none; }
  .signout { margin-left: 0; min-height: 40px; padding: 8px 11px; }
  .signout .who { display: none; }

  /* page */
  .page { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); gap: 12px; }
  .page > .blk { grid-column: span 12 !important; }
  .page h1 { font-size: 22px; }
  .page .lead { font-size: 14px; }
  .page h2 { font-size: 16px; }
  .page-logo, .page-ico { width: 40px; height: 40px; }

  /* hero */
  .hero { border-radius: 14px; }
  .hero-inner, .hero-ai .hero-inner { padding: 20px 18px 18px; }
  .hero-title, .hero-ai .hero-title { font-size: 26px; letter-spacing: -.6px; }
  .hero-sub { font-size: 13.5px; }
  .hero-meta { font-size: 11px; white-space: normal; }
  .hero-img { -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.15), rgba(0,0,0,.6)); mask-image: linear-gradient(90deg, rgba(0,0,0,.15), rgba(0,0,0,.6)); }
  .hb { width: 16px; height: 16px; }

  /* grids */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 12px 10px; }
  .stat-n { font-size: 28px; }
  .stat.clickable::after { top: 8px; right: 10px; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .plat-tile { padding: 10px; }
  .sitecards, .jumpgrid, .grid, .srvgrid { grid-template-columns: 1fr; }
  .srv-body .row { flex-direction: column; gap: 2px; }
  .srv-body .row .k { width: auto; font-size: 12px; }
  .sc-row .k { width: 64px; }
  .sitecard.ai .sc-row .k { width: 62px; }

  /* tables & diagrams scroll inside themselves */
  .blk > .tbl, .modal-body .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .tbl td, .tbl th { padding: 8px 10px; }
  .netmap-wrap { padding: 10px; }
  .netmap { min-width: 640px; max-width: none !important; }
  .pipe { gap: 0; padding-bottom: 10px; }
  .pipe-node { flex: 0 0 132px; }
  .tree-nodes { grid-template-columns: 1fr; }
  .tree-ghead { flex-wrap: wrap; }
  .tree-open { margin-left: 0; flex-basis: 100%; }

  /* detail modal → full-screen sheet */
  .modal { padding: 0; align-items: stretch; }
  .modal-card { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border: 0; transform: translateY(24px); }
  .modal-head { padding: calc(14px + env(safe-area-inset-top)) 16px 12px; gap: 12px; }
  .modal-head h1 { font-size: 19px; }
  .modal-head .lead { display: none; }
  .modal-close { width: 44px; height: 44px; }
  .modal-body { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }

  /* copy chips & buttons large enough to tap */
  .srv-ip, .tag, .badge { padding-top: 4px; padding-bottom: 4px; }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .dl { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .platforms { grid-template-columns: 1fr 1fr; }
  .hero-logo { width: 44px; height: 44px; }
  .topbar #crumb .crumb { font-size: 12px; }
}

/* hide "Download PDF" label on narrow screens, keep the icon */
@media (max-width: 600px) { .pdfbtn { font-size: 0; gap: 0; } .pdfbtn svg { font-size: 12px; } }

/* hover-only effects shouldn't stick on touch devices */
@media (hover: none) {
  .stat.clickable:hover { transform: none; }
  .sitecard.ai:hover, .pipe-node:hover, .plat-tile:hover, .jumpcard:hover { transform: none; }
  .stat-cta { opacity: 1; transform: none; }
}
.signout { white-space: nowrap; }
@media (max-width: 880px) {
  .page > .blk { order: 10; }
  .page > .blk[data-mo="1"] { order: 1; } .page > .blk[data-mo="2"] { order: 2; }
  .page > .blk[data-mo="3"] { order: 3; } .page > .blk[data-mo="4"] { order: 4; }
  .page > .blk-head, .page > .blk:first-child { order: 0; }
  .page > .blk:nth-child(2):not([data-mo]) { order: 0; }   /* hero / stats stay on top */
  .page > .blk:nth-child(3):not([data-mo]) { order: 0; }
}
