/* ===========================================================================
   Astrium Wallet — end-user theme (light + dark, like astrium.co.za)
   :root holds the LIGHT palette; [data-theme="dark"] overrides to dark.
   Orbitron (display) / Inter (body) / JetBrains Mono (data), steel-blue accent.
   =========================================================================== */

:root {
    /* theme-agnostic */
    --accent: #8a9bb5;
    --accent-rgb: 138, 155, 181;
    --positive: #15803d;
    --positive-rgb: 21, 128, 61;
    --danger: #f4796b;
    --danger-rgb: 244, 121, 107;
    --radius: 14px;
    --radius-sm: 9px;
    --font-display: 'Orbitron', 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* LIGHT palette (default) */
    --bg: #f8f9fc;
    --bg-deep: #eef1f7;
    --bg2: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --bright: #1a2332;
    --text: #4a5568;
    --muted: #8898aa;
    --accent-bright: #5b6b86;
    --border: rgba(120, 140, 170, 0.28);
    --border-strong: rgba(120, 140, 170, 0.4);
    --glow: rgba(var(--accent-rgb), 0.25);
    --topbar-bg: rgba(255, 255, 255, 0.82);
    --card-shadow: 0 8px 30px rgba(40, 55, 80, 0.08);
    --err-bg: rgba(var(--danger-rgb), 0.12);
    --err-text: #c0392b;
    --ok-bg: rgba(var(--positive-rgb), 0.12);
    --ok-text: #15803d;
    --btn-ink: #0a0d1a;
}

[data-theme="dark"] {
    --positive: #22c55e;
    --positive-rgb: 34, 197, 94;
    --bg: #0f1219;
    --bg-deep: #0a0d1a;
    --bg2: #161b26;
    --surface: rgba(22, 27, 38, 0.66);
    --bright: #e8ecf2;
    --text: #b0b8c8;
    --muted: #7a8599;
    --accent-bright: #b6c4d8;
    --border: rgba(180, 195, 215, 0.12);
    --border-strong: rgba(180, 195, 215, 0.22);
    --glow: rgba(var(--accent-rgb), 0.22);
    --topbar-bg: rgba(10, 13, 26, 0.85);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
    --err-bg: rgba(var(--danger-rgb), 0.1);
    --err-text: #f7a99e;
    --ok-bg: rgba(var(--positive-rgb), 0.1);
    --ok-text: #6ee7a0;
    --btn-ink: #0a0d1a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}
/* subtle cool radial light fields */
:root:not([data-theme="dark"]) body {
    background-image:
        radial-gradient(circle at 18% 18%, rgba(138, 155, 181, 0.10), transparent 42%),
        radial-gradient(circle at 84% 26%, rgba(110, 127, 153, 0.07), transparent 46%);
}
[data-theme="dark"] body {
    background-image:
        radial-gradient(circle at 18% 20%, rgba(140, 160, 185, 0.05), transparent 42%),
        radial-gradient(circle at 82% 28%, rgba(110, 127, 153, 0.045), transparent 45%),
        radial-gradient(circle at 50% 92%, rgba(140, 160, 185, 0.03), transparent 50%);
}

h1:focus { outline: none; }
a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: var(--bright); }

