/* RestoreAPP — design system. Dark, iOS-first, violet→cyan accent. */

:root {
    --bg: #0A0C12;
    --bg-elevated: #0E1119;
    --panel: #12161F;
    --panel-2: #171C27;
    --panel-3: #1C2230;
    --text: #F4F6FB;
    --text-soft: #C2C9D8;
    --muted: #8D96A8;
    --muted-2: #6C7587;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.13);
    --violet: #8B5CF6;
    --cyan: #22D3EE;
    --violet-soft: rgba(139, 92, 246, 0.16);
    --cyan-soft: rgba(34, 211, 238, 0.12);
    --gradient: linear-gradient(120deg, #8B5CF6 0%, #7C6CF8 38%, #22D3EE 100%);
    --gradient-soft: linear-gradient(130deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.08));
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #FB7185;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.42);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Display rules must never beat the hidden attribute: views switch with it. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    /* clip (not hidden) keeps position: sticky working on the header. */
    overflow-x: clip;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 12% -8%, rgba(139, 92, 246, 0.14), transparent 62%),
        radial-gradient(760px 480px at 96% 8%, rgba(34, 211, 238, 0.08), transparent 60%);
}
::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.025em; font-weight: 700; }
ul, ol { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
    width: 18px; height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

main {
    flex: 1;
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 56px;
}
section[id], div[id] { scroll-margin-top: 90px; }

/* ---------------- Header ---------------- */
.top {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 0 max(16px, calc((100% - 880px) / 2));
    background: rgba(10, 12, 18, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.top::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.28), rgba(34, 211, 238, 0.22), transparent);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.035em;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--gradient);
    color: #0B0D13;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 6px 20px rgba(110, 90, 246, 0.32);
}
.brand-name span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.spacer { flex: 1 1 auto; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: #D8CFFF;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.chip .icon { color: var(--cyan); width: 15px; height: 15px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
button.btn { width: auto; }
/* Stretch only where a full-width control is expected. */
form button.btn,
.app-card > .btn,
.row > .btn { width: 100%; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-primary { background: var(--gradient); color: #080A10; box-shadow: 0 10px 28px rgba(110, 90, 246, 0.26); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(110, 90, 246, 0.36); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); }
.btn-outline { background: transparent; border-color: rgba(139, 92, 246, 0.45); color: #DCD3FF; }
.btn-outline:hover { background: var(--violet-soft); border-color: var(--violet); }
.btn-sm { padding: 9px 12px; font-size: 13px; border-radius: 11px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { padding: 14px 20px; font-size: 15.5px; border-radius: 14px; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-block { width: 100%; }
.btn .btn-label { display: inline; }

/* ---------------- Cards and typography ---------------- */
.card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}
.card.narrow {
    position: relative;
    overflow: hidden;
    max-width: 460px;
    margin: clamp(6px, 4vh, 40px) auto 18px;
    padding: 30px 28px;
}
.card.narrow::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}
.hero { font-size: clamp(26px, 6.4vw, 34px); letter-spacing: -0.04em; margin: 14px 0 10px; }
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lead { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.09);
    color: #CFC4FF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1.3;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; color: var(--muted-2); }
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dialog-card .section-label { margin-top: 20px; }
.auth-toggle { margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.link {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    color: var(--cyan);
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link:hover { color: #7DE9FA; }

/* ---------------- Forms ---------------- */
.field { margin-top: 14px; }
label {
    display: block;
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    /* 16px keeps iOS Safari from zooming the viewport on focus. */
    font-size: 16px;
    line-height: 1.3;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
    -webkit-appearance: none;
    appearance: none;
}
input::placeholder { color: var(--muted-2); }
input:focus, select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.65);
    background: rgba(139, 92, 246, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.otp {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.32em;
    padding: 14px 10px 14px 16px;
    font-variant-numeric: tabular-nums;
}
form > .btn[type="submit"] { margin-top: 18px; }
.row { display: flex; gap: 10px; margin-top: 18px; }
.row > * { flex: 1; }

.error {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 113, 133, 0.28);
    border-radius: 11px;
    background: rgba(251, 113, 133, 0.09);
    color: #FFC2CC;
    font-size: 13.5px;
    line-height: 1.5;
}
.error:empty { display: none; }
.error .link { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.55); }

/* ---------------- Connect screen ---------------- */
.back { margin-bottom: 16px; }
.connect-head { display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; }
.connect-icon {
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: var(--gradient-soft);
    color: #D8CFFF;
}
.connect-title { margin-top: 8px; font-size: 22px; }
.steps { display: grid; gap: 9px; margin: 18px 0 2px; }
.steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-soft); line-height: 1.45; }
.steps .num {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.16);
    color: #D8CFFF;
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 1px;
}
.accounts { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.accounts-title { margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-2); }
.account-list { display: grid; gap: 8px; }
.account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}
.account-row .email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text-soft); }
.account-row .btn { flex: 0 0 auto; }

