/* Rogue Wave firewall panel, "Mono" look: the same design as the hosting panel's new kit (Geist, flat neutral
   greys, colour only for state, no glow or gradients, status as a dot and a word, 34px controls). Loaded after
   rw.css and only overrides it: every class the scripts generate keeps working. Dark by default; light when
   <html data-theme="light"> (theme.js, remembered per browser). */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #0a0a0a; --bar: #0f0f0f; --card: #111111; --card-2: #161616; --hover: #1c1c1c;
  --line: #232323; --line-2: #2a2a2a; --line-3: #363636;
  --text: #ededed; --text-2: #d4d4d4; --text-3: #a1a1a1; --muted: #8f8f8f; --faint: #737373;
  /* the old accent becomes the neutral "primary" (white button, black ink); attention uses --warn */
  --amber: #ededed; --amber-ink: #0a0a0a; --amber-wash: rgba(255, 255, 255, .05); --amber-line: #3a3a3a;
  --grad: none;
  --warn: #f5a524; --warn-wash: rgba(245, 165, 36, .1); --warn-line: rgba(245, 165, 36, .35);
  --green: #45d483; --green-wash: rgba(69, 212, 131, .1); --green-line: rgba(69, 212, 131, .3);
  --red: #ff5c5c; --red-wash: rgba(255, 92, 92, .1); --red-line: rgba(255, 92, 92, .35);
  --yellow: #f5a524;
  --fill: rgba(237, 237, 237, .08);
  --sans: Geist, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 12px; --r-sm: 8px;
  --pop: 0 0 0 1px var(--line-2), 0 16px 40px -12px rgba(0, 0, 0, .7);
  --side-bg: #0a0a0a;
  --map-land: #1f1f1f;
}
html[data-theme='light'] {
  color-scheme: light;
  --bg: #fafafa; --bar: #f5f5f5; --card: #ffffff; --card-2: #fafafa; --hover: #f0f0f0;
  --line: #ebebeb; --line-2: #e3e3e3; --line-3: #d1d1d1;
  --text: #171717; --text-2: #2e2e2e; --text-3: #525252; --muted: #6e6e6e; --faint: #8a8a8a;
  --amber: #171717; --amber-ink: #fafafa; --amber-wash: rgba(0, 0, 0, .04); --amber-line: #d1d1d1;
  --warn: #b97400; --warn-wash: rgba(185, 116, 0, .08); --warn-line: rgba(185, 116, 0, .3);
  --green: #18a058; --green-wash: rgba(24, 160, 88, .08); --green-line: rgba(24, 160, 88, .3);
  --red: #e5484d; --red-wash: rgba(229, 72, 77, .07); --red-line: rgba(229, 72, 77, .3);
  --yellow: #b97400;
  --fill: rgba(23, 23, 23, .06);
  --pop: 0 0 0 1px var(--line-2), 0 16px 40px -12px rgba(0, 0, 0, .16);
  --side-bg: #fafafa;
  --map-land: #e3e3e3;
}

