@font-face { font-family: Lato; font-weight: 400; font-display: swap; src: url(assets/lato-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 700; font-display: swap; src: url(assets/lato-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 900; font-display: swap; src: url(assets/lato-latin-900-normal.woff2) format('woff2'); }

/* ABTECH brand: black #202020, green #7AA22F, grey #D9D9D9, Lato (same tokens as the RTK Support Locator) */
:root {
  --brand-black: #202020;
  --brand-green: #7aa22f;
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eceee8;
  --text: #202020;
  --muted: #5c5c5c;
  --border: #d9d9d9;
  --accent: #5f8222;
  --ok: #3f6e12;
  --ok-fill: #6f9f2a;
  --ok-soft: #e8f2d8;
  --warn: #8a5a00;
  --warn-fill: #e0a21a;
  --warn-soft: #fbf0d6;
  --bad: #b3261e;
  --bad-fill: #d23c32;
  --bad-soft: #fbe7e5;
  --none: #d9dbd4;
  --net-mern: #1d5fbf;
  --net-smartnet: #d0391f;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.04);
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Lato, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --surface: #202020; --surface-2: #2a2a2a; --text: #ececec; --muted: #a3a3a3;
    --border: #363636; --accent: #9cc456;
    --ok: #9cd45f; --ok-fill: #7aa22f; --ok-soft: #1f2e12;
    --warn: #f0b54a; --warn-fill: #d99a1a; --warn-soft: #362a12;
    --bad: #ff8a80; --bad-fill: #e0483e; --bad-soft: #3a1b19; --none: #3a3a3a;
    --net-mern: #6aa5ff; --net-smartnet: #ff7a5c;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #202020; --surface-2: #2a2a2a; --text: #ececec; --muted: #a3a3a3;
  --border: #363636; --accent: #9cc456;
  --ok: #9cd45f; --ok-fill: #7aa22f; --ok-soft: #1f2e12;
  --warn: #f0b54a; --warn-fill: #d99a1a; --warn-soft: #362a12;
  --bad: #ff8a80; --bad-fill: #e0483e; --bad-soft: #3a1b19; --none: #3a3a3a;
  --net-mern: #6aa5ff; --net-smartnet: #ff7a5c;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono, code { font-family: var(--mono); font-size: 13px; }
h2 { font-size: 17px; margin: 0; font-weight: 900; }
h3 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 56px; background: var(--brand-black); color: #fff; border-bottom: 3px solid var(--brand-green); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { height: 20px; width: auto; display: block; }
.divider { width: 1px; height: 22px; background: #555; }
.app-name { font-weight: 700; font-size: 15px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggles { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.seg { display: inline-flex; border: 1px solid #555; border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; color: #cfcfcf; border: 0; padding: 5px 10px; font: 700 13px var(--sans); cursor: pointer; }
.seg button.on { background: var(--brand-green); color: #fff; }
.icon-btn { background: transparent; border: 1px solid #555; color: #fff; border-radius: 6px; width: 34px; height: 30px; padding: 0; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 16px; min-width: 0; }

/* summary */
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--none); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); }
.summary.ok { border-left-color: var(--ok-fill); }
.summary.unstable { border-left-color: var(--warn-fill); }
.summary.down { border-left-color: var(--bad-fill); }
.summary .headline { font-size: 20px; font-weight: 900; line-height: 1.25; flex: 1 1 320px; }
.summary .headline .sub { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--surface-2); }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--none); flex: none; }
.dot.ok { background: var(--ok-fill); }
.dot.unstable { background: var(--warn-fill); }
.dot.down { background: var(--bad-fill); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.unstable { background: var(--warn-soft); color: var(--warn); }
.pill.down { background: var(--bad-soft); color: var(--bad); }
.pill.ok .dot { box-shadow: 0 0 0 0 var(--ok-fill); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(122,162,47,.55); } 70% { box-shadow: 0 0 0 6px rgba(122,162,47,0); } 100% { box-shadow: 0 0 0 0 rgba(122,162,47,0); } }
@media (prefers-reduced-motion: reduce) { .pill.ok .dot { animation: none; } }

/* network section */
.net-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.net-head h2 { display: flex; align-items: center; gap: 8px; }
.net-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--c, var(--accent)); }
.net-head .meta { color: var(--muted); font-size: 13px; }
.caster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; margin-bottom: 12px; }

/* station table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.row { cursor: pointer; }
.table tr.row:hover td { background: var(--surface-2); }
.table tr.row:focus-visible td { outline: 2px solid var(--accent); outline-offset: -2px; }
.table tr.row.open td { background: var(--surface-2); border-bottom-color: transparent; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp { display: block; font-size: 11px; color: var(--muted); }
.st-name { font-weight: 700; }
.st-code { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.sats { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.sats b { font-weight: 700; color: var(--muted); font-size: 11px; margin-right: 2px; }
.age-bad { color: var(--bad); font-weight: 700; }
.age-warn { color: var(--warn); font-weight: 700; }

/* availability bars */
.bars { display: flex; gap: 1px; height: 22px; align-items: stretch; min-width: 150px; }
.bars i { flex: 1; border-radius: 1px; background: var(--none); }
.bars i.g { background: var(--ok-fill); }
.bars i.w { background: var(--warn-fill); }
.bars i.b { background: var(--bad-fill); }
.bars.big { height: 34px; min-width: 0; gap: 2px; }
.bar-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; }

/* detail */
.detail td { padding: 4px 8px 18px; background: var(--surface-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; padding-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.types { display: flex; flex-wrap: wrap; gap: 4px; }
.types span { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); }
.types span code { font-size: 12px; font-weight: 700; }
.reason { font-size: 13px; color: var(--warn); }
.down-reason { font-size: 13px; color: var(--bad); }

/* events */
.events { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.events li { display: grid; grid-template-columns: 10px 130px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.events .dot { align-self: center; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.foot { text-align: center; margin: 0; }
.banner { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 14px; font-weight: 700; }

/* phones: rows become cards */
@media (max-width: 760px) {
  .app-name { font-size: 14px; }
  .divider, .logo { display: none; }
  .summary .headline { font-size: 18px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .table tr.row td { border: 0; padding: 0; background: transparent !important; }
  .table tr.row td.c-name { grid-column: 1; }
  .table tr.row td.c-state { grid-column: 2; grid-row: 1; text-align: right; }
  .table tr.row td.c-port, .table tr.row td.c-age, .table tr.row td.c-lat, .table tr.row td.c-sats, .table tr.row td.c-pct { font-size: 13px; color: var(--muted); text-align: left; }
  .table tr.row td.c-port { display: none; }
  .table tr.row td.c-lat { text-align: right; }
  .table tr.row td.c-pct { grid-column: 2; grid-row: 3; text-align: right; }
  .table tr.row td.c-bars { grid-column: 1 / -1; }
  .table tr.row td[data-l]::before { content: attr(data-l) " "; font-weight: 700; }
  .detail td { padding: 8px 4px 16px; }
  .events li { grid-template-columns: 10px minmax(0, 1fr); }
  .events .when { grid-column: 2; }
  .events .dot { grid-row: 1 / span 2; }
  .events .what { grid-column: 2; }
}
