/* Anon VPN Manager. Dark ink surfaces, one cyan-to-violet accent (the app's own), system type. */
/* Anon VPN Manager. Pale space-grey surfaces, one quiet slate-blue accent, system type. */
:root {
  --bg: #f1f2f4;
  --bg-2: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #eceef2;
  --line: #dcdfe5;
  --line-soft: #e9ebef;
  --text: #22252b;
  --muted: #6d7482;
  --accent: #4f6b95;
  --accent-2: #6a7fb0;
  --good: #2e8f6b;
  --warn: #b7791f;
  --bad: #c24a4a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 36, 50, .05), 0 8px 24px rgba(30, 36, 50, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Myanmar", sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 2px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
small { font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.note { background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.note b { color: var(--accent); }
.note p { margin: 0; } .note p + p { margin-top: 6px; }

/* ---------- forms ---------- */
label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select, textarea { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; width: 100%; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; line-height: 1.45; }
label small { font-weight: 400; color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; margin: 0; }
.field { display: grid; gap: 6px; }
.field > .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.sec-title { font-size: 11.5px; font-weight: 700; color: var(--accent); letter-spacing: .03em; margin: 6px 0 -4px; }

/* toggle switch (replaces bare checkboxes) */
.switch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 11px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); font-weight: 600; font-size: 13.5px; }
.switch:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.switch small { display: block; font-weight: 400; color: var(--muted); margin-top: 1px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 24px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.switch input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* choice cards (radio) */
.choices { display: grid; gap: 8px; }
.choices.cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice { display: grid; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; cursor: pointer; color: var(--text); font-weight: 600; font-size: 13.5px; position: relative; }
.choice small { color: var(--muted); font-weight: 400; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px; padding: 11px 14px; font-weight: 600; }
.preview small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: border-color .12s, transform .06s; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, #4a5d7d, #5d78a6); color: #fff; border: 0; padding: 10px 16px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.good { background: var(--good); color: #fff; border: 0; }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.btn.danger:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.wide { width: 100%; justify-content: center; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.login-art { position: relative; overflow: hidden; background: linear-gradient(160deg, #e4e7ec 0%, #d9dde4 100%); color: var(--text); padding: 48px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-art .brandline { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .28em; font-size: 15px; }
.login-art .brandline img { width: 40px; height: 40px; }
.login-art h2 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; margin: 0 0 14px; max-width: 14ch; }
.login-art p { color: var(--muted); max-width: 38ch; margin: 0; font-size: 15px; }
.login-art svg.route { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; pointer-events: none; }
.route .link { fill: none; stroke: #9aa3b5; stroke-width: 1.4; stroke-dasharray: 3 7; }
.route .node { fill: #fff; stroke: #5a6a85; stroke-width: 1.6; }
.route .node.home { stroke: #2e8f6b; }
.route .ping { fill: none; stroke: #5a6a85; stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: ping 4.8s ease-out infinite; }
.route .ping.p2 { animation-delay: 1.6s; } .route .ping.p3 { animation-delay: 3.2s; }
.route .packet { fill: #4f6b95; filter: drop-shadow(0 0 5px rgba(79,107,149,.6)); }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
.login-art .legend { position: relative; display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.login-art .legend b { color: var(--text); display: block; font-size: 18px; }
.login-art .copy { position: relative; }
.login-form-side { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; }
.login-card h1 { font-size: 26px; }
.login-card .sub { color: var(--muted); margin: 0 0 8px; }
.login-card .field-in { position: relative; }
.login-card .field-in input { padding-right: 56px; }
.login-card .show { position: absolute; right: 8px; bottom: 7px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.login-card .show:hover { color: var(--text); }
.login-foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; }
.btn.primary.busy { opacity: .7; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .route .ping, .route .packet animateMotion { animation: none; } }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 0; padding: 24px; gap: 28px; }
  .login-art .legend, .login-art svg.route { display: none; }
}

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 4px; }
.brand img { width: 38px; height: 38px; }
.wordmark { font-weight: 900; letter-spacing: .24em; font-size: 14px; line-height: 1.15; }
.sub { color: var(--muted); font-size: 12px; }
#nav { display: grid; gap: 2px; }
#nav .grp { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 12px 12px 4px; opacity: .85; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; position: relative; }
#nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
#nav a.on { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--text); }
#nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent), var(--accent-2)); }
.ico { flex: none; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line-soft); }
.side-foot .who { min-width: 0; line-height: 1.25; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 28px clamp(16px, 3vw, 36px) 48px; max-width: 1240px; width: 100%; min-width: 0; }
.badge { background: var(--warn); color: #fff; border-radius: 20px; padding: 0 7px; font-size: 11px; font-weight: 700; margin-left: auto; }
.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 70%, transparent); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head .lead { max-width: 70ch; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.section { margin-bottom: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.count { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat .num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat a { font-size: 12.5px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 18px; }
canvas { width: 100%; height: 190px; display: block; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11.5px; padding: 11px 14px; white-space: nowrap; font-weight: 700; background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
td { padding: 12px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
td.no, th.no { width: 44px; text-align: right; color: var(--muted); padding-right: 4px; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
tr.sel td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.who-name { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who-sub { color: var(--muted); font-size: 12.5px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--muted); opacity: .7; }
.dot.on { background: var(--good); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; border: 1px solid currentColor; line-height: 1.6; white-space: nowrap; }
.pill.active { color: var(--good); } .pill.pending { color: var(--warn); }
.pill.banned { color: var(--bad); } .pill.expired, .pill.limited { color: var(--muted); }
.pill.wl { color: var(--accent); } .pill.violet { color: var(--accent-2); }
.pill.sev-emergency { color: #ff8e9b; background: color-mix(in srgb, #ff4d6a 14%, transparent); }
.pill.sev-warning { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.pill.sev-info { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }
.bar > i.hot { background: var(--bad); }
.bar.big { height: 9px; margin-top: 6px; }

/* ---------- device detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.kv { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 9px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.timeline > div { padding: 14px 16px; }
.timeline > div + div { border-left: 1px solid var(--line); }
.timeline .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.timeline .d { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.timeline .t { font-size: 13px; color: var(--muted); }
.timeline .left { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0 !important; display: grid; gap: 7px; }
.actions-group { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.actions-label:first-child { margin-top: 0; }
.log { max-height: 320px; overflow: auto; }
.log div { padding: 7px 0; border-top: 1px solid var(--line-soft); }
.log div:first-child { border-top: 0; }

/* ---------- plans (cards) ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.plan { position: relative; display: grid; gap: 10px; align-content: start; border-top: 4px solid var(--pc, var(--accent)); }
.plan .pname { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.plan .pbadge { font-size: 11px; font-weight: 800; color: #14100a; background: var(--pc, var(--accent)); border-radius: 6px; padding: 1px 7px; }
.plan .price { font-size: 22px; font-weight: 800; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--muted); }
.plan li::before { content: "✓"; color: var(--pc, var(--accent)); font-weight: 800; margin-right: 8px; }
.plan.off { opacity: .6; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--pc); vertical-align: -1px; margin-right: 6px; }
[data-c="silver"] { --pc: #c4cad8; } [data-c="gold"] { --pc: #f5b83a; } [data-c="diamond"] { --pc: #5ee0ff; }
[data-c="blue"] { --pc: #3fb6f0; } [data-c="green"] { --pc: #34d399; } [data-c="rose"] { --pc: #ff6b9a; }
[data-c="purple"] { --pc: #a78bfa; } [data-c="orange"] { --pc: #fb923c; }

/* ---------- servers, sponsors ---------- */
.item { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.item .grow { flex: 1; min-width: 180px; }
.logo-box { width: 64px; height: 64px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.clip { max-width: 52ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none; }
.kind-ico.sub { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 16px; max-width: 760px; }
.settings-grid .card { display: grid; gap: 14px; }
.settings-grid .card > header p { margin: 0; color: var(--muted); }
.savebar { position: sticky; bottom: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; backdrop-filter: blur(6px); box-shadow: var(--shadow); }

/* ---------- modal + toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 7, 18, .68); display: grid; place-items: center; padding: 16px; z-index: 20; overflow-y: auto; }
.modal .card { width: min(500px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; }
.modal .card.wide { width: min(720px, 100%); }
.modal h2 { font-size: 18px; margin: 0; }
.modal .lede { margin: -6px 0 0; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 18px; z-index: 30; max-width: calc(100vw - 32px); box-shadow: var(--shadow); font-weight: 600; }
.toast.bad { border-color: var(--bad); }
.logbox { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0; max-height: 300px; overflow: auto; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.meter { display: block; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; }
  .brand { padding: 0; } .brand .sub { display: none; }
  #nav { grid-auto-flow: column; overflow-x: auto; order: 3; width: 100%; padding-bottom: 4px; }
  #nav .grp { display: none; } #nav a { white-space: nowrap; } #nav a.on::before { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 18px 16px 40px; }
  .grid2, .detail { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; } .timeline > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

table.devs { table-layout: fixed; min-width: 860px; }
table.devs th:nth-child(1) { width: 48px; } table.devs th:nth-child(2) { width: 27%; } table.devs th:nth-child(3) { width: 15%; }
table.devs th:nth-child(4) { width: 12%; } table.devs th:nth-child(5) { width: 9%; } table.devs th:nth-child(6) { width: 15%; }
table.devs td { overflow-wrap: anywhere; }



/* ---------- calm layer ---------- */
.card { box-shadow: var(--shadow); border-color: var(--line-soft); }
.card.flush { overflow: hidden; }
.note { background: #eef1f6; border-color: #d5dbe7; }
.note b { color: var(--accent); }
.side { background: #e8eaee; border-right: 1px solid var(--line); }
#nav a { border-radius: 10px; }
#nav a:hover { background: rgba(255, 255, 255, .7); }
#nav a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
#nav a.on::before { background: var(--accent); }
.side-foot { border-top-color: var(--line); }
h1 { letter-spacing: -.015em; font-weight: 700; }
th { background: #f6f7f9; color: var(--muted); font-weight: 600; }
tr.click:hover td, tr.sel td { background: #f4f6fa; }
input, select, textarea { background: #fff; border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline-color: var(--accent); }
.switch, .choice, .preview { background: #fff; }
.choice:has(input:checked) { background: #eef2f9; }
.pill.violet { color: #6a5fb3; }
.btn { background: #fff; border-color: var(--line); }
.btn:hover { border-color: var(--accent); }
.btn.danger { background: #fff; }
.btn.ghost { background: transparent; }
.dot.on, .led.on { background: var(--good); box-shadow: 0 0 0 3px rgba(46, 143, 107, .18); }
.led { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 9px; background: #b6bcc8; }
.led.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(194, 74, 74, .18); }
.engine { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.engine .warn { margin-bottom: 0; }
.switch.card.slim { margin-bottom: 16px; }
.modal { background: rgba(34, 37, 43, .38); backdrop-filter: blur(3px); }
.login-form-side { background: #f6f7f9; }
.login-card { padding: 28px; background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; box-shadow: var(--shadow); }
.login-card .sub { color: var(--muted); }
.qrwrap { display: grid; gap: 12px; justify-items: stretch; }
.qrbox { width: min(280px, 100%); margin: 0 auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.qrbox svg { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qrwrap textarea { font-size: 11.5px; word-break: break-all; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.engine-wrap { margin-bottom: 18px; } .engine-wrap .engine { margin-bottom: 0; }
.checks { background: #fff; border: 1px solid var(--line-soft); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 10px 16px 12px; margin-top: -6px; }
.checks summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.checks ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 7px; }
.led.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(183, 121, 31, .18); }

/* Devices page tabs */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip b { font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 0 8px; min-width: 24px; text-align: center; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on b { background: rgba(255, 255, 255, .22); color: #fff; }
.chip.warn:not(.on) { border-color: var(--warn); }
.chip.warn:not(.on) b { background: var(--warn); color: #fff; }
.chip .dot { margin-right: 0; }

/* Live feed */
.live-feed { display: grid; }
.live-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.live-row:first-child { border-top: 0; }
.live-row:hover { background: var(--bg-2); }
.live-row .led { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.live-row.warn .led { background: var(--warn); }
.live-toasts { position: fixed; top: 16px; right: 16px; z-index: 60; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.live-toast { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--good); box-shadow: 0 10px 30px rgba(20, 30, 50, .18); color: var(--text); text-decoration: none; animation: liveIn .25s ease-out; }
.live-toast.warn { border-left-color: var(--warn); }
.live-toast span { color: var(--muted); }
@keyframes liveIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .live-toast { animation: none; } }

/* Servers: who a server reaches */
.reach { margin-top: 4px; color: var(--good); font-size: 12.5px; font-weight: 600; }
.reach.none { color: var(--warn); }

/* ---- HTTPS page, security cards ---- */
.ssl-setup { display: grid; gap: 14px; margin-bottom: 16px; }
.ssl-tools { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.ssl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; margin-bottom: 16px; }
.ssl-card { display: grid; gap: 12px; align-content: start; border-left: 4px solid var(--good); }
.ssl-card.state-soon, .ssl-card.state-stale { border-left-color: var(--warn); }
.ssl-card.state-expired { border-left-color: var(--bad); }
.ssl-card.state-missing { border-left-color: var(--line); }
.ssl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ssl-head h2 { margin: 0 0 2px; font-size: 16px; word-break: break-all; }
.ssl-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.fact { display: grid; gap: 1px; min-width: 0; }
.fact span { font-size: 11.5px; color: var(--muted); }
.fact b { font-size: 13px; font-weight: 600; word-break: break-word; }
.lifebar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.lifebar i { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.advice { margin: 0; color: var(--muted); font-size: 13px; }
.advice.bad { color: var(--bad); font-weight: 600; }
pre.log { margin: 10px 0 0; max-height: 260px; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 560px) { .ssl-grid { grid-template-columns: 1fr; } .ssl-facts { grid-template-columns: 1fr; } }
.btn.busy { opacity: .6; pointer-events: none; }

.paths { display: grid; gap: 6px; }
.pathrow { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.pathrow .lbl { font-size: 11.5px; color: var(--muted); }
.pathrow code { white-space: normal; word-break: break-all; padding: 6px 8px; border-radius: 6px; background: var(--line); font-size: 12px; user-select: all; }
@media (max-width: 560px) { .pathrow { grid-template-columns: minmax(0, 1fr) auto; } .pathrow .lbl { grid-column: 1 / -1; } }

.ssl-grid { margin-top: 16px; }
