/* Black Money - ten-seat Solana desk console */
:root {
    --bg: #080c18;
    --bg-elev: #0d1424;
    --panel: #111a2e;
    --panel-2: #16223a;
    --border: #22314f;
    --border-soft: #1a2740;
    --text: #e7edf8;
    --muted: #8b9ab5;
    --mint: #3ee0a3;
    --mint-dim: rgba(62, 224, 163, 0.12);
    --red: #ff6272;
    --red-dim: rgba(255, 98, 114, 0.12);
    --amber: #ffb84d;
    --amber-dim: rgba(255, 184, 77, 0.12);
    --blue: #6b94ff;
    --blue-dim: rgba(107, 148, 255, 0.14);
    --violet: #b28dff;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --radius: 14px;
    --radius-sm: 9px;
    --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --sans: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(107, 148, 255, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(62, 224, 163, 0.07), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #9db7ff; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: 0.01em; }
h3 { font-size: 13px; font-weight: 650; }

code, .mono, pre, .json {
    font-family: var(--mono);
    font-variant-ligatures: none;
}

code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 0.92em;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.is-up { color: var(--mint); }
.is-down { color: var(--red); }
.mono-link { font-family: var(--mono); font-size: 12.5px; color: var(--blue); }
.mono-link:hover { text-decoration: underline; }

/* Layout */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: linear-gradient(180deg, var(--bg-elev), rgba(8, 12, 24, 0.96));
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
    gap: 18px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; }
.brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--mint), #1f8f72);
    color: #03130d;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.02em;
    border-radius: 11px;
    box-shadow: 0 8px 22px rgba(62, 224, 163, 0.22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14.5px; letter-spacing: 0.01em; display: flex; align-items: center; gap: 6px; }
.brand-text small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.version-chip {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #9fd6c4;
    background: rgba(62, 224, 163, 0.1);
    border: 1px solid rgba(62, 224, 163, 0.26);
    border-radius: 5px;
    padding: 1px 5px;
    line-height: 1.4;
}

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-label {
    color: #5f7090;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin: 14px 8px 5px;
}
.nav-link {
    display: block;
    color: #aab8d0;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-link.is-active {
    background: var(--blue-dim);
    border-color: rgba(107, 148, 255, 0.28);
    color: #dbe6ff;
    font-weight: 600;
}

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.mode-chip {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}
.mode-chip.is-safe { color: var(--mint); border-color: rgba(62, 224, 163, 0.3); background: var(--mint-dim); }
.mode-chip.is-danger { color: var(--red); border-color: rgba(255, 98, 114, 0.35); background: var(--red-dim); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.link-button {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--muted); font: inherit; font-size: 12.5px;
}
.link-button:hover { color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(8, 12, 24, 0.72);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 20;
    -webkit-app-region: drag;
    app-region: drag;
    user-select: none;
}
.topbar-title {
    -webkit-app-region: drag;
    app-region: drag;
}
.topbar-actions,
.topbar-actions *,
.topbar .icon-button,
.topbar button,
.topbar a,
.topbar input,
.topbar select,
.topbar form,
.topbar .wallet-widget,
.topbar .pill {
    -webkit-app-region: no-drag;
    app-region: no-drag;
}
.sidebar .brand {
    -webkit-app-region: drag;
    app-region: drag;
    user-select: none;
}
.topbar-title h1 { font-size: 18px; }
.topbar-title p { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.icon-button {
    display: none;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel);
    cursor: pointer;
    padding: 8px 7px;
    flex-direction: column;
    justify-content: space-between;
}
.icon-button span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

.content { padding: 22px 24px 34px; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 1480px; }