/* ---- app shell ---- */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0.85rem 1.75rem;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.topbar .brand {
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--bright);
    display: flex; align-items: center; gap: 0.55rem;
}
.brand-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 8px;
    box-shadow: 0 0 18px 1px var(--glow);
}
.topbar .nav { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; }
.topbar .nav a {
    color: var(--muted); font-size: 0.9rem; padding: 0.2rem 0;
    border-bottom: 1px solid transparent; transition: color 0.15s ease, border-color 0.15s ease;
}
.topbar .nav a:hover { color: var(--bright); border-bottom-color: rgba(var(--accent-rgb), 0.6); }
.topbar .nav .who { color: var(--accent); font-size: 0.8rem; font-family: var(--font-mono); }
.account-menu {
    display: inline-flex;
    align-items: center;
    align-self: center;
    position: relative;
}
.account-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: min(260px, 32vw);
    min-height: 34px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0 0.45rem 0 0.55rem;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1;
    list-style: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-menu summary::-webkit-details-marker {
    display: none;
}
.account-menu summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}
.account-menu[open] summary {
    border-color: rgba(var(--accent-rgb), 0.28);
    color: var(--bright);
    background: rgba(var(--accent-rgb), 0.08);
}
.account-menu-panel {
    position: absolute;
    top: calc(100% + 1.5rem);
    right: 0;
    z-index: 40;
    display: grid;
    width: 172px;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg2);
    box-shadow: var(--card-shadow);
}
.topbar .nav .account-menu-panel a,
.topbar .nav .account-menu-panel .account-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 32px;
    border: 0;
    border-bottom: 0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.topbar .nav .account-menu-panel a:hover,
.topbar .nav .account-menu-panel .account-menu-item:hover {
    color: var(--bright);
    background: rgba(var(--accent-rgb), 0.08);
}

/* theme toggle */
.theme-toggle {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text);
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer; line-height: 1;
    font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--bright); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline; }
