/* Pocket Tunnels - admin panel */
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e4e8ef;
    --border-strong: #d0d6e0;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff4ff;
    --success: #059669;
    --success-soft: #e7f7f0;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --warning: #b45309;
    --warning-soft: #fff6e5;
    --sidebar: #0b1220;
    --sidebar-text: #aab4c5;
    --sidebar-active: #18233a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0f17;
        --surface: #121826;
        --surface-2: #161e2e;
        --border: #222c3d;
        --border-strong: #2e3a50;
        --text: #e6ebf3;
        --text-2: #c3cbd8;
        --muted: #8a96aa;
        --primary: #4f8bff;
        --primary-hover: #6a9cff;
        --primary-soft: #182544;
        --success: #34d399;
        --success-soft: #0f2a22;
        --danger: #f87171;
        --danger-soft: #2f1517;
        --warning: #fbbf24;
        --warning-soft: #2c2210;
        --sidebar: #080b12;
        --sidebar-active: #141c2c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
code, .mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.icon { flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------------ layout */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 236px;
    display: flex; flex-direction: column;
    background: var(--sidebar); color: var(--sidebar-text);
    padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
}
.brand-mark.big { width: 44px; height: 44px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; font-weight: 650; line-height: 1.15; }
.brand-text small { font-weight: 450; color: var(--sidebar-text); font-size: 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
    color: var(--sidebar-text); font-weight: 500;
}
.sidebar nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 #3b82f6; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 6px 0; border-top: 1px solid #1a2436; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #1f2b44; color: #fff; font-weight: 600; font-size: 12px; }
.sidebar .icon-btn { color: var(--sidebar-text); }
.sidebar .icon-btn:hover { background: var(--sidebar-active); color: #fff; }

.content { margin-left: 236px; padding: 28px 32px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.url-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* ------------------------------------------------------------------ cards & grids */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head.padded { padding: 16px 18px 0; }
.card .link { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span-2 { grid-column: 1 / -1; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; position: relative; }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi-value.small-value { font-size: 18px; margin-top: 10px; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi-delta { position: absolute; top: 16px; right: 16px; font-size: 11.5px; color: var(--muted); }
.kpi-warn .kpi-value { color: var(--warning); }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger-ghost { color: var(--danger); }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.block { width: 100%; height: 40px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
    border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------------ forms */
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, textarea {
    width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit;
}
textarea { height: auto; padding: 8px 12px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
.affix { display: flex; align-items: stretch; }
.affix span { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); font-size: 13px; white-space: nowrap; }
.affix span:first-child { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.affix span:last-child { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.affix input { border-radius: 0; min-width: 0; }
.notes { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
.notes .field { width: 100%; }

/* ------------------------------------------------------------------ toolbar, tabs, search */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tabs.wrap { flex-wrap: wrap; }
.tab { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--primary-soft); color: var(--primary); }
.search { position: relative; display: flex; align-items: center; width: min(340px, 100%); }
.search .icon { position: absolute; left: 11px; color: var(--muted); }
.search input { padding-left: 34px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 550; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none;
    padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 7px 16px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; transition: background .1s; }
.row-link:hover { background: var(--surface-2); }
.row-link.is-blocked td { opacity: .72; }
.t-name { font-weight: 600; color: var(--text); }
.url-cell { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.url-cell a { color: var(--text-2); }
.url-cell a:hover { color: var(--primary); }
.download { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.download > span { display: inline-flex; gap: 5px; align-items: center; margin-right: 2px; }
.icon-btn.copied { color: var(--success); }
.ellipsis { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method { display: inline-block; min-width: 42px; color: var(--muted); }
.code { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.code.c2 { background: var(--success-soft); color: var(--success); }
.code.c3 { background: var(--primary-soft); color: var(--primary); }
.code.c4 { background: var(--warning-soft); color: var(--warning); }
.code.c5 { background: var(--danger-soft); color: var(--danger); }
.pager { display: flex; justify-content: center; gap: 8px; padding: 14px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ status, tags */
.status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.online { background: var(--success-soft); color: var(--success); }
.status.online i { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
.status.offline { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.status.blocked { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); } 70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tag.ev-blocked, .tag.ev-deleted { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.ev-unblocked, .tag.ev-created { background: var(--success-soft); color: var(--success); border-color: transparent; }
.tag.ev-renamed, .tag.ev-moved { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ------------------------------------------------------------------ alerts, toasts, empty */
.inline-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; }
.inline-alert.warn { background: var(--warning-soft); color: var(--warning); }
.inline-alert.danger { background: var(--danger-soft); color: var(--danger); }
.inline-alert.error { background: var(--danger-soft); color: var(--danger); margin: 0; }
.inline-alert em { font-style: normal; font-weight: 600; }
.toast {
    position: fixed; top: 18px; right: 18px; z-index: 50; max-width: 440px;
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 500;
    animation: toast-in .25s ease-out, toast-out .4s ease-in 6s forwards;
}
.toast.ok .icon { color: var(--success); margin-top: 2px; }
.toast.error .icon { color: var(--danger); margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); visibility: hidden; } }
.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 16px; color: var(--muted); text-align: center; }
.empty.small { padding: 20px 8px; font-size: 13px; }
.empty p { margin: 0; }

/* ------------------------------------------------------------------ lists */
.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.toplist a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; color: var(--text); }
.toplist a:hover { text-decoration: none; }
.toplist a:hover .toplist-name { color: var(--primary); }
.toplist-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist-name small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.toplist-value { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #60a5fa, var(--primary)); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; }
.timeline .ev-blocked .dot, .timeline .ev-deleted .dot { background: var(--danger); }
.timeline .ev-unblocked .dot, .timeline .ev-created .dot { background: var(--success); }
.timeline .ev-renamed .dot, .timeline .ev-moved .dot { background: var(--primary); }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; word-break: break-all; }
.bullets { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; }
.barchart { display: grid; grid-template-columns: 64px 1fr; gap: 0 10px; }
.ylabels { position: relative; height: var(--plot-h); }
.ylabels span { position: absolute; right: 0; transform: translateY(50%); color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plot { min-width: 0; }
.plot svg { display: block; width: 100%; height: var(--plot-h); overflow: visible; }
.plot .grid { stroke: var(--border); stroke-width: 1; }
.plot .hit { fill: transparent; }
.plot .fill { fill: var(--primary); opacity: .85; transition: opacity .1s; }
.plot .bar:hover .fill { opacity: 1; }
.plot .bar:hover .hit { fill: var(--primary-soft); opacity: .6; }
.xlabels { display: flex; margin-top: 6px; }
.xlabels span { flex: 1 1 0; min-width: 0; text-align: center; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: visible; }
.spark { display: block; overflow: visible; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark polygon { fill: var(--primary); opacity: .1; }
.spark-empty line { stroke: var(--border-strong); stroke-dasharray: 3 3; }

/* ------------------------------------------------------------------ dialogs */
.dialog {
    width: min(480px, calc(100vw - 32px)); padding: 20px 22px; border: 1px solid var(--border);
    border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(8, 12, 20, .45); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ------------------------------------------------------------------ login */
body.auth { min-height: 100vh; background: radial-gradient(1200px 600px at 20% -10%, var(--primary-soft), transparent), var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px; display: grid; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand h1 { font-size: 19px; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hide-md { display: none; }
}
@media (max-width: 820px) {
    .sidebar { position: static; width: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; }
    .brand { padding: 0 8px 0 0; }
    .brand-text small { display: none; }
    .sidebar nav { flex-direction: row; overflow-x: auto; }
    .sidebar nav a { padding: 7px 9px; font-size: 13px; }
    .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
    .who span:last-child { display: none; }
    .content { margin-left: 0; padding: 18px 16px 40px; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .hide-sm { display: none; }
}
@media (max-width: 520px) {
    /* phone: navigation as icons only (labels in the title attribute of the page header) */
    .brand-text { display: none; }
    .sidebar nav { gap: 4px; }
    .sidebar nav a { font-size: 0; gap: 0; padding: 8px 10px; }
    .sidebar nav a .icon { width: 19px; height: 19px; }
    .kpis { grid-template-columns: minmax(0, 1fr); }
    .props { grid-template-columns: 90px 1fr; }
}

/* ------------------------------------------------------------------ live (realtime) */
:root { --down: var(--primary); --up: #0d9488; }
@media (prefers-color-scheme: dark) { :root { --up: #2dd4bf; } }
.live-card { margin-top: 16px; }
.live-title { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-dot.on { background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
.live-dot.stale { background: var(--warning); }
.live-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin-bottom: 10px; }
.live-kpis > div { display: grid; gap: 2px; }
.live-kpis strong { font-size: 20px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.live-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.sw { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.sw-down { background: var(--down); }
.sw-up { background: var(--up); }
.live-chart { height: 190px; position: relative; }
.live-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.live-chart .grid line { stroke: var(--border); stroke-width: 1; }
.live-chart .grid text, .live-chart .axis text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.live-chart .down path.line { stroke: var(--down); }
.live-chart .up path.line { stroke: var(--up); }
.live-chart path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.live-chart .down path.area { fill: var(--down); opacity: .12; }
.live-chart .up path.area { fill: var(--up); opacity: .10; }
.live-chart .empty-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.rate { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }
.rate.busy { color: var(--text); font-weight: 600; display: inline-grid; justify-items: end; line-height: 1.25; }
.rate.busy small { color: var(--muted); font-weight: 450; font-size: 11.5px; }
.t-name { white-space: nowrap; }
.quota { display: grid; gap: 4px; margin-top: 8px; }
.quota .meter span { background: var(--primary); }
.quota.high .meter span { background: var(--warning); }
.quota.full .meter span { background: var(--danger); }
.refreshing { transition: opacity .2s; }

/* ------------------------------------------------------------------ settings */
.settings { display: grid; gap: 16px; }
.setting-rows { display: grid; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 8px 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.setting:first-child { border-top: 0; padding-top: 4px; }
.setting-text p { margin: 4px 0 0; }
.setting-input { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.setting-input input[type=number] { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.setting-input .unit { min-width: 64px; }
.setting.has-error input { border-color: var(--danger); }
.error-text { color: var(--danger); margin: 4px 0 0; }
.warn-text { color: var(--warning); margin: 4px 0 0; display: flex; align-items: center; gap: 6px; }
.settings-foot { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 500; vertical-align: 1px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ------------------------------------------------------------------ account */
a.who { color: var(--sidebar-text); padding: 4px 6px; border-radius: 8px; }
a.who:hover, a.who.active { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.account-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.account-list li { display: flex; align-items: center; gap: 10px; }
.account-list .avatar { background: var(--primary-soft); color: var(--primary); }
.account-list .grow { flex: 1; min-width: 0; }
.account-list form { margin: 0; }
.add-account summary { list-style: none; cursor: pointer; width: max-content; }
.add-account summary::-webkit-details-marker { display: none; }
.add-account[open] summary { margin-bottom: 12px; }

@media (max-width: 860px) {
    .setting { grid-template-columns: minmax(0, 1fr); }
    .setting-input { justify-content: flex-start; }
    .live-chart { height: 160px; }
}
.email-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.snippet { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--surface-2); font-size: 13px; }
.snippet pre { margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 12px; line-height: 1.5; tab-size: 4; }