html, body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); letter-spacing: -0.006em; }
::selection { background: var(--fill); color: var(--text); }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.card-head a.right, a[data-go], .small-link { color: var(--text-3); font-size: 13px; }
.card-head a.right:hover, a[data-go]:hover { color: var(--text); }
nav#nav a, .side a, .rail a, .cmd-menu a, .atk-tabs > a, .range-sel a, .btn-vps, a.btn, .login-links a { text-decoration: none; }
code { color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------------------------------------------------------------- brand, sidebar, status bar */
.wm { font: 600 15px var(--sans); letter-spacing: -.03em; }
.wm i, .accent-text { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--faint); }
.wm-tag { font: 500 12px var(--sans); color: var(--muted); }
.sidenav { background: var(--side-bg); border-right: 1px solid var(--line); gap: 12px; padding: 16px 12px 14px; }
.sidenav .brand { padding: 4px 8px 4px; align-items: center; }
.sidenav .brand::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: #ffb000; flex: none; margin-right: 2px; align-self: center; }
.cmd input { height: 34px; padding: 0 64px 0 12px; border-radius: var(--r-sm); background: var(--bar); }
.cmd kbd { font: 500 11px var(--mono); border-color: var(--line-2); border-radius: 4px; background: var(--card); color: var(--muted); }
.cmd-menu { background: var(--card); border: 0; border-radius: 10px; box-shadow: var(--pop); padding: 4px; }
.cmd-menu a { border-radius: 6px; }
nav#nav .nh { font: 500 12px var(--sans); text-transform: none; color: var(--faint); padding: 16px 10px 6px; }
nav#nav a { gap: 10px; height: 34px; padding: 0 10px; border-left: 0; border-radius: 8px; font: 500 13px var(--sans); color: var(--text-3); }
nav#nav a svg { width: 16px; height: 16px; opacity: 1; color: var(--muted); }
nav#nav a:hover { background: var(--hover); color: var(--text); }
nav#nav a.active { background: var(--hover); color: var(--text); border-left: 0; border-radius: 8px; }
nav#nav a.active svg { color: var(--text); }
.nav-badge { background: var(--red); color: #fff; border-radius: 9px; font: 600 11px/18px var(--mono); }
.side-foot { border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.side-foot .user-btn { flex: 1; min-width: 0; }
.statusbar { height: 34px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.statusbar b { color: var(--text-2); }
.statusbar .warn { color: var(--warn); }
.statusbar .pill.red, .statusbar .alerts { color: var(--red); }
.theme-btn { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--text-3); cursor: pointer; }
.theme-btn:hover { background: var(--hover); color: var(--text); }
.theme-btn svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- page, cards */
main { padding: 32px 32px 80px; }
.page-head { gap: 12px; margin: 0 0 22px; align-items: center; }
.page-head h1 { font: 600 26px/1.15 var(--sans); letter-spacing: -.035em; }
.page-head .muted { font-size: 13px; }
.crumbs { font: 13px var(--sans); }
.crumbs i { color: var(--line-3); }
.card, .table-card, .tls-tile, .conn, .tiles, .cards { border-color: var(--line); border-radius: var(--r); background: var(--card); }
.card { padding: 20px; margin-bottom: 16px; }
.table-card { margin-bottom: 16px; }
.card.flush .pad { padding: 20px 20px 8px; }
.card-head { margin-bottom: 16px; }
.card-head h3 { font: 600 16px var(--sans); letter-spacing: -.02em; }
.card-head p, .card-head .ch-t span { font-size: 13px; color: var(--muted); }
.card-head.row { align-items: center; }
/* a title with a description under it keeps the actions level with the title */
.card-head.row:has(.ch-t) { align-items: flex-start; }
.card-head.row > h3 { line-height: 34px; }
.card-head.row .right, .card-head.row > .seg.right { margin-left: auto; }
/* a status word and its control sit together at the right edge */
.card-head .drop-all { margin-left: 14px; }
.card-title { font: 500 12px var(--sans); text-transform: none; color: var(--muted); }
.sec-title h2 { font: 600 18px var(--sans); letter-spacing: -.02em; }
.grid2, .grid4 { gap: 16px; }

/* tiles and stats: metric cells divided by hairlines */
.tile, .stat { padding: 18px 20px; }
.tile { border-right-color: var(--line); }
.tile label, .stat .label, .tls-tile .k, .l7-tiles .tls-tile .k { font: 500 13px var(--sans); text-transform: none; letter-spacing: 0; color: var(--muted); }
.tile .tv, .stat .value { font: 600 26px/1.15 var(--sans); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.tile .tv small { font: 400 13px var(--sans); letter-spacing: 0; color: var(--muted); }
.tile .ts, .stat .sub { font-size: 12px; color: var(--faint); }
.tile-bar, .mini-bar, .usage .bar, .tls-prog { height: 4px; background: var(--line-2); border-radius: 2px; }
.tile-bar i, .mini-bar i, .usage .bar i, .tls-prog i, .tls-tbl .share .bar i { background: var(--text); }
.tile-bar i.red { background: var(--red); }
.l7-tiles .tls-tile { background: var(--card); border-radius: var(--r); }
.l7-tiles .tls-tile.warn { background: var(--red-wash); border-color: var(--red-line); }
.l7-tiles .tls-tile b, .tls-tile b { font: 600 24px/1.2 var(--sans); letter-spacing: -.03em; }

/* ---------------------------------------------------------------- buttons and controls: one 34px height */
button, .btn { height: 34px; padding: 0 14px; border-radius: var(--r-sm); font: 500 13px var(--sans); line-height: 1;
  background: var(--amber); background-image: none; color: var(--amber-ink); border: 1px solid var(--amber); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .btn:hover { filter: none; opacity: .88; }
button.small, .btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
button.ghost, .user-btn, .btn-group button, .seg button, .choice-list button, .atk-x, .icon-rm, .atk-sh { background: transparent !important; background-image: none !important;
  color: var(--text-2) !important; border: 1px solid var(--line-2) !important; opacity: 1; }
button.ghost:hover, .user-btn:hover, .btn-group button:hover, .seg button:hover, .choice-list button:hover { background: var(--hover) !important; color: var(--text) !important; }
button.danger { background: transparent; color: var(--red); border-color: var(--red-line); }
button.danger:hover { background: var(--red-wash); opacity: 1; }
/* card-shaped buttons (profiles, presets, sensitivity options) are taller than a control: they keep their own
   height and layout, text on the left, and the "current" mark never overlaps the title */
button.profile, button.preset, button.sens-opt, button.note-btn { height: auto; min-height: 0; line-height: 1.45; white-space: normal; text-align: left; justify-content: flex-start; align-items: flex-start; }
button.profile { padding: 12px 14px; color: var(--text); background: var(--bar); border: 1px solid var(--line-2); }
button.profile b { padding-right: 58px; line-height: 1.3; }
button.profile:hover { border-color: var(--line-3); opacity: 1; }
button.profile.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); background: var(--bar); }
button.profile em { color: var(--muted); }
.ask-btns button.danger { background: var(--red); border-color: var(--red); color: #fff; }
button:disabled { opacity: .45; }
.btn-group { border: 0; border-radius: 0; gap: 0; overflow: visible; }
.btn-group button { border-radius: 0; margin-left: -1px; }
.btn-group button:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group button:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group button.primary { background: var(--amber) !important; color: var(--amber-ink) !important; border-color: var(--amber) !important; }
.btn-group button.danger { color: var(--red) !important; }
/* segmented choices: a quiet track with the chosen option raised */
.seg, .range-sel { display: inline-flex; gap: 0; padding: 2px; border: 0; border-radius: var(--r-sm); background: var(--hover); overflow: visible; }
.seg button { height: 28px; padding: 0 10px; border: 0 !important; border-radius: 6px; font: 500 12px var(--sans); color: var(--muted) !important; }
.seg button.on { background: var(--card) !important; color: var(--text) !important; box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, .12); }
.seg.sm button { height: 24px; padding: 0 9px; font: 500 12px var(--sans); }
.range-sel a { height: 24px; display: inline-flex; align-items: center; padding: 0 9px; border: 0; border-radius: 6px; font: 500 12px var(--sans); color: var(--muted); }
.range-sel a:hover { background: transparent; color: var(--text); }
.range-sel a.active { background: var(--card); background-image: none; color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
input, select, textarea { min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bar); color: var(--text); font: 13px var(--sans); }
textarea { padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--fill); }
.form-grid label, .limits-grid label, .block-label, .pm-sec > label > span, .addport .ap-f > span, .add-port label > span, .adv-f > span, .cap-form label, .shadow-grid label > span, .allow-forms label, .alert-form .lbl, .login-step label {
  font: 500 13px var(--sans); text-transform: none; letter-spacing: 0; color: var(--text-2); }
.hint { color: var(--muted); }
.sm-in { min-height: 28px; }
select.inline { min-height: 30px; }
/* switches: neutral track, the "on" state in the text colour */
.switch { width: 32px; height: 18px; }
.switch .slider { background: var(--line-3); border-radius: 18px; }
.switch .slider:before { width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input:checked + .slider { background: var(--text); background-image: none; }
.switch input:checked + .slider:before { transform: translateX(14px); background: var(--bg); box-shadow: none; }
.toggle.warn input:checked + .slider, .adv-sw .sw-row.warn input:checked + .slider { background: var(--red); }
input[type=checkbox]:not(.switch input) { border-color: var(--line-3); border-radius: 4px; background: var(--bar); }
input[type=checkbox]:not(.switch input):hover { border-color: var(--muted); }
input[type=checkbox]:not(.switch input):checked { background: var(--text); border-color: var(--text); }
input[type=checkbox]:not(.switch input):checked::after { border-color: var(--bg); }
.toggle { border-radius: var(--r-sm); background: var(--card); }

/* the styled dropdowns (ui.js): look like an input, open a quiet menu */
.dd .dd-btn { min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); background: var(--bar); border-color: var(--line-2); font: 400 13px var(--sans); }
.dd .dd-btn:focus-visible, .dd.open .dd-btn { border-color: var(--muted); box-shadow: 0 0 0 3px var(--fill); }
.dd.open .dd-caret { border-color: var(--text-3); }
.dd.placeholder .dd-label { color: var(--faint); }
.dd .dd-menu { background: var(--card); border: 0; border-radius: 10px; box-shadow: var(--pop); padding: 4px; }
.dd .dd-search { background: var(--card); }
.dd .dd-item { border-radius: 6px; }
.dd .dd-item.hl { background: var(--hover); }
.dd .dd-item.sel { background: transparent; }
.dd .dd-item.sel b { color: var(--text); font-weight: 600; }
.dd .dd-item.sel .ck { border-color: var(--text); }
.dd.inline .dd-btn { min-height: 30px; }

/* ---------------------------------------------------------------- status: a dot and a word, never a pill */
.pill, .pill-st, .badge, .tag, .chip, .l7-why, .l7-prot .pb, .chips-kv span { border: 0 !important; background: transparent !important; padding: 0; border-radius: 0; font: 500 12.5px var(--sans); }
.pill-st, .pill { gap: 6px; color: var(--text-3); }
.pill-st i, .pill .dot, .st .dot, .spill i { width: 7px; height: 7px; }
.pill-st.live, .pill.red, .badge.red, .l7-why.r-conn_rate, .l7-why.r-conn_cur { color: var(--red); }
.pill-st.good, .pill.green, .badge.green { color: var(--green); }
.pill-st.part, .pill-st.warn, .pill.amber, .pill.blue, .badge.amber, .badge.blue, .chip.health, .l7-why.r-no_hello, .l7-prot .pb.warn { color: var(--warn); }
.pill-st.bad { color: var(--red); }
.badge, .tag, .chip, .l7-prot .pb { color: var(--text-3); }
.badge::before, .tag::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.tag { margin-left: 8px; }
.l7-prot .pb.on { color: var(--text); }
.st.pending, .spill.warn, .srv-title .state.warn { color: var(--warn); }
.st.up, .spill.ok, .srv-title .state.ok { color: var(--green); }
.proto { border: 0; padding: 0; font: 500 11px var(--mono); color: var(--muted); }
.proto.udp { color: var(--muted); }
/* allow / deny on a port rule: a small bordered control with its word in the state colour */
.act-pill { height: 26px; min-width: 60px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2) !important; background: transparent !important; font: 500 12px var(--sans); display: inline-flex; align-items: center; justify-content: center; }
.act-pill.allow { color: var(--text); }
.act-pill.deny { color: var(--red); border-color: var(--red-line) !important; }
.act-pill:hover { filter: none; background: var(--hover) !important; }
button.who { height: 28px; padding: 0 10px; border-radius: 6px; border-color: var(--line-2); font: 500 12.5px var(--sans); color: var(--text-2); background: transparent; }
button.who.on { color: var(--text); border-color: var(--line-3); background: var(--hover); }
.preset { height: 30px; padding: 0 12px; border-radius: var(--r-sm); background: var(--card) !important; border-color: var(--line-2) !important; align-items: center; }
.preset:hover:not(:disabled) { border-color: var(--line-3) !important; background: var(--hover) !important; }
.l7-chip, .l7-stab { border-radius: 6px; }
.l7-chip.on, .l7-stab.on { color: var(--text); border-color: var(--line-3); background: var(--hover); }
.l7-chip input, .l7-check-opt input[type=checkbox] { accent-color: var(--text); }
.l7-chk { color: var(--text); }

