/* DexSpark design system — dark-mode fintech, ported from the MauiApp1 reference. */
:root {
    --bg-black: #000000;
    --bg-card: #1C1C1E;
    --bg-card-light: #2C2C2E;
    --bg-input: #000000;
    --accent: #D9F95F;
    --text-on-accent: #000000;
    --text-white: #FFFFFF;
    --text-grey: #8E8E93;
    --text-dark-grey: #636366;
    --positive: #5BD98A;
    --danger: #FC8181;
    --nav-height: 80px;
    --gutter: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
}

html, body {
    background: var(--bg-black);
    color: var(--text-white);
    overflow-x: hidden;
}

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

/* ---- Shell ---- */
.app-container { width: 100%; min-height: 100vh; background: var(--bg-black); position: relative; display: flex; flex-direction: column; }
.view-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 120px; max-width: 520px; margin: 0 auto; width: 100%; }
.view-content { width: 100%; animation: fadeIn .3s ease; }
.view-content-padding { padding: 0 var(--gutter); }
@keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

/* ---- Header ---- */
.app-header { padding: 50px var(--gutter) 10px; display: flex; justify-content: space-between; align-items: center; }
.profile-pic { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card-light); border: 1px solid #333; display: flex; align-items: center; justify-content: center; color: var(--text-grey); }
.header-actions { display: flex; gap: 16px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #ccc; border: none; cursor: pointer; transition: .2s; }
.icon-btn:active { transform: scale(.9); }

/* ---- Auto-refresh countdown button ---- */
.refresh-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.refresh-btn:active { transform: scale(.92); }
.refresh-ring { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); }
.refresh-ring-bg { fill: none; stroke: #333; stroke-width: 3; }
.refresh-ring-fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100.5; transition: stroke-dashoffset 1s linear; }
.refresh-count { font-size: 13px; font-weight: 600; color: var(--text-white); }

/* ---- Asset icon + network badge (official brand logos, inline SVG) ---- */
.asset-icon-stack { position: relative; flex-shrink: 0; }
.token-disc { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.token-logo { display: block; width: 100%; height: 100%; }
.token-logo svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.asset-chain-badge { position: absolute; right: -3px; bottom: -3px; width: 46%; height: 46%; min-width: 16px; min-height: 16px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--bg-card); overflow: hidden; box-sizing: border-box; }
.asset-chain-badge svg { display: block; width: 100%; height: 100%; }