.footer {
    margin-top: auto;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 24px;
    border-top: 1px solid var(--border-soft);
    color: #5f7090;
    font-size: 11px;
    font-family: var(--mono);
}
.footer-mode { display: inline-flex; flex-wrap: wrap; gap: 0 2px; }
.footer-mode strong { color: #7d8fae; font-weight: 600; }
.footer-note { color: #5f7090; }

/* Cards */
.card {
    background: linear-gradient(180deg, rgba(22, 34, 58, 0.88), rgba(17, 26, 46, 0.94));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head-wrap { flex-wrap: wrap; align-items: flex-start; }
.card-head p { margin-top: 3px; font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 15px 16px; }
.kpi-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
.kpi-value { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; margin: 4px 0 2px; font-family: var(--mono); }
.kpi-value .muted { font-size: 14px; font-weight: 400; }
.kpi-sub { color: #7486a4; font-size: 11px; }

/* Pills and badges */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-family: var(--mono);
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.pill.is-safe { color: var(--mint); border-color: rgba(62, 224, 163, 0.3); background: var(--mint-dim); }
.pill.is-danger { color: var(--red); border-color: rgba(255, 98, 114, 0.35); background: var(--red-dim); }
.pill.is-muted { color: var(--muted); background: rgba(255, 255, 255, 0.03); }

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-clear, .status-safe, .status-ok, .status-executed, .status-completed, .status-closed {
    color: var(--mint); border-color: rgba(62, 224, 163, 0.32); background: var(--mint-dim);
}
.status-conditional, .status-warn, .status-proposed, .status-ticket, .status-host, .status-skipped, .status-running, .status-auto {
    color: var(--amber); border-color: rgba(255, 184, 77, 0.32); background: var(--amber-dim);
}
.status-kill, .status-error, .status-failed, .status-halted, .status-halt, .status-rejected, .status-blocked, .status-llm_error, .status-parse_failed, .status-human {
    color: var(--red); border-color: rgba(255, 98, 114, 0.32); background: var(--red-dim);
}
.status-blind, .status-muted, .status-unknown, .status-relay, .status-approved, .status-filled {
    color: #9fb0cc; border-color: var(--border); background: rgba(255, 255, 255, 0.04);
}
.status-approved { color: var(--blue); border-color: rgba(107, 148, 255, 0.32); background: var(--blue-dim); }

.seat-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 0;
    max-width: 100%;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(107, 148, 255, 0.12);
    border: 1px solid rgba(107, 148, 255, 0.26);
    color: #b8caff;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}
.seat-badge.seat-relay { background: rgba(178, 141, 255, 0.12); border-color: rgba(178, 141, 255, 0.3); color: #d6c2ff; }

/* Buttons and forms */
.button {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.button:hover { background: #1c2c4a; border-color: #2c3f66; }
.button:active { transform: translateY(1px); }
.button-primary {
    background: linear-gradient(135deg, #3ee0a3, #23a97e);
    border-color: transparent;
    color: #04130d;
}
.button-primary:hover { background: linear-gradient(135deg, #5aecb5, #2dbb8d); border-color: transparent; }
.button-ghost { background: rgba(255, 255, 255, 0.03); color: #c4d0e4; }
.button-danger { background: var(--red); border-color: transparent; color: #1a0306; }
.button-danger:hover { background: #ff7b89; border-color: transparent; }
.button-danger-ghost { background: var(--red-dim); border-color: rgba(255, 98, 114, 0.35); color: #ffb3ba; }
.button-small { padding: 4px 9px; font-size: 11px; }
.button-block { width: 100%; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-grow { flex: 1; min-width: 200px; }
.field input, .field select, .field textarea {
    background: rgba(5, 9, 18, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 11px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(107, 148, 255, 0.16); }
.field input::placeholder { color: #52627f; }

.choice {
    display: flex; gap: 10px; align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}
.choice.is-selected { border-color: rgba(107, 148, 255, 0.45); background: var(--blue-dim); }
.choice input { margin-top: 3px; accent-color: var(--blue); }
.choice span { display: flex; flex-direction: column; gap: 2px; }
.choice strong { font-family: var(--mono); font-size: 12.5px; }
.choice small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }

.rule { border: 0; border-top: 1px solid var(--border-soft); margin: 16px 0; }
.note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.02);
}

/* Scheduler install lines: selectable text plus a copy button */
.code-block {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(4, 9, 20, 0.55);
}
.code-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.code-text {
    margin: 0 0 8px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    color: #cfe1ff;
    -webkit-user-select: all;
    user-select: all;
}

/* Flash and banner */
.flash {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    border: 1px solid var(--border);
    font-size: 13px;
}
.flash-success { color: var(--mint); border-color: rgba(62, 224, 163, 0.35); background: var(--mint-dim); }
.flash-error { color: #ffb3ba; border-color: rgba(255, 98, 114, 0.38); background: var(--red-dim); }
.flash-info { color: #c4d0e4; background: var(--blue-dim); border-color: rgba(107, 148, 255, 0.3); }

.banner {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    border-radius: var(--radius);
    padding: 14px 18px;
    border: 1px solid rgba(255, 98, 114, 0.4);
    background: linear-gradient(90deg, rgba(255, 98, 114, 0.14), rgba(255, 98, 114, 0.04));
    color: #ffc7cc;
}
.banner strong { color: #fff; }

/* Lists, tables, feeds */
.empty {
    padding: 22px 12px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
    text-align: left;
    padding: 9px 11px;
    color: #7f90ad;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(6, 10, 20, 0.5);
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}
.table td { padding: 9px 11px; border-bottom: 1px solid rgba(34, 49, 79, 0.45); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table-config td:first-child { width: 42%; color: #aab8d0; }
.row-error td { background: rgba(255, 98, 114, 0.06); }
.table-leads td { max-width: 260px; }

.def-list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.def-list > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed rgba(34, 49, 79, 0.55); padding-bottom: 7px; }
.def-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.def-list dt { color: var(--muted); font-size: 12px; }
.def-list dd { margin: 0; text-align: right; font-size: 12.5px; max-width: 70%; word-break: break-word; }

.ticket-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border-soft);
    border-left: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(5, 9, 18, 0.42);
}
.feed-compact .feed-item { grid-template-columns: 140px minmax(0, 1fr); }
.feed-seat { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.role-tag {
    font-family: var(--mono);
    font-size: 9.5px;
    color: #61718e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.feed-body { min-width: 0; }
.feed-body.is-blind { border-left: 2px solid rgba(255, 98, 114, 0.5); padding-left: 10px; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 10.5px; color: #6d7f9d; margin-bottom: 4px; }
.feed-text { font-size: 13px; word-break: break-word; }
.feed-text a { word-break: break-all; }
.role { font-family: var(--mono); font-size: 10px; color: #6d7f9d; }

.status-tag {
    font-family: var(--mono);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: #93a4c0;
    text-transform: uppercase;
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 11.5px;
    font-family: var(--mono);
}
.tab:hover { color: var(--text); border-color: #2c3f66; }
.tab.is-active { color: #dbe6ff; border-color: rgba(107, 148, 255, 0.45); background: var(--blue-dim); }
.tab-count {
    display: inline-block;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    padding: 0 5px;
    font-size: 10px;
}

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.hstack { display: flex; gap: 18px; margin: 0; flex-wrap: wrap; }
.stat { text-align: right; }
.stat dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
.stat dd { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 650; }

.evidence-cell details summary, .ledger-detail summary, .card details summary {
    cursor: pointer;
    color: var(--blue);
    font-size: 12px;
}
.json {
    margin: 8px 0 0;
    padding: 10px;
    background: rgba(3, 7, 14, 0.72);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 320px;
    white-space: pre;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.timeline-item { position: relative; }
.timeline-item::before {
    content: "";
    position: absolute; left: -19px; top: 5px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--panel-2); border: 2px solid var(--border);
}
.timeline-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: #c3cfe2; }
.steps { margin: 6px 0 12px; padding-left: 20px; font-size: 13px; color: #d6e0f0; display: flex; flex-direction: column; gap: 4px; }

.breadcrumb { font-size: 12px; color: var(--muted); }
.phrase-box {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    background: rgba(3, 7, 14, 0.7);
    border: 1px dashed rgba(62, 224, 163, 0.35);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 10px 0 14px;
}
.phrase-box code { background: none; border: 0; padding: 0; color: var(--mint); font-size: 12.5px; word-break: break-all; }

.ledger-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ledger-row {
    display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}
.ledger-row .seq { color: var(--muted); min-width: 52px; }
.ledger-detail { margin-left: auto; }

.section-title { margin: 20px 0 8px; color: #aab8d0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

.error-card { text-align: center; padding: 48px 24px; }
.error-code { font-family: var(--mono); font-size: 56px; font-weight: 700; color: var(--border); line-height: 1; margin-bottom: 12px; }

/* Auth */
.auth-body { display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.auth-brand strong { display: block; font-size: 18px; }
.auth-brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-card {
    background: linear-gradient(180deg, rgba(22, 34, 58, 0.94), rgba(13, 20, 36, 0.98));
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-card h1 { font-size: 19px; }
.auth-card .form { margin-top: 4px; }
.auth-note { color: #6d7f9d; font-size: 11px; line-height: 1.6; }
.auth-foot { text-align: center; color: #5f7090; font-size: 10.5px; font-family: var(--mono); letter-spacing: 0.04em; }

/* Responsive */
@media (max-width: 1280px) {
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
        height: 100dvh;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(3, 6, 12, 0.55);
        cursor: pointer;
    }
    .icon-button { display: flex; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .content { padding: 18px 16px 30px; }
    .topbar { padding: 12px 16px; }
    .topbar-actions #pill-data { display: none; }
}

@media (max-width: 720px) {
    .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feed-item, .feed-compact .feed-item { grid-template-columns: minmax(0, 1fr); }
    .feed-seat { flex-direction: row; align-items: center; }
    .topbar-actions form .button { padding: 7px 10px; font-size: 11px; }
    .topbar-title p { display: none; }
    .footer { flex-direction: column; gap: 4px; }
    .def-list > div { flex-direction: column; gap: 3px; }
    .def-list dd { text-align: left; max-width: 100%; }
}

/* Live wallet */
.mode-chip.is-warn { color: var(--amber); border-color: rgba(255, 184, 77, 0.34); background: var(--amber-dim); }
.pill.is-warn { color: var(--amber); border-color: rgba(255, 184, 77, 0.34); background: var(--amber-dim); }

.wallet-widget {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 4px 3px 3px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
}

.wallet-chip {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--mint);
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(62, 224, 163, 0.3);
    background: var(--mint-dim);
    white-space: nowrap;
}

.wallet-widget[data-armed="0"] .wallet-chip { color: var(--amber); border-color: rgba(255, 184, 77, 0.32); background: var(--amber-dim); }

.wallet-modal {
    width: min(520px, calc(100vw - 32px));
    max-height: min(86vh, 760px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22, 34, 58, 0.99), rgba(13, 20, 36, 1));
    color: var(--text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.wallet-modal::backdrop { background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(3px); }
.wallet-modal h2 { font-size: 17px; margin: 0 40px 12px 0; }
.wallet-modal-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.wallet-modal-close .icon-button { display: flex; padding: 0; font-size: 20px; line-height: 1; align-items: center; justify-content: center; }
.wallet-modal-body { display: flex; flex-direction: column; gap: 10px; }
.wallet-modal-body .def-list { margin: 0; }
.wallet-modal-body .link { font-size: 12.5px; }
.wallet-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.wallet-modal-actions .button { min-width: 110px; }

.wallet-status {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--blue);
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(107, 148, 255, 0.3);
    background: var(--blue-dim);
}
.wallet-status::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; box-shadow: 0 0 8px currentColor;
    animation: wallet-pulse 1.2s ease-in-out infinite;
}
@keyframes wallet-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.wallet-error {
    font-size: 12.5px;
    color: #ffc7cc;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 98, 114, 0.4);
    background: var(--red-dim);
}

@media (max-width: 720px) {
    .wallet-widget { order: -1; }
    .wallet-chip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
    .wallet-modal { padding: 16px; }
    .wallet-modal-actions .button { flex: 1; min-width: 0; }
}

/* Installable app shell */
.label-short { display: none; }

.install-button {
    display: flex; align-items: center; gap: 9px;
    width: 100%;
    padding: 8px 11px;
    border: 1px solid rgba(62, 224, 163, 0.28);
    border-radius: var(--radius-sm);
    background: rgba(62, 224, 163, 0.07);
    color: #a9e9d3;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.install-button:hover { background: rgba(62, 224, 163, 0.13); border-color: rgba(62, 224, 163, 0.42); }
.install-button[hidden] { display: none; }
.install-glyph {
    position: relative;
    width: 15px; height: 13px;
    border: 1.5px solid currentColor;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    flex: 0 0 auto;
}
.install-glyph::before {
    content: "";
    position: absolute;
    left: 50%; top: -7px;
    width: 1.5px; height: 8px;
    background: currentColor;
    transform: translateX(-50%);
}
.install-glyph::after {
    content: "";
    position: absolute;
    left: 50%; top: -3px;
    width: 5px; height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateX(-50%) rotate(45deg);
}

.install-modal {
    width: min(470px, calc(100vw - 28px));
    max-height: min(86vh, 720px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22, 34, 58, 0.99), rgba(13, 20, 36, 1));
    color: var(--text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.install-modal::backdrop { background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(3px); }
.install-modal h2 { font-size: 17px; margin: 0 40px 8px 0; }
.install-steps {
    margin: 14px 0 4px;
    padding-left: 18px;
    display: flex; flex-direction: column; gap: 10px;
    color: #c6d2e6;
    font-size: 12.5px;
}
.install-steps em { color: var(--mint); font-style: normal; }

.mobile-nav { display: none; }
.sidebar-scrim { display: none; }

.offline-shell { width: min(460px, 100%); }
.offline-card { display: flex; flex-direction: column; gap: 12px; }
.offline-card h1 { font-size: 18px; }
.offline-card .muted { font-size: 13px; line-height: 1.6; }
.offline-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.offline-actions .button { flex: 1; min-width: 130px; justify-content: center; text-align: center; }

/* Mobile: keep essentials, drop the rest */
@media (max-width: 720px) {
    body { min-height: 100dvh; }

    .content { padding: 14px 12px 20px; gap: 12px; }
    .card { padding: 14px; border-radius: 12px; }
    .card-head { margin-bottom: 10px; }
    h1 { font-size: 18px; }

    .topbar { gap: 9px; padding: 9px 12px; }
    .topbar-title { min-width: 0; }
    .topbar-title h1 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-actions { gap: 6px; flex-wrap: nowrap; }
    .topbar-actions .pill { display: none; }
    .topbar-actions .pill.is-danger, .topbar-actions .pill.is-warn { display: inline-flex; }
    .topbar-actions .button { padding: 6px 9px; font-size: 11px; }
    .label-full { display: none; }
    .label-short { display: inline; }
    .wallet-widget { padding: 2px; }
    .wallet-chip { max-width: 100px; font-size: 10px; padding: 2px 7px; }
    .wallet-widget #wallet-disconnect-button { flex: 0 0 auto; font-size: 11.5px; }

    .kpi { padding: 12px 13px; }
    .kpi-value { font-size: 19px; }
    .kpi-label { font-size: 10px; }
    .kpi-grid, .kpi-grid-4 { gap: 9px; }

    .nav { gap: 2px; scrollbar-width: thin; scrollbar-color: #33415f transparent; }
    .nav-link { padding: 9px 12px; font-size: 13px; }
    .nav-label { display: none; }
    .sidebar { gap: 12px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }
    .brand-text small { font-size: 9.5px; letter-spacing: 0.04em; }
    body.sidebar-open .mobile-nav { display: none; }
    .button { min-height: 40px; }
    .link-button { min-height: 34px; }

    .footer { display: none; }
    .shell { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

    .mobile-nav {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 45;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
        background: rgba(10, 16, 29, 0.99);
        border-top: 1px solid var(--border-soft);
        backdrop-filter: blur(14px);
    }
    .mobile-nav-link {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px;
        min-height: 46px;
        padding: 4px 2px;
        border: 0;
        border-radius: 8px;
        background: none;
        color: #8494b0;
        font: inherit;
        font-size: 9.5px;
        letter-spacing: 0.01em;
        cursor: pointer;
    }
    .mobile-nav-link svg {
        width: 20px; height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .mobile-nav-link.is-active { color: var(--mint); }

    .auth-body { padding: 16px; }
    .auth-card { padding: 20px; }
    .auth-foot { font-size: 10px; }
    .install-modal { padding: 16px; }
}

/* Standalone PWA: respect notches and home indicators */
@supports (padding: max(0px)) {
    .sidebar {
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
        padding-left: max(14px, env(safe-area-inset-left));
    }
    .auth-body {
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    @media (max-width: 720px) {
        .topbar { padding-top: max(9px, env(safe-area-inset-top)); }
        .content {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
        }
        .mobile-nav { padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
    }
}