[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.content { padding: 2rem 1.5rem 3rem; max-width: 920px; width: 100%; margin: 0 auto; }

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    align-items: end;
    margin: 0.25rem 0 1.2rem;
}
.page-kicker {
    margin: 0 0 0.45rem;
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.page-header h1 {
    margin: 0;
    color: var(--bright);
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1.1;
    letter-spacing: 0;
}
.page-header .muted {
    margin: 0.55rem 0 0;
}

/* ---- public homepage ---- */
.home-page {
    margin: -2rem calc(50% - 50vw) -3rem;
    overflow: hidden;
}
.home-hero {
    min-height: min(760px, calc(100svh - 160px));
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(2rem, 4vw, 3.4rem) clamp(1.25rem, 5vw, 5.5rem);
    background:
        linear-gradient(90deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.76) 43%, rgba(8, 12, 22, 0.28) 100%),
        url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1800&q=82") center / cover;
    color: #f8fbff;
}
.home-hero-copy {
    max-width: 720px;
    animation: home-rise 520ms ease-out both;
}
.home-kicker {
    margin: 0 0 0.85rem;
    color: #b8c7da;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.home-hero h1,
.home-section h2 {
    margin: 0;
    color: inherit;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0;
}
.home-hero h1 {
    max-width: 830px;
    font-size: 3.55rem;
}
.home-lede {
    max-width: 610px;
    margin: 1.25rem 0 0;
    color: rgba(248, 251, 255, 0.82);
    font-size: 1.08rem;
    line-height: 1.7;
}
.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin-top: 1.6rem;
}
.home-primary,
.home-secondary {
    min-height: 44px;
}
.home-secondary {
    border-color: rgba(255, 255, 255, 0.42) !important;
    color: #f8fbff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}
.home-ledger-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 650px;
    margin: 1.65rem 0 0;
    padding: 0;
}
.home-ledger-strip div {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 0.85rem;
}
.home-ledger-strip dt {
    margin: 0;
    color: #ffffff;
    font-weight: 700;
}
.home-ledger-strip dd {
    margin: 0.2rem 0 0;
    color: rgba(248, 251, 255, 0.65);
    font-size: 0.9rem;
}
.home-visual {
    position: relative;
    min-height: 520px;
    animation: home-fade 720ms 160ms ease-out both;
}
.home-visual-photo {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background:
        linear-gradient(160deg, rgba(6, 10, 18, 0.12), rgba(6, 10, 18, 0.76)),
        url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1400&q=82") center / cover;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
}
.wallet-device {
    position: absolute;
    right: clamp(1rem, 5vw, 4rem);
    bottom: clamp(1rem, 4vw, 3rem);
    width: min(300px, 58vw);
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 24px;
    background: rgba(9, 15, 27, 0.82);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
}
.device-topline,
.device-balance {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.device-topline {
    color: rgba(248, 251, 255, 0.66);
    font-size: 0.76rem;
    font-family: var(--font-mono);
}
.device-balance {
    display: block;
    margin-top: 2.2rem;
}
.device-balance span {
    display: block;
    color: rgba(248, 251, 255, 0.62);
    font-size: 0.78rem;
}
.device-balance strong {
    display: block;
    margin-top: 0.3rem;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 2rem;
}
.device-ledger {
    display: grid;
    gap: 0.55rem;
    margin-top: 1.6rem;
}
.device-ledger span {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.08));
}
.device-ledger span:nth-child(2) { width: 78%; }
.device-ledger span:nth-child(3) { width: 52%; }
.wallet-card-preview {
    position: absolute;
    left: clamp(0.8rem, 4vw, 3rem);
    top: clamp(1rem, 6vw, 5rem);
    width: min(270px, 58vw);
    min-height: 150px;
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(216, 226, 239, 0.96), rgba(122, 146, 178, 0.84));
    color: #0a0d1a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.wallet-card-preview span {
    display: block;
    color: rgba(10, 13, 26, 0.62);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.wallet-card-preview strong {
    display: block;
    margin-top: 3.6rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
}
.home-section {
    padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 6vw, 7rem);
    background: var(--bg);
    color: var(--text);
}
.home-section .home-kicker {
    color: var(--accent-bright);
}
.home-section h2 {
    color: var(--bright);
    font-size: 3.35rem;
}
.home-split {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1.18fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: start;
}
.home-mode-list {
    display: grid;
    gap: 1.35rem;
}
.home-mode-list article {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.home-mode-list span {
    display: block;
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.home-mode-list h3 {
    margin: 0.35rem 0 0.4rem;
    color: var(--bright);
    font-size: 1.2rem;
}
.home-mode-list p,
.workflow-copy p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
}
.home-workflow {
    display: grid;
    grid-template-columns: minmax(300px, 0.92fr) minmax(320px, 1.08fr);
    gap: clamp(2rem, 6vw, 6rem);
    background: var(--bg-deep);
}
.workflow-copy p {
    margin-top: 1.1rem;
    max-width: 620px;
}
.workflow-steps {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}
.workflow-steps li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1.15rem 0;
    border-top: 1px solid var(--border);
    color: var(--bright);
    font-size: 1.05rem;
    line-height: 1.5;
}
.workflow-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-bright);
    font-family: var(--font-mono);
}
.home-final {
    min-height: 420px;
    display: grid;
    align-content: center;
    justify-items: start;
    background:
        linear-gradient(110deg, rgba(10, 13, 26, 0.9), rgba(10, 13, 26, 0.58)),
        url("https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=1800&q=82") center / cover;
    color: #f8fbff;
}
.home-final h2 {
    max-width: 900px;
    color: #ffffff;
}
@keyframes home-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes home-fade {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- cards ---- */
.card {
    background: var(--surface); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem 1.6rem; margin-bottom: 1.4rem;
    box-shadow: var(--card-shadow);
}
.card h2 {
    margin: 0 0 0.35rem; font-family: var(--font-display); font-weight: 600;
    font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bright);
}
.card h3 {
    margin: 1.15rem 0 0.25rem;
    color: var(--bright);
    font-size: 0.95rem;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1rem 0 1.2rem;
}
.metric-grid > div {
    border-top: 1px solid var(--border);
    padding-top: 0.7rem;
}
.metric-grid strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--bright);
    font-family: var(--font-mono);
    font-size: 1.05rem;
}
.metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.2rem;
}
.form-grid section {
    min-width: 0;
}

/* ---- security ---- */
.security-enrollment {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
    margin-top: 1.2rem;
}
.qr-panel {
    margin: 0;
}
.qr-code {
    display: grid;
    place-items: center;
    width: min(100%, 240px);
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--card-shadow);
}
.qr-code svg {
    display: block;
    width: 100%;
    height: auto;
}
.qr-panel figcaption {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
    color: var(--text);
    line-height: 1.45;
}
.qr-panel figcaption strong {
    color: var(--bright);
}
.qr-panel figcaption span {
    color: var(--muted);
    font-size: 0.9rem;
}
.manual-key-panel {
    min-width: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
}
.manual-key-panel .muted {
    margin: 0.4rem 0 0;
}
.otp-uri-details {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
}
.otp-uri-details summary {
    color: var(--accent-bright);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}
