:root,
[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --header-bg: rgba(255, 255, 255, 0.86);
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --accent: #1d4ed8;
    --accent-hover: #1e40af;
    --accent-soft: rgba(29, 78, 216, 0.08);
    --accent-border: rgba(29, 78, 216, 0.22);
    --ok: #059669;
    --ok-soft: rgba(5, 150, 105, 0.09);
    --ok-border: rgba(5, 150, 105, 0.24);
    --warn: #b45309;
    --warn-soft: rgba(180, 83, 9, 0.09);
    --err: #dc2626;
    --panel-bg: #0f172a;
    --panel-border: #1e293b;
    --panel-ink: #f8fafc;
    --panel-muted: #94a3b8;
    --grid-dot: rgba(15, 23, 42, 0.06);
    --hero-glow: rgba(29, 78, 216, 0.06);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, 0.08);
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 8px;
}

[data-theme="dark"] {
    --bg: #090d16;
    --surface: #111827;
    --surface-2: #162032;
    --header-bg: rgba(9, 13, 22, 0.84);
    --ink: #f1f5f9;
    --ink-2: #cbd5e1;
    --muted: #94a3b8;
    --line: #1e293b;
    --line-strong: #334155;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.14);
    --accent-border: rgba(59, 130, 246, 0.3);
    --ok: #34d399;
    --ok-soft: rgba(16, 185, 129, 0.12);
    --ok-border: rgba(16, 185, 129, 0.28);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.12);
    --err: #f87171;
    --panel-bg: #0b1120;
    --panel-border: #1e293b;
    --panel-ink: #f8fafc;
    --panel-muted: #94a3b8;
    --grid-dot: rgba(148, 163, 184, 0.07);
    --hero-glow: rgba(59, 130, 246, 0.11);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 15.5px;
    letter-spacing: -0.015em;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-badge {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    padding: 2px 7px;
    border-radius: 5px;
}
.nav {
    display: flex;
    gap: 22px;
    margin-left: auto;
    align-items: center;
}
.nav a {
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    transition: color .15s;
}
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme Toggle */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.theme-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
}
.theme-btn svg { width: 17px; height: 17px; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 17px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }

/* Hero */
.hero {
    background-color: var(--surface);
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, var(--hero-glow), transparent),
        radial-gradient(var(--grid-dot) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px;
    border-bottom: 1px solid var(--line);
    padding: 60px 0 68px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: start;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ok);
    background: var(--ok-soft);
    border: 1px solid var(--ok-border);
    padding: 5px 11px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px var(--ok-soft);
}
h1 {
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 16px;
}
.hero-sub {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-2);
    max-width: 560px;
    margin-bottom: 28px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.hero-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.spec-val {
    font-family: var(--mono);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.spec-lbl {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* Telemetry Panel */
.node-panel {
    background: var(--panel-bg);
    color: var(--panel-ink);
    border-radius: 10px;
    padding: 24px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-md);
}
.node-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--panel-muted);
}
.node-badge {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.node-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px 16px;
    font-size: 13px;
}
.node-kv dt { color: var(--panel-muted); }
.node-kv dd {
    text-align: right;
    font-family: var(--mono);
    color: var(--panel-ink);
    font-size: 12.5px;
}
.node-foot {
    margin-top: 18px;
    padding-top: 13px;
    border-top: 1px solid var(--panel-border);
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--panel-muted);
    display: flex;
    justify-content: space-between;
}

/* Sections */
.section { padding: 60px 0; }
.section-alt {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.section-head { margin-bottom: 30px; }
.section-head h2 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--ink);
}
.section-head p { color: var(--muted); font-size: 15px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 8px; color: var(--ink); letter-spacing: -0.01em; }
.card p { font-size: 14px; color: var(--ink-2); flex: 1; }
.card-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.icon-box {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.step-num {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

/* Tables */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
    background: var(--surface-2);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
tr:last-child td { border-bottom: none; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* Badges */
.badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--ink-2);
    border: 1px solid var(--line);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge-blue { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(180, 83, 9, 0.25); }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .err { display: none; font-size: 12.5px; color: var(--err); margin-top: 5px; }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field.invalid .err { display: block; }

.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 16px;
}
.consent input { margin-top: 3px; }

.alert-ok {
    padding: 12px 14px;
    background: var(--ok-soft);
    border: 1px solid var(--ok-border);
    color: var(--ok);
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert-info {
    padding: 12px 14px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--ink);
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
}

/* LK */
.lk-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; gap: 6px; }
.auth-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab:hover { text-decoration: none; color: var(--ink); }

.doc-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: none; }
.doc-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.doc-sub { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }

.progress-bar {
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width .25s ease;
}

/* Footer */
footer {
    background: var(--panel-bg);
    color: #94a3b8;
    padding: 44px 0 34px;
    font-size: 13px;
    border-top: 1px solid var(--panel-border);
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 20px;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; }
.footer-links a:hover { color: #fff; }
.footer-legal { font-size: 12px; color: #64748b; line-height: 1.55; }

/* Page title bar */
.page-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 36px 0;
}
.page-bar h1 { font-size: 28px; margin-bottom: 6px; }
.page-bar p { color: var(--ink-2); font-size: 15px; }

@media (max-width: 920px) {
    .hero-grid, .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .nav { display: none; }
    h1 { font-size: 28px; }
}