/* ---------------- Toolbar and catalogue ---------------- */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
label.search {
    position: relative;
    flex: 1 1 220px;
    max-width: 320px;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
label.search .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px; height: 17px;
    color: var(--muted-2);
    pointer-events: none;
}
label.search input { padding-left: 38px; }
.account-select {
    width: auto;
    max-width: 220px;
    padding: 10px 34px 10px 12px;
    font-size: 13px;
    color: var(--text-soft);
    background-color: rgba(255, 255, 255, 0.04);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238D96A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}
.account-select option { background: var(--panel); color: var(--text); }
.counts { margin-left: auto; font-size: 12px; color: var(--muted-2); white-space: nowrap; }

.progress-card { max-width: 460px; margin: 0 auto 18px; padding: 16px 18px; }
#catalogRetry { margin-top: 10px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-soft); }
.percent { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted-2); }
.bar { height: 8px; margin-top: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gradient); transition: width .45s cubic-bezier(.2, .7, .3, 1); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.app-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    opacity: .6;
}
.app-card:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.32); background: linear-gradient(160deg, rgba(139, 92, 246, 0.09), rgba(255, 255, 255, 0.014)); }
.app-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-icon {
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: var(--gradient);
    color: #0B0D13;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(110, 90, 246, 0.22);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-name { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sub { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.badge.delisted { background: rgba(251, 113, 133, 0.11); color: var(--danger); border: 1px solid rgba(251, 113, 133, 0.28); }
.badge.owned { background: rgba(52, 211, 153, 0.08); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.24); }
.badge.lib { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.28); }
.badge.unlim {
    padding: 7px 12px;
    font-size: 13px;
    background: rgba(52, 211, 153, 0.1);
    color: #86EFC6;
    border: 1px solid rgba(52, 211, 153, 0.3);
    cursor: pointer;
}
.badge.unlim:hover { background: rgba(52, 211, 153, 0.16); }

.pack .price { font-size: 25px; font-weight: 750; letter-spacing: -0.045em; }
.packs { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pack .price small { font-size: 11px; font-weight: 400; color: var(--muted-2); margin-left: 4px; letter-spacing: 0; }
.pack .badge.lib { margin-bottom: 2px; }

.skeleton {
    height: 132px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 20%, rgba(255, 255, 255, 0.075) 40%, rgba(255, 255, 255, 0.03) 60%);
    background-size: 220% 100%;
    animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 38px 22px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}
.empty .icon { width: 26px; height: 26px; color: var(--muted-2); margin-bottom: 2px; }
.empty b { color: var(--text-soft); font-weight: 600; }