.otp-uri-details summary:hover {
    color: var(--bright);
}

/* ---- forms ---- */
label {
    display: block; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--muted); margin: 0.9rem 0 0.3rem;
}
input, select {
    width: 100%; padding: 0.6rem 0.75rem; background: var(--bg2); color: var(--bright);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: var(--font-body);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
select option { background: var(--bg2); color: var(--bright); }

/* ---- buttons ---- */
button.btn, .btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-bright));
    color: var(--btn-ink); border: none; border-radius: var(--radius-sm);
    padding: 0.6rem 1.25rem; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em;
    cursor: pointer; margin-top: 0.95rem;
    transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease;
    box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.22);
}
button.btn:hover { filter: brightness(1.08); box-shadow: 0 6px 26px rgba(var(--accent-rgb), 0.34); transform: translateY(-1px); }
button.btn:active { transform: translateY(0); }
button.btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; transform: none; filter: none; }
button.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
button.btn.secondary:hover { color: var(--bright); border-color: var(--accent); filter: none; }

button.link {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 0.9rem; font-family: var(--font-body); padding: 0; transition: color 0.15s ease;
}
button.link:hover { color: var(--bright); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- tabs ---- */
.tabs {
    display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.tabs button {
    background: transparent; border: 0; border-bottom: 2px solid transparent;
    color: var(--muted); cursor: pointer; font: inherit; font-weight: 600;
    padding: 0.65rem 0.25rem; margin: 0 0 -1px;
}
.tabs button:hover { color: var(--bright); }
.tabs button.active {
    color: var(--bright);
    border-bottom-color: var(--accent-bright);
}

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.65rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(var(--accent-rgb), 0.06); }

.amount { font-family: var(--font-mono); font-weight: 500; color: var(--bright); }
.amount.positive { color: var(--positive); }
.amount.negative { color: var(--danger); }
.table-action {
    font-size: 0.85rem;
    font-weight: 600;
}
.table-meta {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
}
.technical-details {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.technical-details summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
}
.technical-details summary:hover {
    color: var(--bright);
}
.technical-detail-list {
    display: grid;
    gap: 0.65rem;
    margin: 0.75rem 0 0;
}
.technical-detail-list div {
    min-width: 0;
}
.technical-detail-list dt {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.technical-detail-list dd {
    margin: 0.2rem 0 0;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.status-pill.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}
.status-pill.muted {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--muted);
}
.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* ---- wallet detail ---- */
.wallet-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.2rem;
    align-items: end;
    margin-bottom: 1.2rem;
    padding: 0.6rem 0 0.2rem;
}
.back-link {
    display: inline-block;
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.back-link:hover {
    color: var(--bright);
}
.wallet-detail-type {
    margin: 0 0 0.45rem;
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.wallet-detail-hero h1 {
    margin: 0;
    color: var(--bright);
    font-family: var(--font-display);
    font-size: 2.25rem;
    line-height: 1.1;
    letter-spacing: 0;
}
.wallet-detail-balance {
    margin: 0.7rem 0 0;
    color: var(--positive);
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
}
.wallet-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 1.1rem;
    margin: 1rem 0 0;
}
.detail-grid div {
    min-width: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.detail-grid dt {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.detail-grid dd {
    margin: 0.3rem 0 0;
    color: var(--bright);
}
.table-scroll {
    overflow-x: auto;
    margin-top: 0.85rem;
}
.transaction-table {
    min-width: 760px;
}
.transaction-table.wide {
    min-width: 980px;
}
.wallet-return-alert {
    display: grid;
    gap: 0.35rem;
}
.wallet-return-alert .refresh-link {
    justify-self: start;
    color: var(--ok-text);
    font-weight: 700;
}
.wallet-return-alert .refresh-link:hover {
    color: var(--bright);
}

/* ---- alerts ---- */
.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); margin: 0.85rem 0; font-size: 0.9rem; border: 1px solid transparent; }
.alert.error { background: var(--err-bg); color: var(--err-text); border-color: rgba(var(--danger-rgb), 0.35); }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); border-color: rgba(var(--positive-rgb), 0.32); }