/* ---------------------------------------------------------------- tables: quiet headers */
table.attacks th, table.list th, .tbl th, .rules th { font: 500 12px var(--sans); color: var(--faint); height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line); }
table.attacks td, table.list td, .tbl td, .rules td { padding: 13px 16px; border-bottom-color: var(--line); color: var(--text-2); }
table.attacks tr.row:hover td, .tbl tr.click:hover td, table.list tr.clickable:hover td, .l7-tbl tr.click:hover > td, .ov-ip:hover { background: var(--hover); }
table.attacks tr.row.open td, table.attacks tr.detail > td { background: var(--card-2); }
table.attacks td.ip, .tbl .b, .ip-table td.addr b, .port-cell b { font: 500 13px var(--mono); color: var(--text); }
table.list td.blue { color: var(--text); }
.l7-tbl td.l7-go { color: var(--faint); }
.l7-tbl tr.click:hover td.l7-go { color: var(--text); }
.rules-tbl tr.blocked td, .rules tr.blocked td { background: var(--red-wash); }
tr.ev-node td:nth-child(2) { color: var(--warn); }

/* ---------------------------------------------------------------- one IP page */
.srv-title { font: 600 32px/1.1 var(--mono); letter-spacing: -.03em; }
.srv-title .state { font: 500 14px var(--sans); }
.srv-meta { font: 13px var(--sans); color: var(--muted); }
.side a { height: 34px; padding: 0 10px; border-left: 0; border-radius: 8px; font: 400 13px var(--sans); color: var(--text-3); }
.side a:hover { background: var(--hover); color: var(--text); }
.side a.active { background: var(--hover); color: var(--text); font-weight: 500; border-left: 0; border-radius: 8px; }
.side .sh, .rail .rh { font: 500 12px var(--sans); color: var(--faint); }
.rail .rc { border-radius: var(--r); background: var(--card); }
.rail a { border-radius: 6px; font-size: 13px; }
.rail .owner b { color: var(--text); }
.fl-step { border-radius: 10px; background: var(--bar); border-color: var(--line-2); }
.fl-step.end { background: transparent; }
button.fl-step:hover, button.fl-step:focus-visible { background: var(--hover); border-color: var(--line-3); box-shadow: none; }
.fl-step.warn i { color: var(--warn); }
.fl-step.live { box-shadow: inset 2px 0 0 var(--red); }
.fl-step + .fl-step::before { border-left-color: var(--line-2); }
.def-cell, .addport, .add-rule, .allow-forms form, .l7-dns-row, .cf-offer { border-radius: 10px; background: var(--card-2); border-color: var(--line); }
.addport { border-radius: 0; }
.sens-opt { border-radius: 10px; background: var(--card); border-color: var(--line-2); }
.sens-opt.on { border-color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--text); }
.sens-top em { background: transparent; border: 0; color: var(--text-3); padding: 0; }
.sens-meter[data-l="1"] i:nth-child(-n+1), .sens-meter[data-l="2"] i:nth-child(-n+2), .sens-meter[data-l="3"] i { background: var(--text); }
.esc-state { border-color: var(--warn-line); background: var(--warn-wash); }
.esc-state i { background: var(--warn); }
.profile { border-radius: 10px; background: var(--card); }
.profile.on { border-color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--text); }
.profile em { color: var(--text-3); }
.adv-f.changed input { border-color: var(--warn-line); background: var(--warn-wash); }
.adv-f.changed > span::after, .adv-save .amber { color: var(--warn); }
.adv-save { background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------------------------------------------------------------- notices, banners */
.banner, .alert, .session-banner { border-radius: 10px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2); }
.banner b:first-child, .alert > b:first-child { color: var(--warn); }
.alert.attack { background: var(--red-wash); border-color: var(--red-line); }
.alert.attack > b:first-child { color: var(--red); }
.session-banner.error { background: var(--red-wash); border-color: var(--red-line); color: var(--red); }
.l7-note { border-left: 1px solid var(--line); border-radius: 10px; }
.l7-verify { border-color: var(--warn-line); background: var(--warn-wash); }
.l7-verify-rec code, .token-box { color: var(--text); }
.l7-top-ico, .pm-ico { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.pm-ico.good { background: var(--green-wash); border-color: var(--green-line); color: var(--green); }
.l7-reason .bar, .l7-st-row .bar { background: var(--line-2); }
.l7-reason .bar i { background: var(--text-3); }
.l7-st-row .bar i.a { background: var(--warn); }
.bars .bar { background: var(--bar); border-color: var(--line); border-radius: 6px; }
.bars .bar > i { background: var(--red-wash); border-right: 2px solid var(--red); }
.bars .bar.blue > i { background: var(--fill); border-right: 2px solid var(--text-3); }
.map { background: var(--card-2); border-color: var(--line); border-radius: 10px; }
.map path { fill: var(--map-land); stroke: var(--bg); }
pre.log, pre.pol-file, .l7-cmd, .l7-prov-out, .l7-note pre, .diff, .secret-box { background: var(--bar); border-color: var(--line); border-radius: var(--r-sm); color: var(--text-2); }
.diff .add { background: var(--green-wash); color: var(--green); }
.diff .del { background: var(--red-wash); color: var(--red); }

/* ---------------------------------------------------------------- dialogs, toasts, sign-in */
.modal-bg, .ask-bg { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.modal, .ask { background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--pop); }
.modal.pm .pm-sum, .modal.pm .actions { background: var(--card-2); }
.pm-sec > h4 { font: 600 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--text-3); }
.acct-av { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.tst, .toast { background: var(--card); border: 0; border-radius: 10px; box-shadow: var(--pop); }
.toast { border-left: 0; }
.chart-tip { background: var(--card); border: 0; border-radius: 8px; box-shadow: var(--pop); }
.overlay { background: var(--bg); }
.login-box { border-radius: 14px; border-color: var(--line); padding: 28px; gap: 16px; }
.login-box h2 { font: 600 22px var(--sans); letter-spacing: -.03em; }
.login-box button[type=submit] { height: 38px; font-size: 14px; }
.login-step input { min-height: 38px; font-size: 14px; }
.btn-vps { height: 38px; align-items: center; border-radius: var(--r-sm); border-color: var(--line-2); font-weight: 500; }
.btn-vps:hover { border-color: var(--line-3); background: var(--hover); }
.choice-list button { justify-content: flex-start; height: auto; min-height: 40px; padding: 8px 12px; }

/* ---------------------------------------------------------------- empty states */
.empty-state { align-items: center; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 44px 24px; }
.empty-state b { font: 600 15px var(--sans); }

@media (max-width: 860px) {
  main { padding: 20px 16px 60px; }
  .statusbar { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pill-st.live i, .dot.pulse, .spill.attack i { animation: none; }
}

/* small controls that must not take the 34px button height */
.l7-tag button { height: auto; padding: 0 2px; background: none; border: 0; color: var(--muted); }
.icon-rm, .atk-x { height: 28px; padding: 0 8px; }
.nav-toggle { height: auto; }
.adv-f code { color: var(--faint); }
.l7-steps code { background: var(--card-2); border-color: var(--line); }
.l7-style-sel, .l7-detail-style select, .l7-ac-add select, .l7-ac-add input { background: var(--bar); border-color: var(--line-2); border-radius: var(--r-sm); }

/* labels in key/value rows: quiet sans, like the hosting panel's facts */
.rows label, .kv dt, .kv-list span, .conn label, .def-row span, .bars .name .sub, .att-row .t, .node-card .nc-stats .label { font: 400 13px var(--sans); color: var(--muted); }
.rows b, .kv dd, .kv-list b { color: var(--text); }
.conn code { background: transparent; border: 0; padding: 0; }

/* IP page header (ip.js renderHead): breadcrumb with chevrons, facts with icons divided by hairlines */
#ip-root .crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font: 400 13px var(--sans); color: var(--muted); }
#ip-root .crumbs svg { width: 14px; height: 14px; color: var(--line-3); flex: none; }
#ip-root .crumbs a { color: var(--muted); cursor: pointer; }
#ip-root .crumbs a:hover { color: var(--text); }
#ip-root .crumbs b { font: 500 13px var(--mono); color: var(--text); }
.srv-meta { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; margin-top: 12px; font: 400 13px var(--sans); color: var(--text-2); }
.srv-meta > span { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-left: 1px solid var(--line); line-height: 20px; white-space: nowrap; }
.srv-meta > span:first-child { padding-left: 0; border-left: 0; }
.srv-meta > span.mono { font: 400 12.5px var(--mono); }
.srv-meta svg { width: 14px; height: 14px; color: var(--muted); flex: none; }

/* ---------------------------------------------------------------- tunnels page (tunnels.js) */
.pill-st.muted { color: var(--muted); }
.tun-tbl td.tun-ipcell { font: 500 12.5px/1.7 var(--mono); color: var(--text); white-space: nowrap; }
.tun-tbl td { vertical-align: top; }
.tun-tbl td.chev { vertical-align: middle; }
/* two equal columns whatever they hold: a long setup line scrolls inside its own box instead of widening its card */
.tun-detail .grid2 { align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tun-detail .card { margin-bottom: 0; min-width: 0; }
@container main (max-width: 820px) { .tun-detail .grid2 { grid-template-columns: minmax(0, 1fr); } }
.tun-detail .card-head.row { flex-wrap: wrap; row-gap: 8px; }
.tun-detail .card-head .ch-t { flex: 1 1 260px; min-width: 0; }
.tun-detail .card-head .seg { flex: none; }
.seg button { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.tun-tbl td.tun-conn { max-width: 320px; }
.tun-path { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tls-tile b .mono { font: 600 22px/1.2 var(--mono); letter-spacing: -.04em; }
.tun-detail .card-head .inline-list { gap: 6px; }
.tun-detail .kv dd { word-break: normal; overflow-wrap: anywhere; }
.tun-key { font: 400 12px var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.tun-ips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tun-ip { height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.tun-ip:hover { background: var(--hover); border-color: var(--line-3); text-decoration: none; }
pre.tun-setup { max-height: 360px; margin: 0; white-space: pre; max-width: 100%; overflow: auto; }
.tun-detail .actions { margin-top: 12px; }
.tun-pool { padding: 14px 0 16px; border-top: 1px solid var(--line); }
.tun-pool:first-of-type { border-top: 0; padding-top: 0; }
.tun-pool-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.tun-pool-h b { font: 600 14px var(--sans); color: var(--text); }
.tun-pool .list { margin-bottom: 8px; }
/* the customer under the tunnel id, and every row the same height whether it has a Remove button or not */
.tun-pool table.list td { height: 56px; padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
.tun-pool table.list td .sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.tun-pool-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tun-pool-add input[name=ips] { flex: 2 1 240px; min-width: 0; }
.tun-pool-add input[name=note] { flex: 1 1 140px; min-width: 0; }
.modal.pm .seg { align-self: flex-start; }
@container main (max-width: 640px) {
  table.attacks.tun-tbl tr.detail > td { padding: 0 0 12px; }
  table.attacks.tun-tbl tr.row > td, table.attacks.tun-tbl tr.row > td * { white-space: normal; overflow-wrap: anywhere; }
  .tun-detail .card { padding: 14px; }
  .tun-detail .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .tun-detail .kv dd { margin-bottom: 8px; }
  .tun-detail .card-head.row { flex-wrap: wrap; }
  .tun-detail .card-head .right { margin-left: 0; }
  .tun-pool-add button { width: 100%; }
}
@container main (max-width: 640px) {
  table.attacks.tun-tbl tr.row > td .nowrap, table.attacks.tun-tbl tr.row > td .mono { overflow-wrap: normal; }
  table.attacks.tun-tbl tr.row > td .nowrap { white-space: nowrap; }
  table.attacks.tun-tbl td.tun-conn { max-width: none; }
  table.attacks.tun-tbl .tun-path { display: inline; }
}

/* ---------------------------------------------------------------- dialogs: the body scrolls, head and buttons stay */
.modal-bg:has(> .modal.pm) { padding: 40px 16px; }
.modal.pm { display: flex; flex-direction: column; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
.modal.pm > .pm-head, .modal.pm > .pm-sum, .modal.pm > .actions { flex: none; }
.modal.pm > .actions { padding-top: 14px; border-top: 1px solid var(--line); }
.modal.pm .pm-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; }
/* rows of buttons inside the body are content, not the dialog's footer */
.modal.pm .pm-body .actions { margin: 0; padding: 0; background: none; border: 0; }
.modal.pm .kv dd { word-break: normal; overflow-wrap: break-word; }
.modal.pm .kv dd .sub { display: block; color: var(--muted); font-size: 12px; }
.gp-st { display: flex; align-items: flex-start; gap: 12px; }
.gp-st > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.gp-st .muted { font-size: 13px; }
.gp-st > button, .gp-addr button { flex: none; }
.gp-addr { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.gp-kv { gap: 8px 18px; }
@media (max-width: 600px) {
  .modal-bg:has(> .modal.pm) { padding: 12px 10px; }
  .modal.pm { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .modal.pm .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .modal.pm .kv dd { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------- small fixes */
/* the account button: a long name is cut at its end with an ellipsis */
.side-foot .user-btn { display: block; height: 30px; line-height: 28px; padding: 0 10px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the attack header: sans text, the address in mono */
.atk-head .sub { font: 12.5px var(--sans); }
.atk-head .sub .mono { font: 12px var(--mono); color: var(--text-2); }
/* a protected IP's page: the link to its tunnel; the action cards under the page keep their own height */
.srv-meta a.srv-tun { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.srv-meta a.srv-tun:hover { color: var(--text); }
.rail { align-items: start; }
/* game ports: the origin under the address in mono */
.l7-tbl td .sub .mono { font-size: 12px; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 860px) {
  /* the status bar wraps onto a second line instead of cutting its text */
  .statusbar { height: auto; min-height: 34px; padding: 6px 16px; flex-wrap: wrap; row-gap: 2px; }
  .statusbar > div { flex-wrap: wrap; gap: 2px 14px; overflow: visible; }
}
@container main (max-width: 520px) {
  /* the four tiles two by two */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles .tile { padding: 14px; border-right: 1px solid var(--line); border-bottom: 0; }
  .tiles .tile:nth-child(2n) { border-right: 0; }
  .tiles .tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tiles .tile .tv { font-size: 22px; }
  .l7-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .l7-tiles .tls-tile { padding: 12px 12px 11px; }
  .l7-tiles .tls-tile .l7-ti { top: 11px; right: 11px; width: 16px; height: 16px; }
  .l7-tiles .tls-tile b { font-size: 22px; }
  .l7-tiles .tls-tile b .mono { font-size: 15px; letter-spacing: -.02em; overflow-wrap: anywhere; }
  .l7-tiles .tls-tile .s { font-size: 11.5px; }
}
@container main (max-width: 640px) {
  /* game ports: one block per port instead of columns running off the screen */
  table.l7-games thead { display: none; }
  table.l7-games, table.l7-games tbody { display: block; }
  table.l7-games tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.l7-games tr:last-child { border-bottom: 0; }
  table.l7-games td, .card.flush table.l7-games td:first-child { display: block; padding: 0; border: 0; min-width: 0; }
  table.l7-games td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.l7-games td.l7-go { display: none; }
}
/* fields that take addresses: mono like the addresses everywhere else */
.tun-pool-add input[name=ips], .modal.pm input[name=remote], .modal.pm input[name=origin] { font-family: var(--mono); font-size: 12.5px; }