/* ---------------- Dialogs ---------------- */
dialog {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    width: min(94vw, 480px);
    max-width: 480px;
    max-height: 92vh;
    overflow: visible;
}
dialog::backdrop { background: rgba(6, 8, 12, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-card {
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-lg);
}
.dialog-head { display: flex; align-items: center; gap: 12px; }
.dialog-title { min-width: 0; }
.dialog-title h2 { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { margin-top: 20px; }
.dialog-card .lead { margin-top: 14px; }
.versions { display: grid; gap: 8px; }
.versions li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.015);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}
.versions li:hover { border-color: rgba(139, 92, 246, 0.4); }
.versions li.selected { border-color: rgba(139, 92, 246, 0.65); background: rgba(139, 92, 246, 0.13); }
.versions-note { margin-top: 8px; font-size: 11.5px; color: var(--muted-2); }
.versions .ver-label { font-weight: 600; }
.versions .ver-side { display: inline-flex; align-items: center; gap: 8px; }
.versions .ver-meta { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.versions .check { width: 16px; height: 16px; color: var(--cyan); opacity: 0; transition: opacity .16s ease; }
.versions li.selected .check { opacity: 1; }

.prep-status {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--text-soft);
}
a.install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding: 15px 20px;
    border-radius: 14px;
    background: var(--gradient);
    color: #080A10;
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(110, 90, 246, 0.28);
}
a.install:hover { box-shadow: 0 16px 38px rgba(110, 90, 246, 0.4); transform: translateY(-1px); }
.prep-install-state { margin-top: 10px; text-align: center; line-height: 1.5; }
.install-note {
    margin-top: 16px;
    padding: 11px 13px;
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.045);
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

/* ---------------- Wallet ---------------- */
.wallet-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.wallet-topbar h2 { font-size: 24px; margin: 0; }
.balance {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(34, 211, 238, 0.05));
}
.balance-icon {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.07);
    color: #D8CFFF;
}
.balance-icon .icon { width: 22px; height: 22px; }
.balance-main { display: flex; align-items: baseline; gap: 8px; }
.balance-num { font-size: 36px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.balance-label { font-size: 13px; color: var(--muted); }
.balance .badge.unlim { margin-left: auto; }
.pricing-note { margin-top: 12px; color: var(--muted-2); font-size: 11.5px; line-height: 1.65; text-align: center; }

.ledger { display: grid; margin: 0; }
.ledger li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--text-soft);
}
.ledger li:last-child { border-bottom: 0; }
.ledger .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .amt {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.ledger .amt.pos { background: rgba(52, 211, 153, 0.1); color: #86EFC6; }
.ledger .amt.neg { background: rgba(251, 113, 133, 0.1); color: #FFC2CC; }
.ledger .date { flex: 0 0 auto; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.ledger .empty-row { justify-content: center; color: var(--muted-2); border: 0; }

/* ---------------- Footer and toasts ---------------- */
.foot {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #080A0F;
    color: var(--muted-2);
    font-size: 11.5px;
    line-height: 1.6;
    text-align: center;
}
.toasts {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 100;
    display: grid;
    gap: 8px;
    width: min(92vw, 380px);
    transform: translateX(-50%);
    pointer-events: none;
}
.toast {
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: rgba(20, 24, 34, 0.97);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.45;
    animation: toast-in .22s ease;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.35); }
.toast.err { border-color: rgba(251, 113, 133, 0.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 680px) {
    main { width: calc(100% - 28px); padding: 16px 0 44px; }
    .top { min-height: 60px; padding: 0 14px; gap: 8px; }
    .card.narrow { padding: 24px 20px; }
    .grid { grid-template-columns: 1fr; }
    .toolbar { gap: 8px; }
    label.search { flex: 1 1 100%; max-width: none; }
    .counts { margin-left: 0; width: 100%; }
    dialog { width: 94vw; }
    .dialog-card { padding: 20px; }
    .balance-num { font-size: 32px; }
    .otp { font-size: 24px; }
}
@media (max-width: 520px) {
    .brand-name { display: none; }
    .chip { font-size: 12px; padding: 6px 10px; }
    .chip .icon { width: 14px; height: 14px; }
    .hero { font-size: 26px; }
    .wallet-topbar h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