/* ---- Page header (sub-pages) ---- */
.page-header-row { display: flex; align-items: center; gap: 16px; padding: 50px var(--gutter) 20px; }
.back-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; color: var(--text-white); border: none; cursor: pointer; flex-shrink: 0; }
.page-title-text { font-size: 20px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-title { font-size: 24px; font-weight: 600; padding: var(--gutter) var(--gutter) 0; }

/* ---- Balance hero ---- */
.balance-hero { padding: var(--gutter); }
.balance-label { color: var(--text-grey); font-size: 14px; margin-bottom: 8px; }
.balance-row { display: flex; align-items: center; gap: 12px; }
.balance-amount { font-size: 42px; font-weight: 500; letter-spacing: -1px; }
.balance-badge { background: #232325; color: var(--accent); padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }

/* ---- Action grid ---- */
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 var(--gutter) var(--gutter); }
.action-card { aspect-ratio: 1; border-radius: 20px; background: var(--bg-card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: none; color: var(--text-white); transition: .1s; }
.action-card.active { background: var(--accent); color: var(--text-on-accent); }
.action-card:active { transform: scale(.96); }
.action-icon { font-size: 22px; }
.action-label { font-size: 12px; font-weight: 500; }

/* ---- Section header ---- */
.section-header { padding: 0 var(--gutter) 16px; display: flex; justify-content: space-between; align-items: center; }
.section-title { font-size: 18px; font-weight: 500; }
.see-all { font-size: 14px; color: var(--accent); cursor: pointer; }

/* ---- Asset list (portfolio) ---- */
.asset-list { padding: 0 var(--gutter) 24px; display: flex; flex-direction: column; gap: 12px; }
.asset-card { background: var(--bg-card); padding: 16px; border-radius: 20px; display: flex; align-items: center; gap: 16px; }
.asset-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card-light); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.asset-main { flex: 1; }
.asset-name { font-size: 15px; font-weight: 500; }
.asset-sub { font-size: 12px; color: var(--text-grey); margin-top: 2px; }
.asset-right { text-align: right; }
.asset-value { font-size: 15px; font-weight: 500; }
.asset-amount { font-size: 12px; color: var(--text-grey); margin-top: 2px; }

/* ---- Transaction / activity list ---- */
.tx-list { padding: 0 var(--gutter) 40px; display: flex; flex-direction: column; gap: 12px; }
.tx-item { background: var(--bg-card); padding: 16px; border-radius: 20px; display: flex; align-items: center; gap: 16px; }
.tx-icon-box { width: 48px; height: 48px; border-radius: 16px; background: var(--bg-card-light); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #ddd; }
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.tx-time { font-size: 12px; color: var(--text-dark-grey); }
.tx-right { text-align: right; }
.tx-amount { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.tx-status { font-size: 12px; color: var(--text-dark-grey); }
.tx-status.ok { color: var(--positive); }
.tx-status.fail { color: var(--danger); }

/* ---- Asset detail ---- */
.asset-detail-head { text-align: center; padding: 12px 24px 24px; }
.asset-detail-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px; }
.asset-detail-balance { font-size: 32px; font-weight: 600; letter-spacing: -.5px; }
.asset-detail-usd { font-size: 15px; color: var(--text-grey); margin-top: 4px; }

/* ---- Activity ---- */
.date-header { padding: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-grey); }
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-list a.tx-item { text-decoration: none; color: inherit; }
.scroll-sentinel { display: flex; justify-content: center; padding: 20px; }

/* ---- Not-updated / failed-fetch warnings ---- */
.asset-card.stale { box-shadow: inset 3px 0 0 rgba(255,176,32,.7); }
.asset-warn-icon { color: #FFB020; font-size: 12px; margin-left: 6px; }
.asset-warn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #FFB020; }
.feed-warning { display: flex; align-items: center; gap: 10px; background: rgba(255,176,32,.12); color: #FFB020; border: 1px solid rgba(255,176,32,.3); border-radius: 14px; padding: 11px 14px; font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.feed-warning i { font-size: 15px; flex-shrink: 0; }

/* ---- Activity item v2 (date top-left, official logos, direction wash, confirmations) ---- */
.tx2-item { display: block; position: relative; overflow: hidden; background: var(--bg-card); border-radius: 20px; padding: 14px 16px; text-decoration: none; color: var(--text-white); border: 1px solid transparent; transition: .15s; }
a.tx2-item:active { transform: scale(.99); }
a.tx2-item:hover { border-color: #3A3A3C; }
/* Directional colour cue: a soft corner glow + a coloured left edge — kept well clear of the token logo. */
.tx2-item.dir-recv { background: linear-gradient(125deg, var(--bg-card) 56%, rgba(91,217,138,.16)); box-shadow: inset 3px 0 0 rgba(91,217,138,.6); }
.tx2-item.dir-send { background: linear-gradient(125deg, var(--bg-card) 56%, rgba(255,140,66,.16)); box-shadow: inset 3px 0 0 rgba(255,140,66,.6); }
.tx2-item.dir-swap { background: linear-gradient(125deg, var(--bg-card) 56%, rgba(217,249,95,.15)); box-shadow: inset 3px 0 0 rgba(217,249,95,.6); }
.tx2-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tx2-topleft { display: inline-flex; align-items: center; gap: 8px; }
.tx2-dirchip { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; flex-shrink: 0; }
.tx2-dirchip.recv { background: var(--positive); }
.tx2-dirchip.send { background: #FF8C42; }
.tx2-dirchip.swap { background: var(--accent); color: var(--text-on-accent); }
.tx2-when { font-size: 12px; color: var(--text-dark-grey); font-weight: 500; }
.tx2-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; background: #2A2A2C; color: var(--text-grey); }
.tx2-badge.ok { background: rgba(91,217,138,.14); color: var(--positive); }
.tx2-badge.pending { background: rgba(217,249,95,.14); color: var(--accent); }
.tx2-badge.fail { background: rgba(252,129,129,.14); color: var(--danger); }
.tx2-main { display: flex; align-items: center; gap: 14px; }
.tx2-icon-wrap { position: relative; flex-shrink: 0; }
.tx2-dir { position: absolute; left: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; border: 2px solid var(--bg-card); }
.tx2-dir.recv { background: var(--positive); }
.tx2-dir.send { background: #FF8C42; }
.tx2-swap-icons { display: flex; align-items: center; flex-shrink: 0; }
.tx2-swap-icons > :last-child { margin-left: -12px; }
/* Keep the FROM icon (and its network badge) painted above the overlapping TO icon. */
.tx2-swap-icons > :first-child { position: relative; z-index: 1; }
.tx2-info { flex: 1; min-width: 0; }
.tx2-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx2-sub { font-size: 12.5px; color: var(--text-grey); margin-top: 3px; }
.tx2-sub-arrow { font-size: 9px; margin: 0 2px; opacity: .7; }
.tx2-addr { color: var(--text-white); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; letter-spacing: -.2px; }
.tx2-right { text-align: right; flex-shrink: 0; }
.tx2-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tx2-amount.pos { color: var(--positive); }
.tx2-value { font-size: 12px; color: var(--text-grey); margin-top: 3px; white-space: nowrap; }
.tx2-value.pos { color: var(--positive); }
/* Swap receive amount, once the exact egress amount is locked in (outbound scheduled): bold it so the
   confirmed figure stands out from the still-grey estimate. */
.tx2-value.locked { font-weight: 700; }

/* ---- Transaction detail page ---- */
.txd-hero { text-align: center; padding: 12px 0 22px; }
.txd-kind { font-size: 14px; color: var(--text-grey); margin-top: 14px; }
.txd-amount { font-size: 34px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; }
.txd-amount.pos { color: var(--positive); }
.txd-usd { font-size: 15px; color: var(--text-grey); margin-top: 4px; }
.txd-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.txd-status.ok { background: rgba(91,217,138,.14); color: var(--positive); }
.txd-status.pending { background: rgba(217,249,95,.14); color: var(--accent); }
.txd-card { background: var(--bg-card); border-radius: 20px; padding: 6px 18px; }
.txd-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #2A2A2C; }
.txd-row:last-child { border-bottom: none; }
.txd-label { font-size: 13px; color: var(--text-grey); flex-shrink: 0; }
.txd-value { font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; text-align: right; }
.txd-copy { background: none; border: none; cursor: pointer; color: var(--text-white); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 0; }
.txd-copy i { color: var(--text-grey); font-size: 13px; }
.txd-mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: -.2px; }
.txd-explorer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 15px; border-radius: 16px; background: var(--bg-card-light); color: var(--text-white); font-weight: 600; font-size: 14px; text-decoration: none; }
.txd-explorer:active { transform: scale(.98); }

/* ---- Bottom dock ---- */
.dock-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); width: calc(100% - 48px); max-width: 472px; height: 80px; background: var(--bg-card); border-radius: 30px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; border: 1px solid #333; z-index: 100; }
.nav-item { flex: 1; height: 64px; display: flex; align-items: center; justify-content: center; color: var(--text-grey); font-size: 22px; border-radius: 22px; cursor: pointer; text-decoration: none; transition: .2s; }
.nav-item.active { background: var(--accent); color: var(--text-on-accent); flex: 0 0 64px; }
.nav-item:hover:not(.active) { color: white; }

/* ---- Buttons ---- */
.btn-primary { width: 100%; background: var(--accent); color: var(--text-on-accent); border: none; border-radius: 16px; padding: 18px; font-size: 16px; font-weight: 600; cursor: pointer; transition: .15s; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-ghost { width: 100%; background: var(--bg-card); color: var(--text-white); border: 1px solid #333; border-radius: 16px; padding: 16px; font-size: 15px; font-weight: 500; cursor: pointer; }

/* ---- Cards / forms ---- */
.card { background: var(--bg-card); color: var(--text-white); border-radius: 24px; padding: 20px; }
.form-card { background: var(--bg-card); color: var(--text-white); border-radius: 24px; padding: 20px; margin-bottom: 16px; }
.field-label { font-size: 13px; color: var(--text-grey); margin-bottom: 10px; display: block; }
.input-row { background: var(--bg-input); padding: 4px 16px; border-radius: 16px; min-height: 56px; display: flex; align-items: center; gap: 12px; }
.text-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text-white); font-size: 16px; }
.text-input::placeholder { color: #555; }
.amount-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text-white); font-size: 24px; font-weight: 600; text-align: right; }
.input-row .muted { flex-shrink: 0; white-space: nowrap; }

/* ---- Swap ---- */
.swap-card { background: var(--bg-card); border-radius: 24px; padding: 20px; }
.swap-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-grey); margin-bottom: 14px; }
.swap-header-left { display: flex; align-items: center; gap: 10px; }
.swap-avail { font-size: 12px; color: var(--text-grey); }
.swap-amount-line { display: flex; align-items: center; gap: 8px; width: 100%; }
.max-btn-sm { padding: 4px 9px; font-size: 11px; border-radius: 7px; flex-shrink: 0; }
.swap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-selector { display: flex; align-items: center; gap: 10px; background: var(--bg-card-light); padding: 8px 14px 8px 8px; border-radius: 16px; cursor: pointer; border: none; color: var(--text-white); font-size: 16px; font-weight: 600; }
.asset-selector .chevron { font-size: 11px; color: var(--text-grey); }
.asset-selector-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.asset-selector-sym { font-size: 16px; font-weight: 600; }
.asset-selector-chain { font-size: 11px; font-weight: 500; color: var(--text-grey); }
.usd-toggle { width: 30px; height: 24px; border-radius: 8px; background: var(--bg-card-light); color: var(--text-grey); border: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s; }
.usd-toggle.active { background: var(--accent); color: var(--text-on-accent); }
.swap-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-white); font-size: 24px; font-weight: 600; text-align: right; min-width: 0; }
.swap-divider { display: flex; justify-content: center; margin: -14px 0; position: relative; z-index: 2; }
.swap-icon-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); border: 4px solid var(--bg-black); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
.exchange-rate { text-align: center; color: var(--text-grey); font-size: 14px; margin: 16px 0; }

