/* Self-hosted fonts (SIL Open Font License): Geist and Geist Mono. */
@font-face{font-family:'Geist';font-style:normal;font-weight:100 900;font-display:swap;src:url(/static/fonts/geist-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Geist';font-style:normal;font-weight:100 900;font-display:swap;src:url(/static/fonts/geist-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Geist Mono';font-style:normal;font-weight:100 900;font-display:swap;src:url(/static/fonts/geistmono-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Geist Mono';font-style:normal;font-weight:100 900;font-display:swap;src:url(/static/fonts/geistmono-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
/* PanelFi panel styles. Tokens first; everything else uses them. */
:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --border: #e2e7ef;
  --border-strong: #cfd7e3;
  --ink: #0f1a2b;
  --ink-2: #44526a;
  --muted: #5f6e85;
  --brand: #2563EB;
  --brand-ink: #1d4ed8;
  --brand-strong: #1e3a8a;
  --brand-soft: #e8efff;
  --brand-soft-2: #d7e3ff;
  --on-brand: #ffffff;
  --top-bg: #0b1a33;
  --top-ink: #e8eef8;
  --top-muted: #9fb0cb;
  --top-field: #13284a;
  --rail-bg: #0b1a33;
  --good: #0ca30c;
  --good-ink: #08750a;
  --good-soft: #e6f6e6;
  --warn: #fab219;
  --warn-ink: #8a5800;
  --warn-soft: #fff4dc;
  --bad: #d03b3b;
  --bad-ink: #b02a2a;
  --bad-soft: #fdeaea;
  --info-soft: #e8efff;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e7ebf1;
  --axis: #c9d1dd;
  --track: #e6edf8;
  --shadow: 0 1px 2px rgba(15, 26, 43, .05), 0 1px 1px rgba(15, 26, 43, .03);
  --shadow-lg: 0 12px 32px rgba(15, 26, 43, .14), 0 2px 6px rgba(15, 26, 43, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 272px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220; --surface: #141c2b; --surface-2: #19233533; --surface-3: #1d283b;
    --border: #253147; --border-strong: #33415b; --ink: #e6edf7; --ink-2: #b9c5d8; --muted: #8e9db5;
    --brand: #38BDF8; --brand-ink: #7cc4fb; --brand-strong: #a9d9fb; --brand-soft: #16294a; --brand-soft-2: #1d3560; --on-brand: #06142b;
    --top-bg: #070e1b; --top-ink: #e6edf7; --top-muted: #8e9db5; --top-field: #121d31; --rail-bg: #070e1b;
    --good-ink: #3fcf3f; --good-soft: #12301a; --warn-ink: #fab219; --warn-soft: #33270b; --bad-ink: #f07272; --bad-soft: #3a1818; --info-soft: #16294a;
    --series-1: #3987e5; --series-2: #d95926; --grid: #222d41; --axis: #34425c; --track: #1d2a42;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220; --surface: #141c2b; --surface-2: #19233533; --surface-3: #1d283b;
  --border: #253147; --border-strong: #33415b; --ink: #e6edf7; --ink-2: #b9c5d8; --muted: #8e9db5;
  --brand: #38BDF8; --brand-ink: #7cc4fb; --brand-strong: #a9d9fb; --brand-soft: #16294a; --brand-soft-2: #1d3560; --on-brand: #06142b;
  --top-bg: #070e1b; --top-ink: #e6edf7; --top-muted: #8e9db5; --top-field: #121d31; --rail-bg: #070e1b;
  --good-ink: #3fcf3f; --good-soft: #12301a; --warn-ink: #fab219; --warn-soft: #33270b; --bad-ink: #f07272; --bad-soft: #3a1818; --info-soft: #16294a;
  --series-1: #3987e5; --series-2: #d95926; --grid: #222d41; --axis: #34425c; --track: #1d2a42;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 23px; font-family: var(--display); font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.term-wrap { background: #0b1220; padding: 10px 6px 6px 10px; border-radius: 0 0 var(--radius, 12px) var(--radius, 12px); }
#term { height: min(68vh, 640px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hidden { display: none !important; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--top-bg); color: var(--top-ink); }
.topbar a { color: inherit; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17.5px; letter-spacing: -.03em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #38BDF8, #2563EB 55%, #1e3a8a); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-side { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--top-muted); border: 1px solid rgba(159,176,203,.35); padding: 2px 7px; border-radius: 999px; }
.top-search { position: relative; flex: 1; max-width: 520px; margin-left: 12px; }
.top-search input[type=search] { width: 100%; height: 36px; border-radius: 9px; border: 1px solid transparent; background: var(--top-field); color: var(--top-ink); padding: 0 12px 0 36px; font: inherit; }
.top-search input[type=search]::placeholder { color: var(--top-muted); }
.top-search input[type=search]:focus { outline: none; border-color: #38BDF8; box-shadow: none; }
.top-search > .i { position: absolute; left: 11px; top: 9px; color: var(--top-muted); }
.top-search kbd { position: absolute; right: 9px; top: 8px; font: 11px var(--mono); color: var(--top-muted); border: 1px solid rgba(159,176,203,.35); border-radius: 5px; padding: 0 5px; }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow: auto; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--ink); }
.search-results a:hover, .search-results a.on { background: var(--brand-soft); text-decoration: none; }
.search-results .cat { margin-left: auto; font-size: 12px; color: var(--muted); }
.search-results .none { padding: 10px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-chip { font-size: 12.5px; color: var(--top-muted); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.menu { position: relative; }
.menu-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.menu-btn:hover { background: rgba(255,255,255,.08); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #2563EB; color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.menu-pop { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); text-decoration: none; }
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-pop .who b { display: block; }
.nav-toggle { display: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - 56px); }
.shell.user { grid-template-columns: 76px minmax(0, 1fr); }
.shell.plain { grid-template-columns: minmax(0, 1fr); }
.main { padding: 24px 28px 56px; min-width: 0; }
.main-inner { max-width: 1440px; margin: 0 auto; }

.sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 10px 24px; }
.side-filter { position: relative; margin: 2px 4px 10px; }
.side-filter input[type=search] { width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 0 10px 0 32px; font: inherit; color: var(--ink); }
.side-filter .i { position: absolute; left: 9px; top: 8px; color: var(--muted); width: 16px; height: 16px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.side-link:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.side-link.on { background: var(--brand-soft); color: var(--brand-ink); }
.side-cat { margin-top: 6px; }
.side-cat > button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 650; border-radius: 8px; cursor: pointer; text-align: left; }
.side-cat > button:hover { background: var(--surface-3); }
.side-cat > button .chev { margin-left: auto; transition: transform .15s; color: var(--muted); width: 16px; height: 16px; }
.side-cat.closed > button .chev { transform: rotate(-90deg); }
.side-cat.closed > ul { display: none; }
.side-cat ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 18px; }
.side-cat li a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; }
.side-cat li a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.side-cat li a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.side-cat li a.planned { color: var(--muted); }
.tag-soon { margin-left: auto; font-size: 10.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }

.rail { position: sticky; top: 56px; height: calc(100vh - 56px); background: var(--rail-bg); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; }
.rail a { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 10px; color: var(--top-muted); font-size: 10.5px; font-weight: 600; }
.rail a .i { width: 20px; height: 20px; }
.rail a:hover { background: rgba(255,255,255,.07); color: var(--top-ink); text-decoration: none; }
.rail a.on { background: rgba(94,170,253,.16); color: #fff; }

.impersonating { background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid var(--border); padding: 8px 20px; display: flex; gap: 12px; align-items: center; font-weight: 550; }
.impersonating form { margin-left: auto; }

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 760px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad, .card > .body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { font-size: 15px; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- tool tiles ---------- */
.tool-section { margin-bottom: 14px; }
.tool-section > header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; border-bottom: 1px solid var(--border); }
.tool-section > header h2 { font-size: 14.5px; }
.tool-section > header .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.tool-section.closed > header { border-bottom-color: transparent; }
.tool-section.closed > header .chev { transform: rotate(-90deg); }
.tool-section.closed > .tool-grid { display: none; }
.cat-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 4px; padding: 10px; }
.tool { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ink); font-weight: 550; line-height: 1.3; min-height: 54px; }
.tool:hover { background: var(--surface-3); text-decoration: none; }
.tool .ti { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.tool .ti .i { width: 20px; height: 20px; }
.tool.planned { color: var(--muted); }
.tool.planned .ti { background: var(--surface-3); color: var(--muted); }
.tool small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* ---------- info aside ---------- */
.info-list { margin: 0; padding: 0; list-style: none; }
.info-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-list li:last-child { border-bottom: 0; }
.info-list span:first-child { color: var(--muted); }
.info-list span:last-child { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.usage-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.usage-row:last-child { border-bottom: 0; }
.usage-row .spread { font-size: 13px; margin-bottom: 6px; }
.usage-row .spread b { font-weight: 650; }
.usage-row .spread span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- meters ---------- */
.meter { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--series-1); min-width: 2px; }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.meter.thin { height: 5px; }
.meter-cell { min-width: 180px; }
.meter-cell .meter { margin-top: 5px; }

/* ---------- resource usage rings ---------- */
.res-body { padding-top: 8px; padding-bottom: 8px; }
.res-body .rings { display: flex; gap: 14px; padding: 4px 0 14px; }
.ring-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; min-width: 0; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--series-1) calc(var(--p) * 1%), var(--track) 0); transition: background .4s ease; }
.ring.warn { background: conic-gradient(var(--warn) calc(var(--p) * 1%), var(--track) 0); }
.ring.bad  { background: conic-gradient(var(--bad)  calc(var(--p) * 1%), var(--track) 0); }
.ring.ring-inf { background: conic-gradient(var(--series-1) 0 30%, var(--track) 30%); }
.ring .ring-hole { width: 70px; height: 70px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 750; font-size: 20px; color: var(--text, inherit);
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--border); }
.ring .ring-hole small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.ring-inf-mark { font-size: 26px; color: var(--series-1); }
.ring-cap b { display: block; font-size: 13px; }
.ring-cap span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-body .gauges { border-top: 1px solid var(--border); padding-top: 4px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .label .i { width: 16px; height: 16px; }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: 14px; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat .meter { margin-top: 10px; }
.stat .spark { display: block; width: 100%; height: 34px; margin-top: 8px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--surface-3); }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(.94); background: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-link { border: 0; background: none; padding: 0; height: auto; color: var(--brand-ink); font-weight: 600; }
.btn-link:hover { background: none; text-decoration: underline !important; }
.btn-link.danger { color: var(--bad-ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
/* A save in progress: the button keeps its colour and shows a spinner. */
.btn.is-busy[disabled] { opacity: 1; cursor: progress; }
.btn.is-busy::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: save-spin .7s linear infinite; flex: none; }
.iso-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.iso-switch { display: flex; gap: 14px; align-items: flex-start; }
.iso-switch h2 { font-size: 15px; margin: 2px 0 6px; }
.iso-switch p { margin: 0; }
.iso-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.iso-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
.iso-limits > div { min-width: 0; }
.iso-limits dt { font-size: 12px; color: var(--muted); }
.iso-limits dd { margin: 2px 0 0; font-weight: 600; }
.save-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; }
.save-bar span { display: block; height: 100%; width: 0; background: var(--brand); box-shadow: 0 0 8px var(--brand); transition: width .2s linear; }
.save-note { margin-top: 8px; max-width: 520px; }
.save-steps { list-style: none; margin: 0; padding: 0; text-align: left; display: inline-block; min-width: 240px; max-width: 420px; }
.save-steps li { position: relative; padding: 1px 0 1px 18px; color: var(--muted); line-height: 1.45; }
.save-steps li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 4px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
.save-steps li.now { color: var(--ink); }
.save-steps li.now::before { width: 8px; height: 8px; top: 4px; left: 2px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; transform: none; animation: save-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .save-steps li.now::before { animation: none; } }
@keyframes save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::before { animation-duration: 2s; } .save-bar span { transition: none; } }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label-text { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=url], input[type=tel], input[type=date], input[type=password], input[type=email], input[type=number], input[type=time], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 11px; background: var(--surface); color: var(--ink); font: inherit;
}
textarea { height: auto; min-height: 120px; padding: 10px 11px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.prefixed { display: flex; align-items: stretch; }
.prefixed > span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: 9px 0 0 9px; background: var(--surface-3); color: var(--muted); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.prefixed > input { border-radius: 0 9px 9px 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; }
.limit-field .row { flex-wrap: nowrap; }
.limit-field input[type=number] { max-width: 160px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 84px; }
.pw-wrap .pw-gen { position: absolute; right: 4px; top: 4px; height: 30px; }
.strength { height: 4px; border-radius: 999px; background: var(--track); margin-top: 7px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t th.sortable { cursor: pointer; }
.t th.sortable::after { content: " ↕"; color: var(--border-strong); }
.t th.asc::after { content: " ↑"; color: var(--brand); }
.t th.desc::after { content: " ↓"; color: var(--brand); }
.t .actions { text-align: right; white-space: nowrap; }
.t .actions > * + * { margin-left: 10px; }
.t .primary { font-weight: 650; color: var(--ink); }
.t .sub { display: block; font-size: 12.5px; color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 30px; height: 30px; color: var(--border-strong); margin-bottom: 8px; }

/* ---------- badges & flashes ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge.info { background: var(--info-soft); color: var(--brand-ink); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-weight: 550; }
.flash .i { margin-top: 1px; }
.flash.success { background: var(--good-soft); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.flash.error { background: var(--bad-soft); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.flash.warning { background: var(--warn-soft); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.flash.info { background: var(--info-soft); color: var(--brand-ink); border-color: var(--brand-soft-2); }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 13.5px; }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }

/* ---------- tabs & segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 600; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg a { font-weight: 600; font-size: 13px; color: var(--muted); padding: 5px 12px; border-radius: 7px; white-space: nowrap; }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.arrange { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.arrange > div:first-child { flex: 1 1 320px; }
.arrange .seg { flex-wrap: wrap; max-width: 100%; }
.card-head > label.check { white-space: nowrap; flex: none; }
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chart-card h3 { font-size: 14px; }
.chart-card .now { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-card .now b { color: var(--ink); font-weight: 650; }
.chart { position: relative; height: 210px; transition: opacity .2s; }
.chart.loading { opacity: .45; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .s1 { stroke: var(--series-1); fill: var(--series-1); }
.chart .s2 { stroke: var(--series-2); fill: var(--series-2); }
.chart .line.s1, .chart .line.s2 { fill: none; }
.chart .bar { fill: var(--series-1); }
.chart .bar.hover { fill: var(--brand-ink); }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .empty-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; }
.legend i.s1 { background: var(--series-1); }
.legend i.s2 { background: var(--series-2); }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; min-width: 140px; }
.chart-tip .when { color: var(--muted); margin-bottom: 4px; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; }
.chart-tip .r b { font-variant-numeric: tabular-nums; }
.chart-tip .r i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.chart-tip .r i.s1 { background: var(--series-1); }
.chart-tip .r i.s2 { background: var(--series-2); }
.chart-tip .r span { color: var(--muted); }
.chart-table { max-height: 210px; overflow: auto; }
.chart-tools { display: flex; justify-content: flex-end; }
.chart-tools button { font-size: 12px; }

/* ---------- file manager ---------- */
.fm { display: grid; grid-template-rows: auto auto 1fr; min-height: 560px; }
.fm-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.fm-path { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; font-size: 13.5px; }
.fm-path a { color: var(--ink-2); padding: 2px 6px; border-radius: 6px; }
.fm-path a:hover { background: var(--surface-3); text-decoration: none; }
.fm-path .sep { color: var(--border-strong); }
.fm-list td:first-child { width: 34px; padding-right: 0; }
.fm-list tr.sel td { background: var(--brand-soft) !important; }
.fm-name { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 550; cursor: pointer; }
.fm-name .i { color: var(--muted); }
.fm-name.dir .i { color: var(--brand); }
.fm-drop { outline: 2px dashed var(--brand); outline-offset: -8px; background: var(--brand-soft); }
.fm-status { padding: 8px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.editor { width: 100%; min-height: 65vh; font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 4; white-space: pre; }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 15, 28, .45); }
dialog .d-head { padding: 16px 20px 0; }
dialog .d-body { padding: 14px 20px; }
dialog .d-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art { background: radial-gradient(1200px 600px at 10% 10%, #2563EB 0%, #1e3a8a 45%, #071430 100%); color: #e8efff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h2 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.2; max-width: 440px; letter-spacing: -.02em; }
.auth-art p { color: #b9d2f5; max-width: 440px; margin-top: 12px; }
.auth-art .brand { font-size: 20px; color: #fff; text-decoration: none; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-card .btn { width: 100%; height: 42px; }
.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.code-block { background: var(--surface-3); border-radius: 9px; padding: 12px 14px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 520px; }
.log-line { padding: 6px 14px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.engine-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.engine { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.engine.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.engine ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.engine .foot { margin-top: auto; padding-top: 6px; }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; }
.footer { margin-top: 40px; color: var(--muted); font-size: 12px; text-align: center; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.danger-zone .card-head h2 { color: var(--bad-ink); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .with-aside { grid-template-columns: minmax(0, 1fr); }
  .engine-cards { grid-template-columns: minmax(0, 1fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell, .shell.user { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .rail { display: none; }
  .shell.nav-open .sidebar { display: block; position: fixed; z-index: 25; left: 0; top: 56px; width: min(300px, 86vw); box-shadow: var(--shadow-lg); }
  .shell.nav-open .rail { display: flex; position: fixed; z-index: 25; left: 0; top: 56px; }
  .nav-toggle { display: inline-grid; }
  .chart-grid, .cols-2, .cols-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .top-chip { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
@media (max-width: 640px) {
  .main { padding: 16px 16px 40px; }
  .top-search { display: none; }
  .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { gap: 9px; font-size: 13px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .brand-side { display: none; }
  .t th, .t td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .meter > span, .chart .bar { forced-color-adjust: none; } }

/* ---------- logo ---------- */
.logo { width: 30px; height: 30px; flex: none; }
.logo-c { stroke: #fff; stroke-width: 6; }
.logo-f { stroke: #38BDF8; stroke-width: 5; }
.wordmark .fi { color: #38BDF8; }
.auth-art .logo { width: 36px; height: 36px; }

/* ---------- transfer tool ---------- */
.source-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.source { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.source h2 { margin: 0; }
.source p { margin: 0; font-size: 13.5px; }
.source .form { margin-top: 6px; }
.source-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft-2); color: var(--brand-ink); }
.source-icon svg { width: 20px; height: 20px; }
.source .row.nowrap { flex-wrap: nowrap; align-items: flex-start; white-space: normal; }
.source .field.port { width: 96px; flex: none; }
.source textarea { font-family: var(--mono); font-size: 12px; }
details.more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-ink); }
details.more[open] > summary { margin-bottom: 12px; }
details.more > .field + .field { margin-top: 12px; }
details.more > ol.steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 12px; font-size: 13px; }
details.more.own-key > summary { font-weight: 500; color: var(--ink-2); }
.cmd-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.cmd-box code { align-self: stretch; padding: 8px 10px; background: var(--surface-3); border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; user-select: all; }
.cmd-box .btn { flex: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: center; position: relative; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft-2); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .dz-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.dropzone .dz-name { overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.plain-list li { position: relative; padding-left: 26px; }
.plain-list li > svg:first-child { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; }
ul.tight { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
@media (max-width: 1100px) { .source-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- backups ---------- */
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nowrap-row { flex-wrap: nowrap; }
.nowrap-row input { min-width: 0; }
details.day { border-top: 1px solid var(--border); }
details.day > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; cursor: pointer; font-size: 14px; }
details.day > summary:hover { background: var(--surface-2); }
details.day .day-date { font-weight: 650; }
details.day[open] > summary { border-bottom: 1px solid var(--border); }
.grid.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .form-grid.three, .grid.wide-left { grid-template-columns: minmax(0, 1fr); } }

/* ---------- security ---------- */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes code { padding: 8px 10px; background: var(--surface-3); border-radius: 8px; text-align: center; font-size: 14px; letter-spacing: .04em; }
.qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); image-rendering: pixelated; }
code.secret { display: inline-block; padding: 8px 12px; background: var(--surface-3); border-radius: 8px; font-size: 14px; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.api-ref code { white-space: nowrap; }
.api-ref td:first-child { width: 1%; }

textarea.mono { font-family: var(--mono); font-size: 13px; line-height: 1.5; }

/* ---------- security advisor ---------- */
.advice { display: grid; gap: 10px; }
.advice-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-left: 4px solid var(--border-strong); }
.advice-item h2 { margin: 0; font-size: 15px; }
.advice-item p { margin: 3px 0 0; color: var(--ink-2); font-size: 13.5px; }
.advice-mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.advice-mark svg { width: 17px; height: 17px; }
.advice-item.bad { border-left-color: var(--bad); }
.advice-item.bad .advice-mark { background: var(--bad-soft); color: var(--bad-ink); }
.advice-item.warn { border-left-color: var(--warn); }
.advice-item.warn .advice-mark { background: var(--warn-soft); color: var(--warn-ink); }
.advice-item.good { border-left-color: var(--good); }
.advice-item.good .advice-mark { background: var(--good-soft); color: var(--good-ink); }
@media (max-width: 640px) { .advice-item { grid-template-columns: 32px minmax(0, 1fr); } .advice-item .btn { grid-column: 2; justify-self: start; } }

/* User Manager: tool checkboxes in columns by category. */
.tool-checks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px; }
.tool-checks legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; }
.tool-group { display: flex; flex-direction: column; gap: 6px; }
.tool-group .check { font-size: 13.5px; }

/* White label: uploaded logo in the header and sign-in page, theme picker. */
.brand .logo-img { height: 30px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.auth-art .brand .logo-img { height: 42px; max-width: 260px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; font-weight: 600; }
.theme-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft-2); }
.theme-opt input { margin: 0; }
.theme-swatch { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.theme-swatch i { width: 14px; height: 22px; display: block; }

/* Server dashboard quick access: WHM-style cards, two columns. */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.quick:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); text-decoration: none; }
.quick .qi { flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }
.quick .qi .i { width: 24px; height: 24px; }
.quick .qt { display: grid; gap: 4px; min-width: 0; }
.quick .qt b { font-size: 16px; font-weight: 650; color: var(--ink); }
.quick .qt span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
@media (max-width: 760px) { .quick-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .quick { transition: none; } }

/* Server panel top bar: load averages; update notice. */
.top-load { font-variant-numeric: tabular-nums; }
.top-load .muted-on-dark { color: var(--top-muted); margin-right: 4px; }
.update-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-soft-2); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.update-bar > .i { width: 18px; height: 18px; flex: none; }
.license-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.license-bar > .i { width: 18px; height: 18px; flex: none; }
.license-bar span { flex: 1; min-width: 220px; }
.license-bar.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: var(--bad); }
.license-bar.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn); }
.update-bar span { flex: 1; min-width: 200px; }
@media (max-width: 760px) { .top-load { display: none; } }

/* Live terminal log (account creation). */
.term-log { margin-top: 14px; background: #0b1220; color: #cbd5e1; border: 1px solid #1f2a3d; border-radius: var(--radius-sm); padding: 12px 14px; font: 12.5px/1.6 var(--mono); max-height: 280px; overflow: auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.term-log .tl { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-log .cmd { color: #7dd3fc; }
.term-log .ok { color: #4ade80; font-weight: 600; }
.term-log .err { color: #f87171; font-weight: 600; }

/* Tool groups: each category has its own colour, so sections and tools are
   easy to find at a glance (like cPanel's varied icons). */
.tool-section { --cat: var(--brand); }
.tool-section[data-cat="email"] { --cat: #2563eb; }
.tool-section[data-cat="files"] { --cat: #d97706; }
.tool-section[data-cat="databases"] { --cat: #0d9488; }
.tool-section[data-cat="domains"] { --cat: #7c3aed; }
.tool-section[data-cat="metrics"] { --cat: #16a34a; }
.tool-section[data-cat="security"] { --cat: #dc2626; }
.tool-section[data-cat="software"] { --cat: #4f46e5; }
.tool-section[data-cat="advanced"] { --cat: #475569; }
.tool-section[data-cat="preferences"] { --cat: #db2777; }
.tool-section > header .cat-ico { background: color-mix(in srgb, var(--cat) 14%, var(--surface)); color: var(--cat); }
.tool-section .tool .ti { width: 42px; height: 42px; border-radius: 11px; background: color-mix(in srgb, var(--cat) 12%, var(--surface)); color: var(--cat); border: 1px solid color-mix(in srgb, var(--cat) 22%, transparent); }
.tool-section .tool .ti .i { width: 22px; height: 22px; stroke-width: 1.8; }
.tool-section .tool:hover .ti { background: var(--cat); color: #fff; border-color: var(--cat); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool-section .tool .ti { background: color-mix(in srgb, var(--cat) 22%, var(--surface)); color: color-mix(in srgb, var(--cat) 55%, #fff); } }
:root[data-theme="dark"] .tool-section .tool .ti { background: color-mix(in srgb, var(--cat) 22%, var(--surface)); color: color-mix(in srgb, var(--cat) 55%, #fff); }

/* Step wizards (Database Wizard, Backup Wizard). */
.wizard-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); max-width: 820px; }
.wizard-steps li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); }
.wizard-steps li:last-child { border-right: 0; }
.wizard-steps li span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: 13px; flex: none; }
.wizard-steps li.on { color: var(--ink); background: var(--brand-soft); }
.wizard-steps li.on span { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.wizard-steps li.done span { border-color: var(--good-ink); color: var(--good-ink); }
@media (max-width: 640px) { .wizard-steps { grid-template-columns: 1fr; } .wizard-steps li { border-right: 0; border-bottom: 1px solid var(--border); } }
.priv-all { padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.priv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
.priv-grid .check { padding: 9px 0; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; }
@media (max-width: 640px) { .priv-grid { grid-template-columns: 1fr; } }

.opt-head { margin: 8px 0 2px; padding-top: 14px; border-top: 1px solid var(--border); font-weight: 700; }

/* Email deliverability */
.deliv-item { padding: 14px 0; border-top: 1px solid var(--border); }
.deliv-item:first-of-type { border-top: 0; padding-top: 0; }
.deliv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.deliv-head h3 { margin: 0; font-size: 15px; }
.deliv-val { display: block; margin-top: 4px; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; word-break: break-all; font-size: 12.5px; }
.deliv-rec { margin-top: 10px; table-layout: fixed; }
.deliv-rec th:nth-child(1) { width: 32%; } .deliv-rec th:nth-child(2) { width: 70px; } .deliv-rec th:nth-child(4) { width: 90px; }

/* Toggle switch: <label class="switch"><input type="checkbox"><span></span></label> */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span { width: 40px; height: 22px; border-radius: 999px; background: var(--muted); position: relative; transition: background .15s; flex: none; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.spam-opt { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.spam-opt .help { margin-top: 4px; }

.default-addr .check { align-items: flex-start; }
.default-addr .check .sub { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.default-addr .opt-indent { margin-left: 26px; max-width: 460px; }
.default-addr details summary { cursor: pointer; color: var(--brand-ink); }

/* File Manager: drag & drop and context menu */
.fm-list tr[draggable=true] { cursor: default; }
.fm-list tr.fm-dragging td { opacity: .5; }
.fm-list tr.fm-target td, .fm-path a.fm-target { background: var(--brand-soft) !important; box-shadow: inset 0 0 0 2px var(--brand); }
.ctx-menu { position: fixed; z-index: 1000; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgb(15 26 43 / .18), 0 2px 6px rgb(15 26 43 / .08); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--brand-soft); outline: none; }
.ctx-menu button .i { color: var(--muted); width: 16px; height: 16px; flex: none; }
.ctx-menu button span { flex: 1; }
.ctx-menu button kbd { font: 11.5px/1 ui-monospace, monospace; color: var(--muted); background: none; border: 0; }
.ctx-menu button.danger, .ctx-menu button.danger .i { color: var(--bad-ink); }
.ctx-menu .ctx-sep { height: 1px; margin: 5px 4px; background: var(--border); }
/* Code editor */
.ed-card { overflow: hidden; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ed-bar .ed-select { width: auto; height: 30px; padding: 0 8px; font-size: 13px; }
.ed-card .CodeMirror { height: calc(100vh - 290px); min-height: 360px; font-family: var(--mono); line-height: 1.5; }
.ed-card .CodeMirror-gutters { border-right: 1px solid var(--border); background: var(--surface-2); }
.ed-foot { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.ed-card .CodeMirror-dialog { background: var(--surface-2); color: var(--ink); }
.ed-card .CodeMirror-dialog input { width: 18em; height: 26px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }

.strength-label { margin-top: 4px; font-size: 12px; color: var(--muted); }
.ftp-cfg td { background: var(--surface-2); }
.ftp-cfg .cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; padding: 6px 0; }
.ftp-cfg dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.ftp-cfg dt { color: var(--muted); }
.ftp-cfg dd { margin: 0; }
.usage-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 4px; max-width: 160px; }
.usage-bar > span { display: block; height: 100%; background: var(--brand); }
.addon-at { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0; border-right: 0; background: var(--surface-3); color: var(--muted); }

/* Backup page and wizard */
.bk-stack { display: flex; flex-direction: column; gap: 0; }
.bk-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.bk-item:first-child { border-top: 0; padding-top: 0; }
.bk-item.col { flex-direction: column; align-items: stretch; }
.bk-item h3 { margin: 0 0 2px; font-size: 15px; }
.bk-item p { margin: 0; }
.bk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bk-list a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.bk-list a:hover { border-color: var(--brand); text-decoration: none; }
.wiz-choice { display: flex; gap: 16px; padding: 22px; align-items: flex-start; color: inherit; }
a.wiz-choice:hover { border-color: var(--brand); text-decoration: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.wiz-choice h2 { margin: 0 0 4px; font-size: 18px; }
.wiz-choice p { margin: 0; color: var(--muted); }
.wiz-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.wiz-ico .i { width: 24px; height: 24px; }

.up-progress { margin-top: 10px; }
.up-progress .up-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.up-progress .up-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.up-progress .up-text { margin-top: 4px; }
.up-progress.err .up-bar span { background: var(--bad); }
.up-progress.err .up-text { color: var(--bad-ink); }

/* MultiPHP Manager: extension chips */
.ext-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ext-chips li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font: 12.5px/1.4 var(--mono); }
.ext-chips li .i { width: 13px; height: 13px; color: var(--good); }

/* RapidBackup */
.rb-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.rb-tabs a .i { width: 15px; height: 15px; }
.rb-log-row td { padding-top: 0; background: var(--surface-2); }
.rb-log { margin: 6px 0 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: #0b1424; color: #d6e2f5; font: 12px/1.55 var(--mono); white-space: pre-wrap; }

/* WordPress Manager site page */
.wp-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wp-quick a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 550; }
.wp-quick a:hover { border-color: var(--brand); text-decoration: none; }
.wp-quick a .i { width: 16px; height: 16px; color: var(--brand); }
.wp-rows { display: flex; flex-direction: column; gap: 0; padding-top: 4px; padding-bottom: 4px; }
.wp-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.wp-rows > div:first-child { border-top: 0; }
.wp-rows > div > span:first-child { color: var(--muted); }
.wp-rows > div > span:last-child { display: inline-flex; align-items: center; gap: 6px; text-align: right; }
.wp-rows .i { width: 15px; height: 15px; }
.wp-switch { display: flex; align-items: center; gap: 8px; }
.wp-switch .switch { font-weight: 500; }
.help-tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; }
.icon-btn.danger { color: var(--bad-ink); width: 30px; height: 30px; }
.icon-btn.danger:hover { background: var(--bad-soft); }
.icon-btn.danger .i { width: 16px; height: 16px; }

/* User Manager */
.um-h { margin: 14px 0 0; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.um-svcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.um-svc { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.um-svc-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.um-svc-head b { display: inline-flex; align-items: center; gap: 7px; }
.um-svc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.um-list { display: flex; flex-direction: column; }
.um-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--border); }
.um-row:nth-child(even) { background: var(--surface-2); }
.um-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); flex: none; }
.um-main { flex: 1; min-width: 0; }
.um-actions { display: flex; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.um-actions .btn-link { display: inline-flex; align-items: center; gap: 4px; }
.um-actions .i { width: 14px; height: 14px; }
.um-icons { display: flex; gap: 8px; }
.um-svc-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-3); color: var(--border-strong); }
.um-svc-ico.on { background: var(--brand-soft); color: var(--brand); }

.form-grid > .ini-group { grid-column: 1 / -1; margin: 10px 0 -4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 15px; }
.form-grid > .ini-group:first-child { margin-top: 0; }

/* Update progress terminal */
.upd { overflow: hidden; }
.upd-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.upd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgb(250 178 25 / .6); animation: upd-pulse 1.4s infinite; }
.upd.ok .upd-dot { background: var(--good); animation: none; }
.upd.bad .upd-dot { background: var(--bad); animation: none; }
@keyframes upd-pulse { 70% { box-shadow: 0 0 0 8px rgb(250 178 25 / 0); } 100% { box-shadow: 0 0 0 0 rgb(250 178 25 / 0); } }
@media (prefers-reduced-motion: reduce) { .upd-dot { animation: none; } }
.upd-term { margin: 0; height: 460px; overflow: auto; padding: 14px 16px; background: #0b1424; color: #c9d6ea; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.upd-term .step { color: #7fb4ff; font-weight: 600; }
.upd-term .warn { color: #f5c25b; }
.upd-term .err { color: #ff8a8a; }
.upd-foot { padding: 12px 16px; border-top: 1px solid var(--border); }

/* PHP extension selector */
.ext-grid { columns: 4 180px; column-gap: 24px; }
.ext-group { break-inside: avoid; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.ext-letter { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 11.5px; font-weight: 700; }
.ext-item { font: 13px/1.3 var(--mono); }
.ext-item.fixed { color: var(--muted); }
.ext-item[hidden], .ext-group[hidden] { display: none; }

[hidden] { display: none !important; }

.license-hold.bad { border: 1px solid var(--bad); background: var(--bad-soft); }
.license-hold.bad h2 { color: var(--bad-ink); }
.license-hold.warn { border: 1px solid var(--warn); background: var(--warn-soft); }
.license-hold.warn h2 { color: var(--warn-ink); }

/* Numbers line up in tables and stats. */
.t td { font-variant-numeric: tabular-nums; }

/* Controls use the page fonts too (buttons do not inherit by default). */
button, input, select, textarea { font-family: inherit; }

/* ---- Cloudflare ---- */
:root { --cf: #f38020; --cf-2: #faad3f; --cf-ink: #b35a06; --cf-soft: #fff1e4; --cf-grey: #8b97a8; }
:root[data-theme="dark"] { --cf-ink: #ffb066; --cf-soft: #3a2410; --cf-grey: #7d8aa0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cf-ink: #ffb066; --cf-soft: #3a2410; --cf-grey: #7d8aa0; } }
.cf-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(115deg, #f6821f 0%, #f38020 45%, #faad3f 100%); color: #fff; box-shadow: var(--shadow); }
.cf-hero-mark { width: 52px; height: 52px; border-radius: 14px; background: rgb(255 255 255 / .18); display: grid; place-items: center; flex: none; }
.cf-hero-mark .i { width: 34px; height: 34px; color: #fff; }
.cf-hero-text { flex: 1; min-width: 0; }
.cf-hero-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.cf-hero-sub { opacity: .95; font-size: 14px; }
.cf-hero-sub b { font-weight: 650; }
.cf-hero .btn-ghost { color: #fff; border-color: rgb(255 255 255 / .55); background: transparent; }
.cf-hero .btn-ghost:hover { background: rgb(255 255 255 / .15); }
.cf-btn { border-color: var(--cf); color: var(--cf-ink); }
.cf-btn .i { color: var(--cf); }
.cf-btn:hover { background: var(--cf-soft); border-color: var(--cf); }
.btn.cf-btn-solid { background: var(--cf); border-color: var(--cf); color: #fff; }
.btn.cf-btn-solid:hover { background: #e06d0c; border-color: #e06d0c; }
.btn.cf-btn-solid .i { color: #fff; }
.badge.cf-on { background: var(--cf-soft); color: var(--cf-ink); }
.badge.cf-on .i { width: 14px; height: 14px; color: var(--cf); }
.cf-signin { display: grid; gap: 10px; justify-items: start; padding-bottom: 18px; }
.cf-signin p { margin: 0; max-width: 62ch; }
.btn.cf-signin-btn { font-size: 15px; padding: 10px 18px; }
.cf-token-alt { border-top: 1px solid var(--border); padding-top: 14px; }
.cf-token-alt > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.cf-token-alt[open] > summary { margin-bottom: 18px; }
.cf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.cf-steps > li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
.cf-steps h3 { margin: 4px 0 4px; font-size: 15px; }
.cf-steps p { margin: 0 0 12px; color: var(--ink-2); }
.cf-step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--cf-soft); color: var(--cf-ink); display: grid; place-items: center; font-weight: 700; }
.cf-perms { margin-top: 12px; }
.cf-perms summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.cf-perms .plain-list { margin: 10px 0; }
.cf-token-form { display: flex; gap: 8px; flex-wrap: wrap; max-width: 620px; }
.cf-token-form input { flex: 1 1 280px; min-width: 0; font-family: var(--mono); }
.cf-title { display: flex; align-items: center; gap: 10px; }
.cf-title-ic .i { width: 30px; height: 30px; color: var(--cf); }
.cf-ns { border: 1px solid color-mix(in srgb, var(--cf) 45%, transparent); background: var(--cf-soft); color: var(--ink); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.cf-ns-head { display: flex; align-items: center; gap: 8px; }
.cf-ns-head .i { color: var(--cf); }
.cf-ns p { margin: 6px 0; color: var(--ink-2); }
.cf-ns-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.cf-ns-list code { font-size: 14.5px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: copy; }
.cf-ns-flash { margin: 10px 0; }
.cf-ns-now { margin: 12px 0 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.cf-ns-now-head { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cf-ns-state { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cf-ns-state li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-ns-state .badge { min-width: 104px; justify-content: center; }
.cf-ns-ok { display: flex; align-items: center; gap: 6px; color: var(--good-ink); margin: 8px 0 0; }
.cf-ns-check { margin-top: 12px; }
.cf-flow { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.cf-flow li { display: flex; align-items: center; gap: 7px; }
.cf-flow li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; }
.cf-flow li.on { color: var(--cf-ink); }
.cf-flow li.on span { background: var(--cf); color: #fff; }
.cf-check { margin-top: 14px; }
.cf-add-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.cf-dnssec h2 { display: flex; align-items: center; gap: 8px; }
.cf-ds code { cursor: copy; }
.cf-wrap { overflow-wrap: anywhere; word-break: break-all; }
.cf-dnssec-off { margin-top: 12px; }
.cf-tabs .on { color: var(--cf-ink); border-bottom-color: var(--cf); }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cf-settings { padding-top: 4px; padding-bottom: 4px; }
.cf-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cf-setting:last-child { border-bottom: 0; }
.cf-setting-text { min-width: 0; }
.cf-setting-name { font-weight: 650; }
.cf-setting-help { color: var(--muted); font-size: 13px; margin-top: 2px; }
.cf-setting select { max-width: 200px; flex: none; }
.cf-switch input:checked + span { background: var(--cf); }
.cf-switch input:focus-visible + span { outline-color: var(--cf); }
.cf-sync { padding: 14px 20px; }
.cf-sync-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cf-sync-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-sync-help { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.cf-autosync .switch input:checked + span { background: var(--cf); }
.cf-type { display: inline-block; min-width: 46px; text-align: center; font-family: var(--mono); font-size: 12px; font-weight: 650; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); }
.cf-records .cf-content { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-row-add td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.cf-row-remove td { opacity: .65; }
.cf-proxy { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.cf-proxy:hover { border-color: var(--border-strong); }
.cf-proxy.static { cursor: default; }
.cf-proxy .i { width: 22px; height: 22px; }
.cf-proxy .cf-ic-on, .cf-proxy .cf-proxy-on { display: none; }
.cf-proxy .cf-ic-off .i { color: var(--cf-grey); }
.cf-proxy.on { background: var(--cf-soft); border-color: color-mix(in srgb, var(--cf) 40%, transparent); color: var(--cf-ink); }
.cf-proxy.on .cf-ic-on, .cf-proxy.on .cf-proxy-on { display: inline-flex; }
.cf-proxy.on .cf-ic-off, .cf-proxy.on .cf-proxy-off { display: none; }
.cf-proxy.on .cf-ic-on .i { color: var(--cf); }
.cf-proxy:disabled { opacity: .6; cursor: progress; }
.cf-proxy:focus-visible { outline: 2px solid var(--cf); outline-offset: 2px; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
.cf-changes { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; font-size: 13.5px; }
.cf-changes li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); overflow-wrap: anywhere; }
.cf-changes code { font-size: 12.5px; }
.cf-chg { font-weight: 650; min-width: 64px; }
.cf-changes .add .cf-chg { color: var(--good-ink); }
.cf-changes .chg .cf-chg { color: var(--warn-ink); }
.cf-changes .del .cf-chg { color: var(--bad-ink); }
.cf-wp.on { border-color: color-mix(in srgb, var(--cf) 45%, var(--border)); }
.cf-wp h2 { display: flex; align-items: center; gap: 8px; }
.cf-wp-body .plain-list { margin-top: 0; }
.cf-wp-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cf-wp-form select { width: auto; }
.cf-warn { color: var(--warn-ink); }
.cf-filter { max-width: 260px; }
.cf-wp-sites { margin: 12px 0 0; }
.plain-list .cf-orange { color: var(--cf); }
@media (max-width: 640px) {
  .cf-hero { flex-wrap: wrap; }
  .cf-setting { align-items: flex-start; }
  .cf-records th:nth-child(5), .cf-records td:nth-child(5) { display: none; }
  .cf-records .cf-content { max-width: 110px; }
  .cf-records td, .cf-records th { padding-left: 10px; padding-right: 10px; }
}

/* ---- Spam Protection ---- */
.sp-hero .sp-hero-body { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 22px 24px; }
.sp-hero h2 { margin: 2px 0 6px; font-size: 20px; }
.sp-hero p { margin: 0 0 12px; color: var(--ink-2); }
.sp-hero-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--good-soft); color: var(--good-ink); display: grid; place-items: center; }
.sp-hero-mark .i { width: 30px; height: 30px; }
.sp-features { margin: 0 0 16px; }
.sp-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.sp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sp-k { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sp-k.clean, .sp-seg.clean { background: color-mix(in srgb, var(--good) 55%, var(--surface)); }
.sp-k.spam, .sp-seg.spam { background: var(--warn); }
.sp-k.ref, .sp-seg.ref { background: var(--bad); }
.sp-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; height: 170px; align-items: end; }
.sp-col { height: 100%; display: flex; align-items: flex-end; }
.sp-stack { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.sp-seg { display: block; width: 100%; border-radius: 3px; min-height: 0; }
.sp-seg[style="height:0%"] { display: none; }
.sp-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.sp-top { list-style: none; margin: 0; padding: 6px 0; }
.sp-top li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sp-top li:last-child { border-bottom: 0; }
.sp-top-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.sp-top-n { font-weight: 650; font-variant-numeric: tabular-nums; }
.sp-recent .sp-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spam-learn { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.spam-learn .i { color: var(--good-ink); flex: none; margin-top: 2px; }
.spambox-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.spambox .spambox-from, .spambox .spambox-subj { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .sp-hero .sp-hero-body { grid-template-columns: minmax(0, 1fr); }
  .sp-chart { gap: 2px; height: 130px; }
}