.muted { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-bright); word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
@media (max-width: 1180px) {
    .home-hero h1 {
        font-size: 3.45rem;
    }
    .home-section h2 {
        font-size: 2.85rem;
    }
    .home-visual {
        min-height: 460px;
    }
}
@media (max-width: 980px) {
    .content {
        max-width: 100%;
    }
    .home-hero,
    .home-split,
    .home-workflow {
        grid-template-columns: 1fr;
    }
    .home-hero {
        min-height: auto;
        padding-top: 3.5rem;
    }
    .home-hero h1 {
        font-size: 3rem;
    }
    .home-section h2 {
        font-size: 2.55rem;
    }
    .home-visual {
        min-height: 430px;
    }
}
@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.85rem 1rem;
        position: static;
    }
    .topbar .nav {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
    }
    .account-menu-panel {
        left: 0;
        right: auto;
    }
    .account-menu summary {
        width: min(280px, calc(100vw - 2rem));
    }
    .page-header {
        display: block;
    }
    .page-header h1 {
        font-size: 1.75rem;
    }
    .content {
        padding: 1.25rem 1rem 2.5rem;
    }
    .home-page {
        margin: -1.25rem -1rem -2.5rem;
    }
    .home-hero,
    .home-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .home-hero {
        min-height: calc(100svh - 160px);
        align-content: center;
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }
    .home-hero h1 {
        font-size: 2.05rem;
        line-height: 1.04;
    }
    .home-lede {
        margin-top: 0.85rem;
        font-size: 0.94rem;
        line-height: 1.55;
    }
    .home-actions {
        gap: 0.55rem;
        margin-top: 0.95rem;
    }
    .home-ledger-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        margin-top: 1rem;
    }
    .home-ledger-strip div {
        padding-top: 0.5rem;
    }
    .home-ledger-strip dt {
        font-size: 0.8rem;
    }
    .home-ledger-strip dd {
        font-size: 0.72rem;
    }
    .home-visual {
        display: none;
    }
    .home-section h2 {
        font-size: 2rem;
    }
    .home-visual-photo {
        border-radius: 18px;
    }
    .wallet-device {
        right: 0.8rem;
        width: min(280px, 72vw);
    }
    .wallet-card-preview {
        left: 0.8rem;
        width: min(240px, 70vw);
    }
    .metric-grid,
    .form-grid,
    .detail-grid,
    .security-enrollment {
        grid-template-columns: 1fr;
    }
    .wallet-detail-hero {
        grid-template-columns: 1fr;
    }
    .wallet-detail-actions {
        justify-content: flex-start;
    }
    .wallet-detail-hero h1 {
        font-size: 1.75rem;
    }
    .wallet-detail-balance {
        font-size: 1.55rem;
    }
    .qr-code {
        width: min(100%, 220px);
    }
}

/* ---- framework: validation + error UI ---- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--positive); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }
.blazor-error-boundary {
    background: var(--err-bg); border: 1px solid rgba(var(--danger-rgb), 0.4);
    border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; color: var(--err-text);
}
.blazor-error-boundary::after { content: "An error has occurred."; }
#blazor-error-ui {
    background: var(--bg2); border-top: 1px solid rgba(var(--danger-rgb), 0.5);
    bottom: 0; left: 0; right: 0; box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.25);
    display: none; padding: 0.8rem 1.25rem; position: fixed; width: 100%; z-index: 1000; color: var(--text);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: 0.6rem; color: var(--muted); }
#blazor-error-ui .reload { color: var(--accent-bright); }
