/* CASTILO VPN — "Resilient Access"
   Same visual family as the CastiloCloud portals: blue gradient top bar, light page,
   white cards with soft borders, navy primary buttons, green status chips, gradient
   banner cards, ring gauges and line charts with a dashed 80% alarm line. */

:root {
  /* brand */
  --bar-1: #1B3A8C;
  --bar-2: #2A6BD1;
  --navy: #1E3F94;
  --navy-hover: #183479;
  --blue: #1F6FC9;
  --sky: #43A3E3;
  --sky-soft: #E6F2FC;
  --on-bar: #FFFFFF;
  --on-bar-2: rgba(255, 255, 255, .78);
  --bar-line: rgba(255, 255, 255, .22);
  /* page */
  --bg: #F3F6FB;
  --paper: #FFFFFF;
  --paper-2: #F8FAFD;
  --line: #E3E8F1;
  --line-strong: #CDD5E3;
  --ink: #172033;
  --ink-2: #44506A;
  --ink-3: #737E95;
  --hover: #F1F5FB;
  /* status */
  --ok: #18794E;   --ok-soft: #E6F6EE;  --ok-line: #3AA76D;  --ok-ring: #1E8E5A;
  --warn: #8A5A00; --warn-soft: #FFF3D4; --warn-line: #E2B23B;
  --bad: #C0322B;  --bad-soft: #FDECEB;  --bad-line: #E57A73;
  --live: #2FBF71;
  --alarm: #D9443A;
  /* charts */
  --c1: #1E3F94; --c1-fill: rgba(30, 63, 148, .16);
  --c2: #43A3E3; --c2-fill: rgba(67, 163, 227, .18);
  --grid: #EDF1F7;
  /* logo arcs: CastiloCloud's original palette on light backgrounds */
  --arc1: #1B3A8C; --arc2: #1F6FC9; --arc3: #42A0DC; --arc4: #8ED6F2;
  /* avatar tints */
  --t1: #E3F4EC; --t1i: #18794E;  --t2: #E4ECFB; --t2i: #2448A8;  --t3: #FDEFD9; --t3i: #9A5A0B;
  --t4: #EFE6FB; --t4i: #6E3DB6;  --t5: #FCE6EA; --t5i: #B0304C;  --t6: #E1F2FB; --t6i: #1B6E95;
  /* shape */
  --r-card: 14px;
  --r-ctl: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-pop: 0 18px 50px rgba(16, 24, 40, .20), 0 2px 6px rgba(16, 24, 40, .08);
  --max: 1240px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "DejaVu Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --wordmark: "Arial Black", "Arial Bold", Arial, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bar-1: #0F2560; --bar-2: #1B4BA6;
  --navy: #5B86EA; --navy-hover: #7A9EF0; --blue: #7DB4F5; --sky: #5DB5EE; --sky-soft: #15284F;
  --bg: #0B1430; --paper: #121D40; --paper-2: #16234B; --line: #22305A; --line-strong: #31406F;
  --ink: #E6ECFA; --ink-2: #B4BFDA; --ink-3: #8691B2; --hover: #182752;
  --ok: #5ED39B; --ok-soft: #12352A; --ok-line: #3AA76D; --ok-ring: #4CC88C;
  --warn: #F0C164; --warn-soft: #3A2E12; --bad: #FF8A80; --bad-soft: #3D1A1E; --bad-line: #C2554D;
  --c1: #7DA2F2; --c1-fill: rgba(125, 162, 242, .18); --c2: #5DC0F2; --c2-fill: rgba(93, 192, 242, .16);
  --grid: #1C2A55;
  --t1: #133A2B; --t1i: #6BD9A6; --t2: #1D2C63; --t2i: #9DB4FF; --t3: #3A2A14; --t3i: #F2B36D;
  --t4: #2C2152; --t4i: #C7A2FF; --t5: #3E1B2B; --t5i: #FF94AE; --t6: #14334A; --t6i: #7DCDF0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 14.5px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.xs { width: 14px; height: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- logo ---------- */
.arc1 { fill: var(--arc1); } .arc2 { fill: var(--arc2); } .arc3 { fill: var(--arc3); } .arc4 { fill: var(--arc4); }
/* bright palette (CastiloCloud's light-on-dark logo) wherever the background is blue */
.topbar, .auth-brand, .gbanner {
  --arc1: #5A88E0; --arc2: #3897E6; --arc3: #5CC0EE; --arc4: #DDF4FC;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; color: var(--on-bar); }
.brand-logo { height: 40px; width: 40px; flex: none; display: block; }
.brand-logo.big { height: 96px; width: 96px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--wordmark); font-weight: 900; font-size: 15px; letter-spacing: .03em; color: #fff; }
.brand-name b { font-weight: 900; color: #8FD3F2; }
.brand-sub { color: var(--on-bar-2); font-size: 11.5px; margin-top: 2px; }

/* ---------- top bar ---------- */
.topbar { background: linear-gradient(90deg, var(--bar-1) 0%, var(--bar-2) 100%); color: var(--on-bar); position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px rgba(16, 36, 94, .18); }
.topbar-inner { max-width: var(--max); margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; gap: 24px; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; text-decoration: none; color: var(--on-bar-2); font-weight: 600; white-space: nowrap; }
.nav a .icon { width: 17px; height: 17px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.nav a.is-active { color: var(--bar-1); background: #fff; box-shadow: 0 2px 6px rgba(10, 30, 80, .18); }
[data-theme="dark"] .nav a.is-active { color: #0F2560; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid var(--bar-line); color: #fff; text-decoration: none; font-size: 13px; font-weight: 650; }
.live-count { font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9AA6C2; flex: none; position: relative; display: inline-block; }
.dot.on { background: var(--live); }
.dot.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: ping 2.2s ease-out infinite; }
.dot.off { background: var(--bad-line); }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; list-style: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.topbar .icon-btn { color: var(--on-bar-2); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.icon-btn::-webkit-details-marker, .avatar-btn::-webkit-details-marker { display: none; }
[data-theme="dark"] .theme-dark, :root:not([data-theme="dark"]) .theme-light { display: none; }
.avatar-btn { list-style: none; cursor: pointer; border-radius: 999px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: var(--bar-1); font-weight: 800; font-size: 13px; border: 2px solid rgba(255, 255, 255, .5); }

/* ---------- page ---------- */
.content { flex: 1; padding-top: 22px; padding-bottom: 48px; }
.hero:empty { display: none; }
.hero { margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hello { margin: 0 0 4px; color: var(--blue); font-weight: 650; font-size: 13.5px; }
.page-title { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.page-sub { margin: 6px 0 0; color: var(--ink-3); max-width: 75ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.crumb::before { content: "←"; }
.crumb:hover { text-decoration: underline; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(16, 36, 94, .25); }
.btn-primary:hover { background: var(--navy-hover); }
[data-theme="dark"] .btn-primary { color: #0B1430; }
.btn-quiet { background: var(--paper); border-color: var(--line-strong); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn-quiet:hover { border-color: var(--ink-3); background: var(--paper-2); }
.btn-glass { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-glass:hover { background: rgba(255, 255, 255, .24); }
.btn-white { background: #fff; color: var(--bar-1); }
.btn-white:hover { background: #EEF4FF; }
.btn-danger { background: var(--bad); color: #fff; }
[data-theme="dark"] .btn-danger { color: #2A0A12; }
.btn-danger-quiet { background: var(--paper); border-color: #F2C3BF; color: var(--bad); }
.btn-danger-quiet:hover { background: var(--bad-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
.link { color: var(--blue); text-decoration: none; font-weight: 650; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--blue); font-weight: 650; cursor: pointer; text-decoration: none; font-size: 13.5px; }
.strong-link { font-weight: 700; text-decoration: none; color: var(--blue); }
.strong-link:hover { text-decoration: underline; }

/* ---------- cards, tables ---------- */
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-head h2, .setting h2, .steps h2 { margin: 0; font-size: 16.5px; font-weight: 750; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.split .sheet { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 -22px -20px; position: relative; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .num { text-align: right; }
.table .num-l { white-space: nowrap; }
.table .sub, .sub { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.table tr.empty td { text-align: center; color: var(--ink-3); padding: 34px 16px; }
.table tr.is-dim td { color: var(--ink-3); }
.table tr.is-new td { animation: flash-row 2.4s ease-out; }
@keyframes flash-row { from { background: var(--ok-soft); } to { background: transparent; } }
.actions-col { text-align: right; white-space: nowrap; width: 1%; }
.actions-col > * { vertical-align: middle; }
.actions-col form { display: inline-flex; vertical-align: middle; margin: 0; }
.who { display: inline-flex; align-items: center; gap: 11px; }
.who strong { white-space: nowrap; font-weight: 650; }
.tile { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; background: var(--t2); color: var(--t2i); }
.tile.t1 { background: var(--t1); color: var(--t1i); } .tile.t2 { background: var(--t2); color: var(--t2i); }
.tile.t3 { background: var(--t3); color: var(--t3i); } .tile.t4 { background: var(--t4); color: var(--t4i); }
.tile.t5 { background: var(--t5); color: var(--t5i); } .tile.t6 { background: var(--t6); color: var(--t6i); }
.tile.is-online { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--live); }
.online-tag { font-size: 12px; font-weight: 700; color: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.act { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.act-bad { color: var(--bad); }

/* toolbar, filters, search */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 0; gap: 0; border-radius: var(--r-ctl); background: var(--paper); border: 1px solid var(--line-strong); margin: 0; overflow: hidden; flex-wrap: wrap; }
.seg { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-2); font-weight: 650; font-size: 13.5px; cursor: pointer; }
.seg:last-child { border-right: 0; }
.seg:hover { background: var(--hover); }
.seg input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.seg .count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg.is-on { background: var(--navy); color: #fff; }
.seg.is-on .count { color: rgba(255, 255, 255, .8); }
[data-theme="dark"] .seg.is-on { color: #0B1430; }
.seg:has(input:focus-visible) { outline: 2px solid var(--sky); }
.segmented.wide { margin-bottom: 18px; }
fieldset.segmented { min-width: 0; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 13px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 38px; width: 280px; height: 40px; }
.search::after { content: "/"; position: absolute; right: 11px; font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; line-height: 18px; pointer-events: none; }
.live-note { margin: -6px 0 12px; }
.head-tools { display: flex; align-items: center; gap: 8px; }
.refresh-btn.is-spinning .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* menus */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-pop); text-align: left; }
.menu-list form { display: block !important; margin: 0; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--ink); text-decoration: none; }
.menu-list button:hover, .menu-list a:hover, .menu-list button:focus-visible, .menu-list a:focus-visible { background: var(--hover); outline: none; }
.menu-list .icon { color: var(--ink-3); }
.menu-list button.danger, .menu-list button.danger .icon { color: var(--bad); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-head { display: flex; flex-direction: column; padding: 8px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head span { color: var(--ink-3); font-size: 12.5px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--ink-2); min-width: 0; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.label-row { display: flex; gap: 6px; align-items: baseline; }
.field .hint, .hint { font-weight: 400; font-size: 12.5px; color: var(--ink-3); margin: 0; }
input, select, textarea { width: 100%; min-width: 0; height: 42px; padding: 0 13px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-weight: 400; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 25%, transparent); }
.code-input { font-size: 24px; letter-spacing: .3em; font-weight: 700; font-variant-numeric: tabular-nums; height: 56px; text-align: center; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit span { position: absolute; right: 13px; color: var(--ink-3); font-weight: 400; pointer-events: none; }
.input-unit input { padding-right: 56px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0 0; }
.inline-form .field { flex: 1 1 240px; }
.inline-form .field:has(.code-input) { flex: 0 1 230px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; }
.field.narrow { max-width: 190px; margin-top: 14px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.more-line { margin: 12px 0 0; }

/* choices, stepper, switch (connection limits) */
.choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.choices legend { font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; cursor: pointer; border: 1.5px solid var(--line-strong); background: var(--paper); transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--sky-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--sky); outline-offset: 2px; }
.choice > input[type=radio] { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px; margin: 1px 0 0; padding: 0; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); display: grid; place-items: center; }
.choice > input[type=radio]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .15s; }
.choice > input[type=radio]:checked { border-color: var(--blue); }
.choice > input[type=radio]:checked::after { transform: scale(1); }
.choice-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-body strong { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-body > span { color: var(--ink-3); font-size: 13px; }
.choice-body .limit-row { margin-top: 8px; color: var(--ink-2); }
.tag { font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.limit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.limit-unit { color: var(--ink-2); font-weight: 450; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--paper); padding: 3px; }
.stepper input { width: 56px; height: 34px; border: 0; padding: 0; text-align: center; font-size: 16px; font-weight: 800; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 25%, transparent); }
.step-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--hover); color: var(--ink); }
.step-btn:hover { background: var(--sky-soft); color: var(--blue); }
.stepper.is-off { opacity: .45; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; color: var(--ink-2); font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 51, .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--ok-ring); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--sky); outline-offset: 2px; }
.limit-form { gap: 20px; }
.setting-body .limit-form { margin-top: 22px; }
.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.setting-note { color: var(--ink-2); margin: 16px 0 18px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0 14px; }
.danger-link { color: var(--bad) !important; }
.dialog-wide { width: min(560px, calc(100vw - 32px)); }
.conn { display: inline-grid; grid-template-columns: auto; row-gap: 2px; align-items: center; padding: 6px 10px; margin: -6px -10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.conn:hover { background: var(--hover); }
.meter-conn { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.pips { display: inline-flex; gap: 4px; align-items: center; }
.pips i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.pips i.on { background: var(--blue); }
.pips i.over { background: var(--alarm); }
.pips b { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.conn-inf { width: 20px; height: 20px; color: var(--blue); }
.conn-text { font-weight: 650; font-variant-numeric: tabular-nums; }
.conn-src { font-size: 12px; color: var(--ink-3); }
.conn-src.is-custom { color: var(--ok); font-weight: 650; }

/* ---------- bulk ---------- */
.bulk-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; }
.bulk-grid > * { min-width: 0; }
.bulk-options { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.preview { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--sky-soft); }
.preview-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.preview-names { font-weight: 700; word-break: break-word; }
.meter { display: block; width: 130px; height: 8px; border-radius: 8px; background: var(--hover); overflow: hidden; margin-bottom: 5px; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--ok-ring); border-radius: 8px; }

/* ---------- stats, bars, key/values ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats > div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > div:nth-child(2n) { border-right: 0; }
.stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.stats dt { color: var(--ink-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 4px 0 0; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats.wide { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; background: var(--paper); box-shadow: var(--shadow); border-radius: var(--r-card); }
.stats.wide > div { border-bottom: 0; }
.stats.wide > div:nth-child(2n) { border-right: 1px solid var(--line); }
.stats.wide > div:last-child { border-right: 0; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 44px; gap: 12px; align-items: center; }
.bar-label { color: var(--ink-2); font-size: 13.5px; }
.bar-track { height: 10px; border-radius: 10px; background: var(--hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 10px; transition: width .6s ease-out; }
.b-ok { background: var(--ok-ring); } .b-warn { background: var(--warn-line); } .b-bad { background: var(--alarm); } .b-muted { background: var(--ink-3); }
.bar-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 9px 22px; margin: 16px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.compact { margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border-bottom: 0; }
.empty-state { display: flex; align-items: center; gap: 14px; padding: 8px 0; color: var(--ink-2); }
.empty-state p { margin: 0; }
.empty-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-ring); color: #fff; flex: none; }

/* ---------- settings ---------- */
.setting { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 6px 0 26px; scroll-margin-top: 84px; }
.setting-intro { padding-top: 20px; }
.setting-intro p { color: var(--ink-3); margin: 8px 0 0; font-size: 13.5px; }
.setting-body { margin-bottom: 0; }
.status-line { display: flex; align-items: center; gap: 14px; }
.status-line strong { font-size: 15.5px; }
.status-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--ink-3); flex: none; }
.status-icon.ok { background: var(--ok-ring); color: #fff; }
.status-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* 2FA */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 5px 0 26px 54px; }
.steps > li:last-child { padding-bottom: 4px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 15px; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line-strong); }
.qr-row { display: flex; gap: 28px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.qr { width: 200px; height: 200px; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--line); flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg path { fill: #0F1733; }
.secret { font-size: 18px; font-weight: 750; letter-spacing: .08em; margin: 6px 0 12px; word-break: break-all; font-family: var(--mono); }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 210px)); gap: 10px 22px; }
.codes li { font: 700 17px/1.4 var(--mono); letter-spacing: .04em; padding: 10px 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; text-align: center; }

/* ---------- banners (flash messages) and notices ---------- */
.toasts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.toast { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 12px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok-line) 35%, transparent); border-left: 4px solid var(--ok-line); color: var(--ink); animation: toast-in .25s ease-out; }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-ring); color: #fff; flex: none; }
.toast-icon .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.toast-text { flex: 1; font-weight: 550; }
.toast-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad-line) 40%, transparent); border-left-color: var(--bad-line); }
.toast-error .toast-icon { background: var(--bad); }
.toast-close { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 6px; }
.toast-close:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
.auth-wrap .toasts { width: min(440px, 100%); margin: 0; }
.notice { padding: 13px 16px; border-radius: 12px; background: var(--warn-soft); border-left: 4px solid var(--warn-line); color: var(--ink); margin: 0 0 18px; font-size: 13.5px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice-error { background: var(--bad-soft); border-left-color: var(--bad-line); color: var(--bad); }
.alert { display: flex; gap: 14px; padding: 16px 20px; margin-bottom: 18px; border-radius: var(--r-card); background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); }
.alert .icon { width: 22px; height: 22px; margin-top: 1px; }
.alert strong { display: block; font-size: 15px; margin-bottom: 4px; }
.alert ul { margin: 0 0 6px; padding-left: 18px; }
.alert p { margin: 0; font-size: 13.5px; }

/* ---------- dialogs ---------- */
.dialog { border: 0; padding: 0; border-radius: 16px; width: min(480px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
.dialog::backdrop { background: rgba(15, 25, 60, .5); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 26px; margin: 0; }
.dialog-title { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; }
.dialog-text { margin: -6px 0 0; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- gradient banner card (portal "New Plan" style) ---------- */
.gbanner { display: flex; align-items: center; gap: 22px; padding: 22px 26px; border-radius: 18px; margin-bottom: 18px; color: #fff; background: linear-gradient(100deg, #1E3F94 0%, #2463C7 55%, #43A3E3 100%); box-shadow: 0 6px 22px rgba(30, 63, 148, .22); }
[data-theme="dark"] .gbanner { background: linear-gradient(100deg, #132C70 0%, #1D4FA8 55%, #2F86C6 100%); }
.gbanner-logo { height: 72px; width: 72px; flex: none; }
.gbanner-main { flex: 1; min-width: 0; }
.gbanner-count { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gbanner-number { font-size: 46px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.gbanner-label { font-size: 17px; font-weight: 650; }
.gbanner-meta { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 8px; color: rgba(255, 255, 255, .88); font-size: 13.5px; }
.gbanner-meta span { display: inline-flex; align-items: center; gap: 7px; }
.gbanner .page-actions { flex: none; }

/* ---------- ring gauges (portal KPI cards) ---------- */
.rings { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.ring-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-card); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.ring-card.is-alarm { border-color: var(--bad-line); box-shadow: 0 0 0 3px var(--bad-soft), var(--shadow); }
.ring { width: 66px; height: 66px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-bg { stroke: var(--grid); }
.ring .ring-fg { stroke: var(--ok-ring); stroke-linecap: round; transition: stroke-dashoffset .6s ease-out, stroke .3s; }
.ring-card.is-alarm .ring-fg { stroke: var(--alarm); }
.ring-text { display: flex; flex-direction: column; min-width: 0; }
.ring-label { font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.ring-value { font-size: 24px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }

/* ---------- charts (portal style) ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.charts .sheet { margin-bottom: 0; }
.chart-card { padding-bottom: 16px; }
.chart-meta { font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .alarm-band { fill: var(--bad-soft); opacity: .7; }
.chart .alarm-line { stroke: var(--alarm); stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .s1 { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; }
.chart .s2 { fill: none; stroke: var(--c2); stroke-width: 2; stroke-linejoin: round; }
.chart .f1 { fill: var(--c1-fill); }
.chart .f2 { fill: var(--c2-fill); }
.chart .nodata { fill: var(--ink-3); font-size: 13px; font-family: var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend i.k1 { background: var(--c1); } .legend i.k2 { background: var(--c2); }
.legend i.ka { background: repeating-linear-gradient(90deg, var(--alarm) 0 4px, transparent 4px 7px); }
.chart-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
.range-tabs { margin-left: auto; }
.range-tabs .seg { height: 34px; }
.charts-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.charts-head h2 { margin: 0; font-size: 17px; font-weight: 800; }

/* ---------- help ---------- */
.help-head { align-items: flex-start; }
.help-head-text { width: 100%; max-width: 780px; }
.help-search { position: relative; display: flex; align-items: center; margin-top: 16px; }
.help-search .icon { position: absolute; left: 18px; width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.help-search input { height: 54px; padding: 0 110px 0 50px; font-size: 16px; border-radius: 12px; box-shadow: var(--shadow); }
.help-search input::-webkit-search-cancel-button { margin-right: 4px; }
.help-count { position: absolute; right: 44px; font-size: 13px; color: var(--ink-3); font-weight: 650; pointer-events: none; }
.help-suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.suggest-chip { padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 650; text-decoration: none; color: var(--blue); background: var(--sky-soft); }
.suggest-chip:hover { background: color-mix(in srgb, var(--sky) 25%, var(--paper)); }
.help-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.help-nav { position: sticky; top: 84px; padding: 16px 14px; max-height: calc(100vh - 104px); overflow: auto; }
.help-nav-group { margin: 14px 8px 6px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.help-nav-group:first-child { margin-top: 0; }
.help-nav ul { list-style: none; margin: 0; padding: 0; }
.help-nav a { display: block; padding: 6px 8px; border-radius: 8px; text-decoration: none; font-size: 13.5px; color: var(--ink-2); }
.help-nav a:hover { background: var(--hover); color: var(--ink); }
.help-nav a.is-dim { opacity: .35; }
.help-group-title { font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 4px 4px 10px; }
.help-group + .help-group .help-group-title { margin-top: 18px; }
.topic { scroll-margin-top: 84px; margin-bottom: 14px; }
.topic.is-flash { animation: topic-flash 1.6s ease-out; }
@keyframes topic-flash { 0% { box-shadow: 0 0 0 4px var(--sky); } 100% { box-shadow: var(--shadow); } }
.topic-title { margin: 0; font-size: 17px; font-weight: 800; }
.topic-summary { margin: 4px 0 14px; color: var(--ink-3); }
.topic-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 9px; }
.topic-steps li { counter-increment: s; position: relative; padding-left: 36px; color: var(--ink-2); max-width: 78ch; }
.topic-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--sky-soft); color: var(--blue); }
.topic-example { margin-top: 16px; border-radius: 12px; background: #0F1F4D; color: #DCE6FF; overflow: hidden; }
.example-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9FB3E6; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.example-head .link-btn { color: #8FD3F2 !important; display: inline-flex; align-items: center; gap: 5px; padding: 0; text-transform: none; letter-spacing: 0; }
.topic-example pre { margin: 0; padding: 12px 14px 14px; font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.topic-tip { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 11px 14px; border-radius: 10px; background: var(--ok-soft); color: var(--ink-2); font-size: 13.5px; }
.topic-tip .icon { color: var(--ok); margin-top: 3px; }
.cli-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cli-list li { display: grid; grid-template-columns: 220px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cli-list li:last-child { border-bottom: 0; }
.cli-label { color: var(--ink-2); font-weight: 650; font-size: 13.5px; }
.cli-list code { font: 13px/1.5 var(--mono); background: var(--paper-2); border: 1px solid var(--line); padding: 5px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.is-copied { color: var(--ok) !important; }
.help-link { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-3); vertical-align: -3px; margin-left: 6px; text-decoration: none; }
.help-link:hover { color: var(--blue); background: var(--sky-soft); }
.help-link .icon { width: 17px; height: 17px; }
.help-fab { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px 12px 14px; border-radius: 999px; background: var(--navy); color: #fff; text-decoration: none; font-weight: 750; box-shadow: 0 8px 24px rgba(30, 63, 148, .35); }
.help-fab .icon { width: 22px; height: 22px; background: #fff; color: var(--navy); border-radius: 50%; padding: 2px; stroke-width: 2.2; }
.help-fab:hover { background: var(--navy-hover); }
[data-theme="dark"] .help-fab { color: #0B1430; }

/* ---------- footer ---------- */
.site-foot { background: var(--paper); border-top: 1px solid var(--line); }
.site-foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; font-size: 13px; color: var(--ink-3); }
.foot-left { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink-2); }
.foot-logo { height: 28px; width: 28px; }
.foot-logo.logo-on-dark { display: none; }
:root[data-theme="dark"] .foot-logo.logo-on-light { display: none; }
:root[data-theme="dark"] .foot-logo.logo-on-dark { display: block; }
.foot-right { display: inline-flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-right: 110px; }
.foot-right a { color: var(--ink-3); text-decoration: none; }
.foot-right a:hover { color: var(--blue); }
.foot-brand { font-weight: 700; color: var(--ink-2); }
.foot-brand em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: var(--blue); margin-left: 4px; }

/* ---------- sign-in ---------- */
body.auth { background: var(--bar-1); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 20px; color: #fff; background: radial-gradient(900px 500px at 85% 0%, rgba(67, 163, 227, .35), transparent 70%), linear-gradient(135deg, var(--bar-1) 0%, #1E4BAA 55%, var(--bar-2) 100%); }
.auth-wrap.single { color: var(--ink); background: var(--bg); }
.auth-brand { display: flex; align-items: center; gap: 18px; }
.auth-brand .brand-text { line-height: 1; }
.auth-name { display: block; font-family: var(--wordmark); font-size: 38px; line-height: 1; font-weight: 900; letter-spacing: .02em; color: #fff; }
.auth-name b { font-weight: 900; color: #8FD3F2; }
.auth-rule { display: block; height: 1px; margin: 12px 0 8px; background: rgba(143, 211, 242, .7); }
.auth-tag { display: block; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 18px; color: #fff; }
.auth-panel { width: min(420px, 100%); background: var(--paper); color: var(--ink); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-pop); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .muted { margin: -8px 0 4px; }
.auth-title { margin: 0; font-size: 24px; font-weight: 800; }
.auth-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-soft); color: var(--blue); }
.auth-icon .icon { width: 22px; height: 22px; }
.auth-form .link-btn { align-self: center; }
.auth-foot { margin: 0; color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.error-sheet { max-width: 580px; padding: 36px; }
.error-code { margin: 0 0 6px; font-size: 60px; line-height: 1; font-weight: 800; color: var(--sky); }
.error-sheet .page-title { color: var(--ink); }
.error-sheet .btn { margin-top: 12px; }

/* kpi tiles (kept for other pages) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-card); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; min-width: 0; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.t-mint { background: var(--t1); color: var(--t1i); } .t-blue { background: var(--t2); color: var(--t2i); }
.t-amber { background: var(--t3); color: var(--t3i); } .t-violet { background: var(--t4); color: var(--t4i); }
.kpi-text { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 24px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--ink-3); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .rings { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) {
  .charts { grid-template-columns: 1fr; }
  .bulk-grid { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; gap: 12px; }
  .setting-intro { padding-top: 0; }
}
@media (max-width: 960px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-nav { display: none; }
  .cli-list li { grid-template-columns: 1fr auto; }
  .cli-label { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .topbar-inner { height: auto; padding: 10px 16px 0; flex-wrap: wrap; gap: 10px 14px; }
  .nav { order: 3; flex: 1 1 100%; width: 100%; padding-bottom: 10px; }
  .topbar-tools { margin-left: auto; }
  .live-chip #pill-state { display: none; }
  .page-title { font-size: 24px; }
  .page-actions { width: 100%; }
  .gbanner { flex-wrap: wrap; padding: 20px; }
  .gbanner-logo { display: none; }
  .gbanner .page-actions { width: 100%; }
  .rings { grid-template-columns: repeat(2, 1fr); }
  .split, .row-2, .row-3 { grid-template-columns: 1fr; }
  .sheet { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .toolbar .segmented { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .stats.wide { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .auth-panel { padding: 24px; }
  .auth-name { font-size: 30px; }
  .foot-right { padding-right: 0; }
  .help-fab { right: 14px; bottom: 14px; padding: 10px 16px 10px 12px; }
  .site-foot { padding-bottom: 60px; }
}
@media (max-width: 520px) {
  .rings { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ring-card { padding: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* Busy state: spinner inside the button that was pressed, or a floating "Working…" pill */
.spinner { display: inline-block; width: 1.05em; height: 1.05em; flex: none; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; opacity: .9; animation: spin .75s linear infinite; vertical-align: -0.15em; }
.btn.is-busy { cursor: default; justify-content: center; gap: 8px; }
.btn.is-busy:disabled { opacity: 1; }
.btn-primary.is-busy { filter: saturate(.85) brightness(1.08); }
.busy-pill { position: fixed; z-index: 1000; top: 78px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; background: var(--navy, #1E3F94); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(10, 25, 70, .28); animation: toast-in .15s ease-out; }
.busy-pill[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

/* Batch page: selection bar + revoked list */
.stats.wide.stats-5 { grid-template-columns: repeat(5, 1fr); }
.batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.batch-bar-count { color: var(--ink-3); font-size: 14px; }
.batch-bar.has-selection .batch-bar-count { color: var(--ink); }
.batch-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-col { width: 1%; padding-right: 0 !important; }
.check-col input { width: 18px; height: 18px; accent-color: var(--navy, #1E3F94); cursor: pointer; vertical-align: middle; }
tr.is-selected td { background: var(--hover); }
@media (max-width: 760px) { .stats.wide.stats-5 { grid-template-columns: repeat(2, 1fr); } }

.actions-col { vertical-align: middle; }
.actions-col .btn + .btn, .actions-col .btn + form, .actions-col form + .btn { margin-left: 6px; }
.batch-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 0; }
.check-col input:disabled { cursor: default; opacity: .35; }

.menu-list.is-floating { position: fixed; right: auto; z-index: 900; max-height: calc(100vh - 16px); overflow-y: auto; }

/* Multi-select: checkboxes + contextual action bar above the table */
.sel-box { width: 18px; height: 18px; margin: 0; accent-color: var(--navy, #1E3F94); cursor: pointer; vertical-align: middle; }
.sel-box:disabled { cursor: default; opacity: .35; }
[data-theme="dark"] .sel-box { accent-color: #5B8DEF; }
th.check-col, td.check-col { width: 44px; padding-right: 0 !important; }
tr.is-selected > td { background: color-mix(in srgb, var(--blue) 9%, transparent); }
.selbar { margin: 20px 0 18px; }
.selbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 14px; flex-wrap: wrap;
  padding: 14px 16px 14px 20px; border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 7%, var(--paper)); border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  transition: background-color .15s, border-color .15s; }
.selbar.is-empty .selbar-inner { background: color-mix(in srgb, var(--ink-3) 4%, var(--paper)); border-color: var(--line); }
.selbar-count { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; min-height: 32px; flex: none; }
.selbar-count strong { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; transition: background-color .15s; }
.selbar.is-empty .selbar-count strong { background: var(--hover); color: var(--ink-3); }
[data-theme="dark"] .selbar:not(.is-empty) .selbar-count strong { background: #5B8DEF; color: #0B1430; }
.selbar-hint { color: var(--ink-3); }
.selbar-hint[hidden], .selbar-count .link-btn[hidden] { display: none; }
.selbar-count .link-btn { margin-left: 2px; }
.selbar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.selbar-actions .btn { background: var(--paper); padding: 0 10px; gap: 6px; font-size: 13px; height: 34px; }
.selbar-actions .btn .icon { width: 15px; height: 15px; }
.selbar-actions .btn[disabled] { opacity: .45; }
.selbar-actions .sep { width: 1px; align-self: stretch; margin: 4px 3px; background: var(--line); }
@media (max-width: 760px) {
  .selbar { margin: 16px 0 14px; }
  .selbar-inner { padding: 12px; }
  .selbar-actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 2px; }
  .selbar-actions .btn span { white-space: nowrap; }
}

/* Administrators */
.who-text { display: inline-flex; flex-direction: column; gap: 2px; }
.who-text .sub { margin: 0; }
.you-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--hover); color: var(--ink-2); vertical-align: 1px; }
.chip-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip .icon { width: 14px; height: 14px; }
.page-note { margin: 4px 2px 0; }
.cred-card { max-width: 720px; }
.cred-list { margin: 0 0 16px; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cred-list > div { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.cred-list > div:first-child { border-top: 0; }
.cred-list dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cred-list dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.cred-list code { font-size: 14px; word-break: break-all; }
.cred-list code.big { font-size: 20px; font-weight: 800; letter-spacing: .04em; }
.narrow-card { max-width: 560px; }
@media (max-width: 760px) { .cred-list > div { grid-template-columns: 1fr; gap: 6px; } }

/* Thin progress bar while the next page loads */
.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none;
  background: linear-gradient(90deg, #8FD3F5, #43A3E3); box-shadow: 0 0 8px rgba(67, 163, 227, .7); opacity: 0; }
.page-progress.run { opacity: 1; animation: page-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes page-progress { 0% { width: 0; } 20% { width: 45%; } 100% { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .page-progress.run { animation-duration: 0s; width: 60%; } }

/* Small refinements */
.table td, .table th { font-variant-numeric: tabular-nums; }
.btn:active:not([disabled]) { transform: translateY(1px); }
::selection { background: color-mix(in srgb, var(--sky) 35%, transparent); }

/* ---------- access rules ---------- */
.seg:has(input:checked) { background: var(--navy); color: #fff; }
[data-theme="dark"] .seg:has(input:checked) { color: #0B1430; }
.seg-sm .seg { height: 32px; padding: 0 12px; font-size: 13px; }
.dialog-rules, #dlg-rules, #dlg-sel-rules { width: min(640px, calc(100vw - 32px)); }
.rules-form { gap: 14px; }
.rule-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.rule-title { margin: 0; font-size: 14.5px; font-weight: 750; display: flex; align-items: center; gap: 7px; }
.rule-title .icon { width: 17px; height: 17px; color: var(--blue); }
.rule-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); }
.rule-sub a { color: var(--blue); }
.rule-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 14px 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.rule-sec:not(.is-set) .rule-body { display: none; }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.group-label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.hour-rows { display: flex; flex-direction: column; gap: 8px; }
.hour-rows:empty { display: none; }
.hour-row { display: flex; align-items: center; gap: 10px; }
.hour-row input[type=time] { width: 130px; flex: none; font-variant-numeric: tabular-nums; }
.link-btn .icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; }
.field-group > .link-btn { align-self: flex-start; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.pill span { display: inline-grid; place-items: center; min-width: 46px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 13px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: background .12s, color .12s, border-color .12s; }
.pill:hover span { border-color: var(--ink-3); }
.pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .pill input:checked + span { color: #0B1430; }
.pill input:focus-visible + span { outline: 2px solid var(--sky); outline-offset: 1px; }
.pills-month { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.pills-month .pill span { min-width: 0; width: 100%; padding: 0; }
.pills-month .pill-wide { grid-column: span 1; }
.pills-month .pill-wide span { font-size: 11.5px; }
.hint .link-btn { font-size: 12.5px; padding: 0 0 0 6px; }
.cc-picker { display: flex; flex-direction: column; gap: 10px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chips:empty { display: none; }
.cc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 4px 4px 9px; border-radius: 999px; background: var(--sky-soft); color: var(--ink); font-size: 13px; font-weight: 650; }
.cc-chip button { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; }
.cc-chip button:hover { background: var(--paper); color: var(--bad); }
.cc-chip .icon { width: 13px; height: 13px; }
.notice-warn.small { margin: 0; font-size: 12.5px; }
.mr-auto { margin-right: auto; }
.chip-rule { border: 0; cursor: pointer; background: var(--sky-soft); color: var(--blue); margin-left: 4px; padding: 3px 10px 3px 8px; }
.chip-rule .icon { width: 13px; height: 13px; }
.chip-rule:hover { filter: brightness(.96); }
.chip-rule.is-closed { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 560px) {
  .rule-head .segmented { width: 100%; }
  .rule-head .seg { flex: 1; justify-content: center; }
  .hour-row { gap: 6px; }
  .hour-row input[type=time] { width: auto; flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .hour-row .icon-btn { width: 32px; flex: none; }
  .hour-row input[type=time]::-webkit-calendar-picker-indicator { display: none; }
  .rules-form .dialog-actions { flex-wrap: wrap; }
  .rules-form .dialog-actions .mr-auto { order: 3; width: 100%; margin: 0; }
}
#access .stack-form { margin-top: 16px; }

/* ---------- country flags ---------- */
/* Country flags: flag-icons by Panayiotis Lipiridis, MIT licence. Sprite of 20x15 px flags (2x). */
.flag{display:inline-block;width:20px;height:15px;flex:none;border-radius:2px;background:url(flags.png) 0 0/320px 240px no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.flag-ad{background-position:-0px -0px}
.flag-ae{background-position:-20px -0px}
.flag-af{background-position:-40px -0px}
.flag-ag{background-position:-60px -0px}
.flag-ai{background-position:-80px -0px}
.flag-al{background-position:-100px -0px}
.flag-am{background-position:-120px -0px}
.flag-ao{background-position:-140px -0px}
.flag-aq{background-position:-160px -0px}
.flag-ar{background-position:-180px -0px}
.flag-as{background-position:-200px -0px}
.flag-at{background-position:-220px -0px}
.flag-au{background-position:-240px -0px}
.flag-aw{background-position:-260px -0px}
.flag-ax{background-position:-280px -0px}
.flag-az{background-position:-300px -0px}
.flag-ba{background-position:-0px -15px}
.flag-bb{background-position:-20px -15px}
.flag-bd{background-position:-40px -15px}
.flag-be{background-position:-60px -15px}
.flag-bf{background-position:-80px -15px}
.flag-bg{background-position:-100px -15px}
.flag-bh{background-position:-120px -15px}
.flag-bi{background-position:-140px -15px}
.flag-bj{background-position:-160px -15px}
.flag-bl{background-position:-180px -15px}
.flag-bm{background-position:-200px -15px}
.flag-bn{background-position:-220px -15px}
.flag-bo{background-position:-240px -15px}
.flag-bq{background-position:-260px -15px}
.flag-br{background-position:-280px -15px}
.flag-bs{background-position:-300px -15px}
.flag-bt{background-position:-0px -30px}
.flag-bv{background-position:-20px -30px}
.flag-bw{background-position:-40px -30px}
.flag-by{background-position:-60px -30px}
.flag-bz{background-position:-80px -30px}
.flag-ca{background-position:-100px -30px}
.flag-cc{background-position:-120px -30px}
.flag-cd{background-position:-140px -30px}
.flag-cf{background-position:-160px -30px}
.flag-cg{background-position:-180px -30px}
.flag-ch{background-position:-200px -30px}
.flag-ci{background-position:-220px -30px}
.flag-ck{background-position:-240px -30px}
.flag-cl{background-position:-260px -30px}
.flag-cm{background-position:-280px -30px}
.flag-cn{background-position:-300px -30px}
.flag-co{background-position:-0px -45px}
.flag-cr{background-position:-20px -45px}
.flag-cu{background-position:-40px -45px}
.flag-cv{background-position:-60px -45px}
.flag-cw{background-position:-80px -45px}
.flag-cx{background-position:-100px -45px}
.flag-cy{background-position:-120px -45px}
.flag-cz{background-position:-140px -45px}
.flag-de{background-position:-160px -45px}
.flag-dj{background-position:-180px -45px}
.flag-dk{background-position:-200px -45px}
.flag-dm{background-position:-220px -45px}
.flag-do{background-position:-240px -45px}
.flag-dz{background-position:-260px -45px}
.flag-ec{background-position:-280px -45px}
.flag-ee{background-position:-300px -45px}
.flag-eg{background-position:-0px -60px}
.flag-eh{background-position:-20px -60px}
.flag-er{background-position:-40px -60px}
.flag-es{background-position:-60px -60px}
.flag-et{background-position:-80px -60px}
.flag-fi{background-position:-100px -60px}
.flag-fj{background-position:-120px -60px}
.flag-fk{background-position:-140px -60px}
.flag-fm{background-position:-160px -60px}
.flag-fo{background-position:-180px -60px}
.flag-fr{background-position:-200px -60px}
.flag-ga{background-position:-220px -60px}
.flag-gb{background-position:-240px -60px}
.flag-gd{background-position:-260px -60px}
.flag-ge{background-position:-280px -60px}
.flag-gf{background-position:-300px -60px}
.flag-gg{background-position:-0px -75px}
.flag-gh{background-position:-20px -75px}
.flag-gi{background-position:-40px -75px}
.flag-gl{background-position:-60px -75px}
.flag-gm{background-position:-80px -75px}
.flag-gn{background-position:-100px -75px}
.flag-gp{background-position:-120px -75px}
.flag-gq{background-position:-140px -75px}
.flag-gr{background-position:-160px -75px}
.flag-gs{background-position:-180px -75px}
.flag-gt{background-position:-200px -75px}
.flag-gu{background-position:-220px -75px}
.flag-gw{background-position:-240px -75px}
.flag-gy{background-position:-260px -75px}
.flag-hk{background-position:-280px -75px}
.flag-hm{background-position:-300px -75px}
.flag-hn{background-position:-0px -90px}
.flag-hr{background-position:-20px -90px}
.flag-ht{background-position:-40px -90px}
.flag-hu{background-position:-60px -90px}
.flag-id{background-position:-80px -90px}
.flag-ie{background-position:-100px -90px}
.flag-il{background-position:-120px -90px}
.flag-im{background-position:-140px -90px}
.flag-in{background-position:-160px -90px}
.flag-io{background-position:-180px -90px}
.flag-iq{background-position:-200px -90px}
.flag-ir{background-position:-220px -90px}
.flag-is{background-position:-240px -90px}
.flag-it{background-position:-260px -90px}
.flag-je{background-position:-280px -90px}
.flag-jm{background-position:-300px -90px}
.flag-jo{background-position:-0px -105px}
.flag-jp{background-position:-20px -105px}
.flag-ke{background-position:-40px -105px}
.flag-kg{background-position:-60px -105px}
.flag-kh{background-position:-80px -105px}
.flag-ki{background-position:-100px -105px}
.flag-km{background-position:-120px -105px}
.flag-kn{background-position:-140px -105px}
.flag-kp{background-position:-160px -105px}
.flag-kr{background-position:-180px -105px}
.flag-kw{background-position:-200px -105px}
.flag-ky{background-position:-220px -105px}
.flag-kz{background-position:-240px -105px}
.flag-la{background-position:-260px -105px}
.flag-lb{background-position:-280px -105px}
.flag-lc{background-position:-300px -105px}
.flag-li{background-position:-0px -120px}
.flag-lk{background-position:-20px -120px}
.flag-lr{background-position:-40px -120px}
.flag-ls{background-position:-60px -120px}
.flag-lt{background-position:-80px -120px}
.flag-lu{background-position:-100px -120px}
.flag-lv{background-position:-120px -120px}
.flag-ly{background-position:-140px -120px}
.flag-ma{background-position:-160px -120px}
.flag-mc{background-position:-180px -120px}
.flag-md{background-position:-200px -120px}
.flag-me{background-position:-220px -120px}
.flag-mf{background-position:-240px -120px}
.flag-mg{background-position:-260px -120px}
.flag-mh{background-position:-280px -120px}
.flag-mk{background-position:-300px -120px}
.flag-ml{background-position:-0px -135px}
.flag-mm{background-position:-20px -135px}
.flag-mn{background-position:-40px -135px}
.flag-mo{background-position:-60px -135px}
.flag-mp{background-position:-80px -135px}
.flag-mq{background-position:-100px -135px}
.flag-mr{background-position:-120px -135px}
.flag-ms{background-position:-140px -135px}
.flag-mt{background-position:-160px -135px}
.flag-mu{background-position:-180px -135px}
.flag-mv{background-position:-200px -135px}
.flag-mw{background-position:-220px -135px}
.flag-mx{background-position:-240px -135px}
.flag-my{background-position:-260px -135px}
.flag-mz{background-position:-280px -135px}
.flag-na{background-position:-300px -135px}
.flag-nc{background-position:-0px -150px}
.flag-ne{background-position:-20px -150px}
.flag-nf{background-position:-40px -150px}
.flag-ng{background-position:-60px -150px}
.flag-ni{background-position:-80px -150px}
.flag-nl{background-position:-100px -150px}
.flag-no{background-position:-120px -150px}
.flag-np{background-position:-140px -150px}
.flag-nr{background-position:-160px -150px}
.flag-nu{background-position:-180px -150px}
.flag-nz{background-position:-200px -150px}
.flag-om{background-position:-220px -150px}
.flag-pa{background-position:-240px -150px}
.flag-pe{background-position:-260px -150px}
.flag-pf{background-position:-280px -150px}
.flag-pg{background-position:-300px -150px}
.flag-ph{background-position:-0px -165px}
.flag-pk{background-position:-20px -165px}
.flag-pl{background-position:-40px -165px}
.flag-pm{background-position:-60px -165px}
.flag-pn{background-position:-80px -165px}
.flag-pr{background-position:-100px -165px}
.flag-ps{background-position:-120px -165px}
.flag-pt{background-position:-140px -165px}
.flag-pw{background-position:-160px -165px}
.flag-py{background-position:-180px -165px}
.flag-qa{background-position:-200px -165px}
.flag-re{background-position:-220px -165px}
.flag-ro{background-position:-240px -165px}
.flag-rs{background-position:-260px -165px}
.flag-ru{background-position:-280px -165px}
.flag-rw{background-position:-300px -165px}
.flag-sa{background-position:-0px -180px}
.flag-sb{background-position:-20px -180px}
.flag-sc{background-position:-40px -180px}
.flag-sd{background-position:-60px -180px}
.flag-se{background-position:-80px -180px}
.flag-sg{background-position:-100px -180px}
.flag-sh{background-position:-120px -180px}
.flag-si{background-position:-140px -180px}
.flag-sj{background-position:-160px -180px}
.flag-sk{background-position:-180px -180px}
.flag-sl{background-position:-200px -180px}
.flag-sm{background-position:-220px -180px}
.flag-sn{background-position:-240px -180px}
.flag-so{background-position:-260px -180px}
.flag-sr{background-position:-280px -180px}
.flag-ss{background-position:-300px -180px}
.flag-st{background-position:-0px -195px}
.flag-sv{background-position:-20px -195px}
.flag-sx{background-position:-40px -195px}
.flag-sy{background-position:-60px -195px}
.flag-sz{background-position:-80px -195px}
.flag-tc{background-position:-100px -195px}
.flag-td{background-position:-120px -195px}
.flag-tf{background-position:-140px -195px}
.flag-tg{background-position:-160px -195px}
.flag-th{background-position:-180px -195px}
.flag-tj{background-position:-200px -195px}
.flag-tk{background-position:-220px -195px}
.flag-tl{background-position:-240px -195px}
.flag-tm{background-position:-260px -195px}
.flag-tn{background-position:-280px -195px}
.flag-to{background-position:-300px -195px}
.flag-tr{background-position:-0px -210px}
.flag-tt{background-position:-20px -210px}
.flag-tv{background-position:-40px -210px}
.flag-tw{background-position:-60px -210px}
.flag-tz{background-position:-80px -210px}
.flag-ua{background-position:-100px -210px}
.flag-ug{background-position:-120px -210px}
.flag-um{background-position:-140px -210px}
.flag-us{background-position:-160px -210px}
.flag-uy{background-position:-180px -210px}
.flag-uz{background-position:-200px -210px}
.flag-va{background-position:-220px -210px}
.flag-vc{background-position:-240px -210px}
.flag-ve{background-position:-260px -210px}
.flag-vg{background-position:-280px -210px}
.flag-vi{background-position:-300px -210px}
.flag-vn{background-position:-0px -225px}
.flag-vu{background-position:-20px -225px}
.flag-wf{background-position:-40px -225px}
.flag-ws{background-position:-60px -225px}
.flag-ye{background-position:-80px -225px}
.flag-yt{background-position:-100px -225px}
.flag-za{background-position:-120px -225px}
.flag-zm{background-position:-140px -225px}
.flag-zw{background-position:-160px -225px}

/* ---------- country search combobox ---------- */
.combo { position: relative; }
.combo input[type=text] { width: 100%; height: 40px; padding: 0 40px 0 38px; }
.combo-lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; pointer-events: none; color: var(--ink-3); }
.combo-lead .icon { width: 17px; height: 17px; }
.combo-lead .flag { width: 20px; height: 15px; }
.combo-toggle { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; }
.combo-toggle:hover { background: var(--paper-2); color: var(--ink); }
.combo-toggle .icon { width: 17px; height: 17px; transition: transform .15s; }
.combo.is-open .combo-toggle .icon { transform: rotate(180deg); }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 264px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 14px 34px rgba(15, 32, 80, .18); }
.combo-list li[role=option] { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink); }
.combo-list li.is-active { background: var(--sky-soft); }
.combo-list li:hover { background: var(--paper-2); }
.combo-list li.is-active:hover { background: var(--sky-soft); }
.combo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-name mark { background: none; color: var(--blue); font-weight: 750; padding: 0; }
.combo-code { font-size: 12px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.combo-list li.is-picked::after { content: ""; width: 16px; height: 16px; flex: none; background: var(--blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.combo-list li.is-picked .combo-name { font-weight: 650; }
.combo-empty { padding: 10px 12px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- gateway, bandwidth & data ---------- */
.rule-sec[data-tsec="gw"] .rule-body { display: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-input { position: relative; display: block; }
.unit-input input { width: 100%; padding-right: 54px; font-variant-numeric: tabular-nums; }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 650; color: var(--ink-3); pointer-events: none; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--navy); }
.usage-line { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.usage-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-line .bar { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.usage-line .bar > i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.usage-line .bar > i.is-over { background: var(--bad); }
.chip-traffic { border: 0; cursor: pointer; background: var(--sky-soft); color: var(--blue); margin-left: 4px; padding: 3px 10px 3px 8px; }
.chip-traffic .icon { width: 13px; height: 13px; }
.chip-traffic.is-over { background: var(--bad-soft, #FBEBEB); color: var(--bad); }
.route-list { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }
.selbar-count .sel-clear { width: 28px; height: 28px; margin-left: 0; }
.selbar-count .sel-clear[hidden] { display: none; }
.selbar-count .sel-clear .icon { width: 15px; height: 15px; }
.field > .segmented { align-self: flex-start; width: auto; }
@media (max-width: 560px) { .rule-head .seg { white-space: nowrap; padding: 0 8px; } }
.combo-lead .flag[hidden], .flag[hidden] { display: none; }

/* ---------- sticky notice under the Settings menu item ---------- */
.nav-note { position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; width: min(340px, calc(100vw - 24px)); display: flex; align-items: flex-start;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 32, 80, .22); }
.nav-note[hidden] { display: none; }
.nav-note.pop { animation: notePop .35s ease-out; }
@keyframes notePop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-note-arrow { position: absolute; top: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--paper); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.nav-note-body { flex: 1; display: flex; gap: 11px; padding: 12px 4px 12px 13px; text-decoration: none; color: inherit; border-radius: 12px 0 0 12px; }
.nav-note-body:hover strong { color: var(--blue); }
.nav-note-icon { position: relative; flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-soft); color: var(--blue); }
.nav-note-icon::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 2px var(--paper); animation: notePulse 2s ease-in-out infinite; }
@keyframes notePulse { 50% { box-shadow: 0 0 0 2px var(--paper), 0 0 0 6px rgba(245, 158, 11, .25); } }
.nav-note-icon .icon { width: 18px; height: 18px; }
.nav-note-text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.nav-note-text strong { font-size: 13.5px; color: var(--ink); }
.nav-note-x { flex: none; margin: 6px 6px 0 0; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; }
.nav-note-x:hover { background: var(--paper-2); color: var(--ink); }
.nav-note-x .icon { width: 15px; height: 15px; }
.update-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, #F59E0B 40%, transparent); }
.update-banner strong { display: block; font-size: 14px; }
.update-banner span { font-size: 13px; color: var(--ink-2); }
.update-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #F59E0B; }
@media (prefers-reduced-motion: reduce) { .nav-note.pop, .nav-note-icon::after { animation: none; } }

/* ---------- Policies menu in the selection bar ---------- */
.policies-menu > summary { cursor: pointer; }
.policies-menu > summary .chev { width: 14px; height: 14px; margin-left: -2px; transition: transform .15s; }
.policies-menu[open] > summary .chev { transform: rotate(180deg); }
.policies-menu > summary.is-disabled { opacity: .5; cursor: default; }
.policies-menu .menu-list button:disabled { opacity: .45; cursor: default; }
/* ---------- per-profile routes ---------- */
.seg-3 { align-self: flex-start; }
.route-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.route-chip { padding: 4px 10px; border-radius: 7px; background: var(--paper); border: 1px solid var(--line); font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); }
.route-sec[data-mode="default"] .route-own { display: none; }
.route-sec[data-mode="only"] .route-chip { text-decoration: line-through; opacity: .55; }
.chip-route { border: 0; cursor: pointer; background: var(--sky-soft); color: var(--blue); margin-left: 4px; padding: 3px 10px 3px 8px; }
.chip-route .icon { width: 13px; height: 13px; }
@media (max-width: 560px) { .seg-3 { width: 100%; } .seg-3 .seg { flex: 1; justify-content: center; padding: 0 6px; font-size: 12.5px; } }
.who-link { color: inherit; text-decoration: none; border-radius: 4px; }
.who-link:hover strong, .who-link:focus-visible strong { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* ---------- profile page ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--blue); }
.profile-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 24px; flex-wrap: wrap; }
.profile-id { display: flex; gap: 18px; align-items: center; min-width: 0; }
.profile-id .page-title { margin: 0 0 8px; word-break: break-word; }
.profile-id .page-sub { margin: 8px 0 0; }
.tile-xl { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; box-shadow: 0 6px 18px rgba(15, 32, 80, .10); position: relative; }
.tile-xl.is-online::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--bg, #F3F6FB); }
.profile-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-chips .chip { display: inline-flex; align-items: center; gap: 5px; }
.profile-chips .chip .icon { width: 13px; height: 13px; }
.chip-live { background: var(--ok-soft); color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.chip-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .35; } }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-actions form { margin: 0; }
.profile-actions details.menu > summary { list-style: none; }
.lock-banner, .flag-banner { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border-radius: 14px; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.flag-banner { background: var(--warn-soft); border-color: color-mix(in srgb, #F59E0B 40%, transparent); }
.lock-banner > div, .flag-banner > div { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--ink-2); }
.lock-banner strong, .flag-banner strong { color: var(--ink); font-size: 14.5px; }
.lock-banner form { margin: 0; }
.lock-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--paper); color: var(--bad); }
.lock-icon.warn { color: #B45309; }
.lock-icon .icon { width: 19px; height: 19px; }
.tabs { display: flex; gap: 4px; margin: 4px 0 18px; padding: 4px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tab .icon { width: 16px; height: 16px; }
.tab:hover { background: var(--paper-2); color: var(--ink); }
.tab.is-on { background: var(--navy); color: #fff; box-shadow: 0 3px 10px rgba(16, 36, 94, .18); }
[data-theme="dark"] .tab.is-on { color: #0B1430; }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--bad); color: #fff; }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: panelIn .2s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 32, 80, .04); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.stat-label .icon { width: 15px; height: 15px; color: var(--blue); }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value small { font-size: 13px; font-weight: 650; color: var(--ink-3); letter-spacing: 0; }
.stat-place { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.stat-place .flag { transform: scale(1.4); transform-origin: left center; margin-right: 8px; }
.stat-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.stat-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 2px; }
.stat-bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.stat-bar i.is-warn { background: #F59E0B; }
.stat-bar i.is-over { background: var(--bad); }
.stat-alert { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 55%, var(--paper)); }
.stat-sm { padding: 14px 16px; }
.stat-sm .stat-value { font-size: 20px; }
.profile-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-bottom: 18px; }
.profile-cols .sheet { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 12px 16px; margin: 4px 0 0; font-size: 13.5px; }
.facts dt { color: var(--ink-3); font-weight: 650; }
.facts dd { margin: 0; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2); }
.pill-tag.tag-blue { background: var(--sky-soft); border-color: transparent; color: var(--blue); }
.place { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.flag-lan { display: inline-grid; place-items: center; width: 20px; height: 15px; border-radius: 3px; background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--line); }
.flag-lan .icon { width: 11px; height: 11px; }
.flag-unknown { display: inline-block; width: 20px; height: 15px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--line) 0 3px, transparent 3px 6px); }
.flags-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sessions-table tr.is-live td { background: color-mix(in srgb, var(--ok-soft) 50%, transparent); }
.reason { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.reason .icon { width: 14px; height: 14px; color: var(--bad); flex: none; }
.reason-lock .icon { color: var(--ink-3); }
tr.is-note td { color: var(--ink-3); }
.charts-2 { grid-template-columns: 1fr 1fr; }
.chart .bar1 { fill: var(--c1); }
.chart .bar2 { fill: var(--c2); }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.policy { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.policy-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sky-soft); color: var(--blue); }
.policy-icon .icon { width: 19px; height: 19px; }
.policy-text { flex: 1; min-width: 0; }
.policy-text h3 { margin: 0 0 5px; font-size: 15px; font-weight: 750; }
.policy-text p { margin: 0 0 5px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.policy form { margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px !important; }
.timeline { list-style: none; margin: 0; padding: 4px 0 0 4px; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--sky-soft); }
.timeline li.is-bad .tl-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.tl-body { display: flex; flex-direction: column; gap: 3px; font-size: 14px; min-width: 0; }
.tl-detail { color: var(--ink-2); overflow-wrap: anywhere; }
.tl-meta { font-size: 12.5px; color: var(--ink-3); }
.timeline li.empty { color: var(--ink-3); }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .profile-cols, .charts-2, .policy-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 19px; }
  .tile-xl { width: 52px; height: 52px; font-size: 18px; }
  .facts { grid-template-columns: 1fr; gap: 4px; }
  .facts dd { margin-bottom: 10px; }
  .lock-banner { flex-wrap: wrap; }
}

/* ---------- gateway check ---------- */
.gw-checks { flex-direction: column; align-items: stretch !important; gap: 8px !important; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.checklist li .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; padding: 2px; border-radius: 50%; }
.checklist li.ok .icon { color: var(--ok); background: var(--ok-soft); }
.checklist li.bad .icon { color: var(--bad); background: var(--bad-soft); }
.checklist li.bad > span { color: var(--ink); }
.checklist .fix { display: block; color: var(--ink-3); margin-top: 2px; }
.inline-fix { margin: 6px 0 0; }
.btn-icon { padding: 0 11px; }
.refresh-stamp { white-space: nowrap; }
@media (max-width: 560px) { .refresh-stamp { display: none; } }
.rc-choice { padding: 12px 14px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); margin: 4px 0 6px; }
.rc-choice strong { color: var(--ink); }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sky-soft); color: var(--blue); margin-bottom: 4px; }
.confirm-icon .icon { width: 22px; height: 22px; }
.refresh-stamp { display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: livePulse 1.8s ease-in-out infinite; }

/* ---------- sign-in: two panels (brand story | form) ---------- */
body.auth-v2 { background: var(--paper); }
.auth2 { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); }
.auth2-story { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 52px 64px 40px; color: #fff;
  background: radial-gradient(900px 600px at 100% 100%, rgba(67, 163, 227, .35), transparent 60%), linear-gradient(160deg, #142D73 0%, #1B3A8C 45%, #1F5FC4 100%); }
.auth2-grid { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 70%, transparent 100%); }
.auth2-arcs { position: absolute; right: -330px; bottom: -400px; width: 760px; height: 760px; pointer-events: none; }
.auth2-arcs i { position: absolute; inset: 0; border-radius: 50%; border: 54px solid rgba(255, 255, 255, .06); }
.auth2-arcs i:nth-child(2) { inset: 110px; border-width: 40px; border-color: rgba(67, 163, 227, .35); }
.auth2-arcs i:nth-child(3) { inset: 168px; border-width: 5px; border-color: rgba(220, 238, 252, .55); border-style: dotted; }
.auth2-brand { position: relative; display: flex; align-items: center; gap: 14px; }
.auth2-name { display: block; font-family: var(--wordmark); font-weight: 900; font-size: 21px; line-height: 1.05; letter-spacing: .04em; }
.auth2-name b { color: #8FD3F2; }
.auth2-rule { position: relative; display: block; width: 150px; height: 1px; margin: 14px 0 10px; background: rgba(143, 211, 242, .55); }
.auth2-tag { position: relative; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 17px; color: #E2ECFB; }
.auth2-pitch { position: relative; margin: auto 0; max-width: 540px; padding: 48px 0; }
.auth2-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(143, 211, 242, .4); background: rgba(255, 255, 255, .06);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; color: #CFE6FB; }
.auth2-badge i { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.auth2-pitch h2 { margin: 22px 0 14px; font-family: var(--wordmark); font-weight: 900; font-size: clamp(30px, 3vw, 40px); line-height: 1.14; letter-spacing: -.005em; }
.auth2-pitch h2 span { color: #8FD3F2; }
.auth2-pitch p { margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: #DCE7FA; }
.auth2-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.auth2-pitch li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: #E7EFFC; }
.auth2-pitch li strong { color: #fff; }
.auth2-pitch li .icon { flex: none; width: 22px; height: 22px; margin-top: 0; padding: 4px; border-radius: 50%; border: 1.5px solid rgba(143, 211, 242, .7); color: #fff; }
.auth2-foot { position: relative; display: flex; gap: 22px; font-size: 13px; color: #BFD3F3; }
.auth2-main { position: relative; display: grid; place-items: center; padding: 48px 32px;
  background: radial-gradient(700px 420px at 100% 0%, rgba(143, 211, 242, .18), transparent 70%), var(--paper); }
.auth2-card { width: min(440px, 100%); display: flex; flex-direction: column; }
.auth2-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.auth2-logo-text { display: flex; flex-direction: column; gap: 6px; }
.auth2-logo-name { font-family: var(--wordmark); font-weight: 900; font-size: 22px; letter-spacing: .04em; color: var(--navy); line-height: 1; }
.auth2-logo-name b { color: var(--blue); }
.auth2-logo-tag { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 13px; color: var(--blue); }
.auth2-form { display: flex; flex-direction: column; gap: 18px; }
.auth2-form h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.auth2-sub { margin: -10px 0 4px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.auth2-step { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; padding: 5px 11px; border-radius: 999px; background: var(--sky-soft); color: var(--blue); font-size: 12.5px; font-weight: 750; }
.auth2-step .icon { width: 14px; height: 14px; }
.auth2-field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.auth2-input { position: relative; display: flex; align-items: center; }
.auth2-input > .icon { position: absolute; left: 15px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.auth2-input input { width: 100%; height: 52px; padding: 0 48px 0 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--sky-soft) 55%, var(--paper));
  font-size: 15.5px; font-weight: 500; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
.auth2-input input::placeholder { color: var(--ink-3); font-weight: 400; }
.auth2-input input:focus { outline: none; border-color: var(--blue); background: var(--paper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.auth2-input:focus-within > .icon { color: var(--blue); }
.auth2-input .code-input { letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.auth2-eye { position: absolute; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; }
.auth2-eye:hover { background: var(--paper-2); color: var(--ink); }
.auth2-eye .icon { width: 19px; height: 19px; }
.auth2-submit { margin-top: 6px; height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(90deg, #1B3A8C 0%, #2A6BD1 100%); color: #fff; font-size: 16px; font-weight: 750; box-shadow: 0 10px 24px rgba(27, 58, 140, .28);
  transition: transform .12s, box-shadow .12s, filter .12s; }
.auth2-submit:hover { filter: brightness(1.06); box-shadow: 0 12px 28px rgba(27, 58, 140, .34); }
.auth2-submit:active { transform: translateY(1px); }
.auth2-submit .icon { width: 18px; height: 18px; transition: transform .15s; }
.auth2-submit:hover .icon { transform: translateX(3px); }
.auth2-submit.is-busy .icon { display: none; }
.auth2-form hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 10px 0 0; }
.auth2-help { margin: 0; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--ink-3); }
.auth2-help strong { color: var(--ink-2); }
.auth2-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.auth2-legal { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 30px 0 0; font-size: 12.5px; color: var(--ink-3); }
.auth2-legal .icon { width: 14px; height: 14px; }
.auth2-msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 11px; font-size: 14px; line-height: 1.45;
  background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); }
.auth2-msg-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.auth2-msg .icon { flex: none; width: 17px; height: 17px; margin-top: 1px; }
[data-theme="dark"] .auth2-submit { color: #fff; }
@media (max-width: 960px) {
  .auth2 { grid-template-columns: 1fr; }
  .auth2-story { padding: 26px 24px; min-height: 0; }
  .auth2-pitch, .auth2-foot, .auth2-arcs { display: none; }
  .auth2-rule, .auth2-tag { display: none; }
  .auth2-main { padding: 36px 20px 28px; place-items: start center; }
  .auth2-logo { display: none; }
}
.auth2-legal { flex-wrap: wrap; text-align: center; }
.auth2-logo .on-dark { display: none; }
[data-theme="dark"] .auth2-logo .on-light { display: none; }
[data-theme="dark"] .auth2-logo .on-dark { display: block; }
[data-theme="dark"] .auth2-logo-name { color: #E6EEFB; }
[data-theme="dark"] .auth2-logo-name b { color: #8FD3F2; }
[data-theme="dark"] .auth2-logo-tag { color: #8FD3F2; }

/* access line with country flags (profile page) */
.access-dd { line-height: 1.9; }
.access-dd .cc-line { display: inline; }
.access-dd .place { gap: 6px; vertical-align: middle; }
.access-dd .cc-sep { margin-right: 2px; }

/* email settings form */
.smtp-form { margin-top: 18px; }
.smtp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.smtp-grid .smtp-host { grid-column: 1 / -1; }
.smtp-grid .field input, .smtp-grid .field select { width: 100%; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--ink-3); cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--hover); }
.smtp-off { margin-top: 14px; }
.smtp-form .form-foot { margin-top: 18px; }
.btn-danger-text { color: var(--bad); }
@media (max-width: 720px) { .smtp-grid { grid-template-columns: 1fr; } }

/* view profile text dialog */
.dialog-ovpn { width: min(860px, calc(100vw - 32px)); }
.ovpn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ovpn-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 10px; }
.ovpn-tools .ovpn-btns { margin-left: auto; display: flex; gap: 8px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.switch-line input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; box-shadow: none; accent-color: var(--navy); }
.ovpn-text { counter-reset: ln; margin: 0; max-height: min(56vh, 560px); overflow: auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 0; font: 12.5px/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace; color: var(--ink); white-space: pre; tab-size: 4; }
.ovpn-text .ln { counter-increment: ln; display: inline-block; min-width: 100%; padding: 0 14px 0 0; }
.ovpn-text .ln::before { content: counter(ln); display: inline-block; width: 3.4em; padding-right: 12px; margin-right: 12px; text-align: right; color: var(--ink-3); border-right: 1px solid var(--line); user-select: none; }
.ovpn-text .ln-cmt { color: var(--ink-3); }
.ovpn-text .ln-tag { color: var(--blue); font-weight: 600; }
.ovpn-text .ln-pem { color: var(--ink-2); }
.ovpn-text .ln-hid { color: var(--warn); font-style: italic; background: var(--warn-soft); }
.ovpn-text:focus { outline: 2px solid var(--sky); outline-offset: 2px; }
@media (max-width: 640px) { .ovpn-tools .ovpn-btns { margin-left: 0; width: 100%; } .ovpn-text { font-size: 11.5px; } }

/* ---------- connection mode cards (create profile, Settings -> Network) ---------- */
.conn-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.conn-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.conn-card:hover { border-color: var(--sky); }
.conn-card input { position: absolute; opacity: 0; pointer-events: none; }
.conn-card:has(input:checked) { border-color: var(--navy); background: var(--sky-soft); box-shadow: 0 0 0 3px rgba(31, 111, 201, .12); }
.conn-card:has(input:focus-visible) { outline: 2px solid var(--sky); outline-offset: 2px; }
.conn-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--hover); color: var(--blue); }
.conn-card:has(input:checked) .conn-ico { background: var(--navy); color: #fff; }
.conn-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conn-txt b { font-size: 14px; color: var(--ink); }
.conn-txt small { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.conn-cards-lg .conn-card { padding: 14px 16px; }
[data-theme="dark"] .conn-card:has(input:checked) { background: rgba(67, 163, 227, .12); }
[data-theme="dark"] .conn-card:has(input:checked) .conn-ico { color: #0B1430; }
.net-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.net-list .label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.net-list .label-row > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.net-list .req { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 760px) { .conn-cards, .net-lists { grid-template-columns: 1fr; } }

/* ---------- firewall rules ---------- */
.dialog-fw { width: min(880px, calc(100vw - 32px)); }
.fw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fw-nets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13px; }
.fw-rules { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: min(42vh, 420px); overflow: auto; }
.fw-row { display: grid; grid-template-columns: 26px auto minmax(150px, 1.4fr) minmax(110px, .8fr) minmax(90px, .7fr) auto; gap: 10px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--ok-line); border-radius: 12px; background: var(--paper-2); }
.fw-row.is-deny { border-left-color: var(--bad-line); }
.fw-num { align-self: center; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ink-3); background: var(--paper); border: 1px solid var(--line); }
.fw-act { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--paper); align-self: end; height: 38px; }
.fw-act button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 0 11px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.fw-act button .icon { width: 14px; height: 14px; }
.fw-act button + button { border-left: 1px solid var(--line); }
.fw-act button[data-act=allow][aria-pressed=true] { background: var(--ok-soft); color: var(--ok); }
.fw-act button[data-act=deny][aria-pressed=true] { background: var(--bad-soft); color: var(--bad); }
.fw-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fw-f > span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.fw-f input, .fw-f select { width: 100%; height: 38px; }
.fw-f input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.fw-f input:disabled { background: var(--hover); color: var(--ink-3); }
.fw-f input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.fw-tools { display: flex; gap: 2px; align-self: end; }
.fw-tools .icon-btn { width: 32px; height: 38px; }
.fw-tools [data-fw-up] .icon { transform: rotate(180deg); }
.fw-tools .icon-btn:disabled { opacity: .35; cursor: default; }
.fw-tools [data-fw-del]:hover { color: var(--bad); background: var(--bad-soft); }
.fw-warn { grid-column: 3 / -1; font-size: 12.5px; color: var(--warn); margin-top: -2px; }
.fw-empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--ink-2); font-size: 13.5px; margin-bottom: 12px; }
.fw-empty > .icon { flex: none; width: 22px; height: 22px; color: var(--blue); margin-top: 1px; }
.fw-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 16px; }
.fw-quick-label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-left: 6px; }
.fw-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.pill-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--sky-soft); }
.fw-default { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); margin-bottom: 14px; }
.fw-default > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.fw-default .hint { margin: 0; }
.seg.seg-bad:has(input:checked) { background: var(--bad); color: #fff; }
.fw-preview { border-radius: 12px; padding: 12px 16px; background: var(--sky-soft); border: 1px solid rgba(31, 111, 201, .18); }
[data-theme="dark"] .fw-preview { background: rgba(67, 163, 227, .08); }
.fw-preview h4 { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; }
.fw-preview ol, .fw-mini { margin: 0; padding: 0; list-style: none; counter-reset: fw; display: flex; flex-direction: column; gap: 4px; }
.fw-preview li, .fw-mini li { counter-increment: fw; display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--ink); }
.fw-preview li::before, .fw-mini li::before { content: counter(fw); flex: none; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.fw-preview li.is-allow::before, .fw-mini li.is-allow::before { background: var(--ok-soft); color: var(--ok); }
.fw-preview li.is-deny::before, .fw-mini li.is-deny::before { background: var(--bad-soft); color: var(--bad); }
.fw-preview li.is-rest::before, .fw-mini li.is-rest::before { content: "…"; }
.fw-mini li.is-more::before { content: "+"; background: var(--hover); color: var(--ink-3); }
.fw-mini li.is-more { color: var(--ink-3); }
.fw-mini { margin-top: 6px; }
.fw-mini-sm li { font-size: 13px; }
.fw-sum { font-weight: 650; }
.chip-fw { border: 0; cursor: pointer; background: var(--t2); color: var(--t2i); }

.fw-empty[hidden], .fw-rules[hidden], .fw-warn[hidden] { display: none; }
.fw-sum { display: block; }
@media (max-width: 640px) {
  .dialog-fw .dialog-actions { flex-wrap: wrap; }
  .dialog-fw .dialog-actions .mr-auto { order: 3; width: 100%; margin: 0; }
  .dialog-fw .dialog-actions .btn { flex: 1; }
}
@media (max-width: 640px) { .fw-rules { max-height: none; overflow: visible; } }
@media (max-width: 760px) {
  .fw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .fw-row .fw-num { order: 0; }
  .fw-row .fw-act { order: 1; }
  .fw-row .fw-tools { order: 2; margin-left: auto; }
  .fw-row .fw-dst { order: 3; flex: 1 1 100%; }
  .fw-row .fw-proto { order: 4; flex: 1 1 52%; }
  .fw-row .fw-ports { order: 5; flex: 1 1 30%; }
  .fw-row .fw-warn { order: 6; flex: 1 1 100%; margin: 0; }
  .fw-row .fw-act button { padding: 0 10px; }
  .fw-row .fw-act button .icon { display: none; }
  .fw-tools .icon-btn { width: 30px; }
  .fw-quick-label { width: 100%; margin-left: 0; }
}



/* Settings -> Network: single private-networks box + rules for new profiles */
.net-one .label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.net-label { display: inline-flex; align-items: center; gap: 6px; }
.net-one .req { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.net-one textarea.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.fw-newbox { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.fw-newbox .policy-icon { flex: none; }
.fw-newbox-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fw-newbox-text .hint { margin: 0; }
.fw-newbox .fw-need { color: var(--warn); }
.fw-newbox .fw-need[hidden] { display: none; }
.fw-newbox button[disabled] { opacity: .45; cursor: not-allowed; }
.menu-list button[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) {
  .fw-newbox { flex-wrap: wrap; }
  .fw-newbox-text { flex: 1 1 calc(100% - 64px); }
  .fw-newbox [data-fw-newbtn] { flex: 1 1 100%; justify-content: center; }
}
/* Gateway dialog: firewall rules that follow the chosen mode */
.rule-sec[data-tsec="gw"] .rule-body { display: flex; flex-direction: column; gap: 12px; }
.fw-follow { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.fw-follow[hidden] { display: none; }
.fw-follow .check { margin: 0; }
.fw-follow-cmp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-left: 28px; font-size: .9rem; color: var(--ink-3); }
.fw-follow-cmp b { color: var(--ink); font-weight: 600; }
.fw-follow-arrow { color: var(--ink-3); }
/* network topology: badge + dialog */
.topo-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px 1px 6px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: baseline; border: 1px solid transparent; font-family: inherit; }
.topo-badge .icon { width: 13px; height: 13px; }
.topo-badge.is-gw { background: #E8F0FE; color: #1D4ED8; border-color: #C7D8FB; }
.topo-badge.is-split { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
button.topo-badge { cursor: pointer; }
button.topo-badge:hover { border-color: var(--line-strong); }
.profile-chips .topo-badge { margin-left: 0; font-size: .8rem; padding: 3px 10px 3px 8px; }
td .topo-badge + .chip, td .chip + .topo-badge { margin-left: 4px; }
:root[data-theme="dark"] .topo-badge.is-gw { background: #17305F; color: #A9C4FF; border-color: #2B4A86; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topo-badge.is-gw { background: #17305F; color: #A9C4FF; border-color: #2B4A86; } }
.topo-body { display: flex; flex-direction: column; gap: 14px; }
.topo-body > .dialog-text { margin: 0; }
.topo-carry { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.topo-carry[hidden] { display: none; }
.topo-carry-q { margin: 0 0 2px; font-weight: 600; color: var(--ink); }
.topo-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.topo-opt:has(input:checked) { border-color: var(--c1, #1E40AF); box-shadow: 0 0 0 1px var(--c1, #1E40AF) inset; }
.topo-opt input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.topo-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topo-opt small { color: var(--ink-3); overflow-wrap: anywhere; }
/* status column: every chip and badge on one baseline, same height and spacing */
.status-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.status-chips > .chip, .status-chips > .topo-badge, .status-chips > button { margin: 0; vertical-align: middle; }
.status-chips > .chip, .status-chips > .topo-badge { height: 26px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 1; }
.status-chips > .topo-badge { font-size: 12.5px; font-weight: 700; padding-left: 8px; padding-right: 10px; gap: 6px; }
a.topo-badge { text-decoration: none; cursor: pointer; }
a.topo-badge:hover { border-color: var(--line-strong); }
a.topo-badge.is-gw:hover { border-color: #93B4F5; }