/* ---- Send page ---- */
.amount-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.amount-avail { font-size: 12px; color: var(--text-grey); }
.amount-avail b { color: var(--text-white); font-weight: 600; }
.amount-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-grey); min-height: 14px; }
.max-btn { background: var(--accent); color: var(--text-on-accent); border: none; border-radius: 8px; font-size: 12px; font-weight: 700; padding: 6px 10px; cursor: pointer; letter-spacing: .3px; flex-shrink: 0; }
.max-btn:active { transform: scale(.95); }
.scan-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--bg-card-light); color: var(--accent); border: none; font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; }
.scan-btn:active { transform: scale(.92); }
.scanner-frame { width: 100%; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #000; border: 1px solid #333; position: relative; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame::after { content: ""; position: absolute; inset: 18%; border: 2px solid var(--accent); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }

/* ---- Network selector (Receive) ---- */
.network-select { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-input); border: 1px solid #333; border-radius: 18px; padding: 12px 16px; cursor: pointer; color: var(--text-white); transition: .15s; }
.network-select:hover { border-color: #4a4a4a; }
.network-select:active { transform: scale(.99); }
.network-select-main { display: flex; align-items: center; gap: 14px; }
.network-select-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.network-select-name { font-size: 16px; font-weight: 600; }
.network-select-sub { font-size: 12px; color: var(--text-grey); margin-top: 2px; }
.network-select-chev { color: var(--text-grey); font-size: 13px; }
.chain-disc { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.chain-disc svg { display: block; width: 100%; height: 100%; }
.chain-logo-sm { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.chain-logo-sm svg { display: block; width: 100%; height: 100%; }

/* ---- Asset picker modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 300; animation: fadeIn .2s ease; padding: 24px; }
.modal-sheet { background: var(--bg-card); width: 100%; max-width: 460px; border-radius: 24px; padding: 20px 24px; max-height: 78vh; display: flex; flex-direction: column; animation: sheetUp .2s ease; }
@keyframes sheetUp { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; flex-shrink: 0; }
.asset-picker-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; margin: 0 -8px; padding: 0 8px; }
.asset-picker-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; cursor: pointer; transition: .15s; }
.asset-picker-row:hover { background: var(--bg-card-light); }
.asset-picker-main { flex: 1; }

/* ---- Swap selector chip + USD ---- */
.swap-amount-wrap { display: flex; flex-direction: column; align-items: flex-end; flex: 1; min-width: 0; }
.swap-usd { font-size: 12px; color: var(--text-grey); margin-top: 2px; min-height: 14px; }

/* ---- Provider quote cards ---- */
.quote-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.quote-card { background: var(--bg-card); border: 2px solid transparent; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: .15s; }
.quote-card.selected { border-color: var(--accent); }
.quote-logo { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card-light); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.quote-main { flex: 1; }
.quote-name { font-size: 14px; font-weight: 600; }
.quote-time { font-size: 12px; color: var(--text-grey); margin-top: 2px; }
.quote-out { text-align: right; }
.quote-amount { font-size: 15px; font-weight: 600; }
.quote-best { font-size: 11px; color: var(--accent); margin-top: 2px; }

/* ---- Swap status page ---- */
.swap-status-head { display: flex; align-items: center; gap: 10px; }
.swap-status-arrow { color: var(--text-grey); font-size: 14px; }
.swap-status-summary { flex: 1; margin-left: 4px; }
.swap-status-pair { font-weight: 600; font-size: 15px; }
/* Once the outbound is scheduled the receive amount is the exact egress amount, not an estimate —
   turn it green + bold so it visibly "locks in". */
.swap-status-recv.actual { color: var(--positive); font-weight: 700; }

/* ---- Swap progress stepper ---- */
.stepper { display: flex; flex-direction: column; gap: 0; padding: 8px 4px; }
.step { display: flex; align-items: flex-start; gap: 14px; position: relative; }
.step-rail { display: flex; flex-direction: column; align-items: center; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-card-light); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dark-grey); flex-shrink: 0; }
.step.done .step-dot { background: var(--accent); color: var(--text-on-accent); }
.step.active .step-dot { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 0 0 4px rgba(217,249,95,.18); }
.step.fail .step-dot { background: var(--danger); color: #000; }
.step-line { width: 2px; flex: 1; min-height: 24px; background: var(--bg-card-light); }
.step.done .step-line { background: var(--accent); }
.step-body { padding-bottom: 22px; }
.step-label { font-size: 14px; font-weight: 500; }
.step.pending .step-label { color: var(--text-dark-grey); }
.step-detail { font-size: 12px; color: var(--text-grey); margin-top: 2px; }

/* ---- Misc / utilities ---- */
.text-accent { color: var(--accent); }
.text-grey { color: var(--text-grey); }
.text-danger { color: var(--danger); }
.text-positive { color: var(--positive); }
.flex-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 60vh; gap: 12px; }
.muted { color: var(--text-grey); font-size: 14px; }
.mono { font-family: 'Courier New', monospace; word-break: break-all; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }
/* On the lime primary button a lime-topped spinner is invisible — use dark contrast instead. */
.btn-primary .spinner { border-color: rgba(0,0,0,.2); border-top-color: var(--text-on-accent); }
.btn-working { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert-error { background: rgba(252,129,129,.12); color: var(--danger); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 12px 0; }
/* Identity StatusMessage (success/error) styled to the design system. */
.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 0 0 16px; }
.alert-danger { background: rgba(252,129,129,.12); color: var(--danger); }
.alert-success { background: rgba(91,217,138,.12); color: var(--positive); }
.address-box { background: var(--bg-input); border: 1px solid #333; border-radius: 16px; padding: 16px 18px; margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--text-white); line-height: 1.6; letter-spacing: .4px; }

/* ---- Wallet create / restore ---- */
.alert-warn { background: rgba(246,173,85,.12); color: #F6AD55; border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.55; margin-bottom: 16px; }
.seed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seed-word { background: var(--bg-card-light); color: var(--text-white); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
.seed-num { color: var(--text-dark-grey); font-size: 12px; min-width: 16px; text-align: right; }
.seed-input { width: 100%; background: var(--bg-input); border: 1px solid #333; border-radius: 16px; padding: 14px 16px; color: var(--text-white); font-size: 15px; font-family: 'Courier New', monospace; line-height: 1.6; resize: vertical; outline: none; }
.seed-input::placeholder { color: #555; }
.confirm-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; color: var(--text-grey); font-size: 14px; cursor: pointer; }
.confirm-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.qr-box { background: #fff; padding: 16px; border-radius: 16px; display: inline-block; margin: 16px auto; }
.qr-box svg { display: block; width: 180px; height: 180px; }

/* ---- Active-wallet switcher ---- */
.wallet-switcher { position: relative; }
.page-header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.wallet-chip { display: flex; align-items: center; gap: 8px; max-width: 190px; background: var(--bg-card); border: 1px solid #333; border-radius: 22px; padding: 7px 12px; color: var(--text-white); cursor: pointer; transition: .15s; }
.wallet-chip:active { transform: scale(.97); }
.wallet-chip-icon { color: var(--accent); font-size: 14px; display: flex; }
.wallet-chip-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-chip-chevron { font-size: 10px; color: var(--text-grey); transition: transform .15s; }
.wallet-chip-chevron.up { transform: rotate(180deg); }

.wallet-backdrop { position: fixed; inset: 0; z-index: 200; background: transparent; }
.wallet-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 201; width: 260px; max-width: min(260px, calc(100vw - 32px)); background: var(--bg-card); border: 1px solid #333; border-radius: 18px; padding: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.55); }
.wallet-menu.align-right { left: auto; right: 0; }
.wallet-menu-title { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-grey); padding: 4px 8px 8px; }
.wallet-menu-empty { color: var(--text-grey); font-size: 14px; padding: 6px 8px 10px; }
.wallet-menu-item { display: flex; align-items: center; gap: 6px; border-radius: 12px; padding: 2px; }
.wallet-menu-item.active { background: var(--bg-card-light); }
.wallet-item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: transparent; border: none; color: var(--text-white); cursor: pointer; padding: 9px 8px; text-align: left; }
.wallet-item-check { width: 16px; display: flex; justify-content: center; color: var(--accent); font-size: 12px; }
.wallet-item-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-icon-btn { width: 32px; height: 32px; border-radius: 10px; background: transparent; border: none; color: var(--text-grey); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: .15s; }
.wallet-icon-btn:hover { background: var(--bg-input); color: var(--text-white); }
.wallet-icon-btn.ok { color: var(--positive); }
.wallet-icon-btn.danger { color: var(--danger); }
.wallet-icon-btn.danger:hover { background: rgba(220, 53, 69, 0.14); color: var(--danger); }
.wallet-icon-btn:disabled { opacity: .5; cursor: default; }
.wallet-delete-prompt { color: var(--text-white); padding: 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-rename-input { flex: 1; min-width: 0; background: var(--bg-input); border: 1px solid #444; border-radius: 10px; padding: 8px 10px; color: var(--text-white); font-size: 15px; outline: none; }
.wallet-rename-input:focus { border-color: var(--accent); }
.wallet-menu-error { color: var(--danger); font-size: 12px; padding: 6px 8px; }
.wallet-menu-create { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; background: var(--bg-input); border: none; border-radius: 12px; padding: 11px; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.wallet-menu-create:hover { background: #101010; }

/* ---- Backup: wallet picker ---- */
.wallet-pick { width: 100%; display: flex; align-items: center; gap: 12px; background: var(--bg-input); border: 1px solid #333; border-radius: 14px; padding: 14px 16px; margin-top: 10px; color: var(--text-white); cursor: pointer; transition: .15s; }
.wallet-pick.sel { border-color: var(--accent); }
.wallet-pick-check { width: 16px; display: flex; justify-content: center; color: var(--accent); font-size: 13px; }
.wallet-pick-name { flex: 1; min-width: 0; text-align: left; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-pick-tag { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(217,249,95,.12); padding: 3px 8px; border-radius: 8px; }
