/* 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: 34px; width: auto; flex: none; display: block; }
/* The supplied logo is used exactly as is; on blue it sits on a white tile so its navy arc stays visible */
.brand-logo, .gbanner-logo { background: #fff; padding: 5px; border-radius: 10px; box-sizing: content-box; box-shadow: 0 2px 8px rgba(10, 25, 70, .18); }
.brand-logo.big { height: 80px; width: auto; padding: 12px; border-radius: 18px; }
.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: 56px; width: auto; flex: none; padding: 9px; border-radius: 14px; }
.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: 26px; width: auto; }
.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; }
}

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot-logo { background: #fff; padding: 3px; border-radius: 6px; } }
:root[data-theme="dark"] .foot-logo { background: #fff; padding: 3px; border-radius: 6px; }

/* 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; }
