/* openvibe.network/wallet and /pay/:id — the one wallet and the Vibes Pay sheet (MONEY.md, D12).
 *
 * The shared kit's classes (ovk-page, ovk-btn, ovk-sheet) carry the controls; this file is the wallet's own shape:
 * three cards that sit in a row at 1280 px, rows that fold at 320 px, and no sideways scroll. Colours are the site's
 * theme tokens, so both themes and every custom theme work; money figures use tabular numerals. Nothing spins.
 */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--bg-primary, #0b0f17);
    color: var(--text-primary, #e8ecf3);
    font-family: var(--ov-font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent, #3b82f6); }
:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 2px; }

.w-page { padding-top: 18px; padding-bottom: 48px; }
.w-head { margin: 4px auto 20px; }
.w-head h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.15rem); font-weight: 800; letter-spacing: -.025em; }
.w-head p { margin: 6px 0 0; color: var(--text-secondary, #a8b3c4); font-size: .95rem; line-height: 1.5; }

.w-banner {
    margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: .9rem; line-height: 1.5;
    color: var(--text-primary, #e8ecf3);
    background: color-mix(in srgb, var(--accent, #3b82f6) 10%, var(--bg-card, #121826));
    border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 32%, var(--border, rgba(255, 255, 255, .12)));
}
.w-linkish { padding: 0; border: 0; background: none; color: var(--accent, #3b82f6); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ── The three cards ── */
.w-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 899px) { .w-cards { grid-template-columns: minmax(0, 1fr); } }

.w-card {
    position: relative; display: flex; flex-direction: column; min-width: 0;
    padding: 22px 22px 20px; border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 18px;
    background: var(--bg-card, #121826);
    box-shadow: 0 16px 40px -34px rgba(0, 0, 0, .9);
    overflow: hidden;
}
.w-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent, #3b82f6); opacity: .9; }
.w-card--vibes::before { background: var(--success-text, var(--success, #22c55e)); }
.w-card--coins::before { background: var(--warning-text, var(--warning, #f59e0b)); }

.w-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.w-card-top h2 { margin: 0; font-size: 1rem; font-weight: 750; letter-spacing: -.01em; }
.w-mark {
    flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
    font-weight: 800; font-size: 1.15rem; line-height: 1;
    background: color-mix(in srgb, var(--accent, #3b82f6) 14%, transparent);
    color: var(--accent-light, var(--accent, #60a5fa));
}
.w-mark--vibes { background: color-mix(in srgb, var(--success, #22c55e) 15%, transparent); color: var(--success-text, var(--success, #22c55e)); }
.w-mark--coins { background: color-mix(in srgb, var(--warning, #f59e0b) 15%, transparent); color: var(--warning-text, var(--warning, #f59e0b)); }
.w-mark .w-icon { width: 21px; height: 21px; }

.w-amount {
    margin: 18px 0 2px; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.05; font-weight: 800;
    letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--text-primary, #e8ecf3);
    overflow-wrap: anywhere;
}
.w-line { margin: 4px 0 0; color: var(--text-secondary, #a8b3c4); font-size: .88rem; line-height: 1.45; }
.w-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 18px; }
/* A label never breaks inside its button: on a phone the second button takes its own row. */
.w-actions .ovk-btn { flex: 1 1 140px; white-space: nowrap; }
.w-note { margin: 10px 0 0; font-size: .78rem; line-height: 1.45; color: var(--text-muted, #7d8aa0); }
.w-note.is-warn { color: var(--warning-text, var(--warning, #b45309)); }

/* ── Sections under the cards ── */
.w-sec { margin-top: 30px; min-width: 0; }
.w-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.w-sec-head h2 { margin: 0; font-size: 1.08rem; font-weight: 750; letter-spacing: -.015em; }
.w-sec-sub { margin: 3px 0 0; color: var(--text-muted, #7d8aa0); font-size: .82rem; line-height: 1.4; }
.w-sec-head--activity { align-items: center; }

.w-empty { margin: 10px 0 0; color: var(--text-muted, #7d8aa0); font-size: .86rem; line-height: 1.5; }

/* Projects */
.w-projects {
    list-style: none; margin: 0; padding: 0; overflow: hidden;
    border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 16px;
    background: var(--bg-card, #121826);
}
.w-project { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 11px 16px; }
.w-project + .w-project { border-top: 1px solid var(--border, rgba(255, 255, 255, .12)); }
.w-project-main { flex: 1 1 auto; min-width: 0; }
.w-project-link { display: flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; min-width: 0; }
.w-project-link:hover b { color: var(--accent-light, var(--accent, #60a5fa)); }
.w-project-link b { font-size: .93rem; font-weight: 650; overflow-wrap: anywhere; }
.w-project-ext { color: var(--text-muted, #7d8aa0); font-size: .78rem; line-height: 1; }
.w-project-sub { margin-top: 2px; color: var(--text-muted, #7d8aa0); font-size: .78rem; font-variant-numeric: tabular-nums; }
.w-project-side { flex: none; display: flex; align-items: center; gap: 10px; }
.w-project-bal { font-variant-numeric: tabular-nums; font-weight: 750; font-size: .95rem; white-space: nowrap; }
@media (max-width: 359px) {
    .w-project { flex-wrap: wrap; padding: 12px 14px; }
    .w-project-main { flex: 1 1 100%; }
    .w-project-side { width: 100%; justify-content: space-between; }
}

/* Activity */
.w-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.w-chip {
    min-height: 36px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border, rgba(255, 255, 255, .12)); background: transparent;
    color: var(--text-secondary, #a8b3c4); font: inherit; font-size: .82rem; font-weight: 650;
}
.w-chip:hover { border-color: color-mix(in srgb, var(--accent, #3b82f6) 55%, var(--border, transparent)); color: var(--text-primary, #e8ecf3); }
.w-chip[aria-pressed="true"] {
    background: color-mix(in srgb, var(--accent, #3b82f6) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent, #3b82f6) 55%, transparent);
    color: var(--text-primary, #e8ecf3);
}
@media (pointer: coarse), (max-width: 759px) { .w-chip { min-height: 44px; } }

.w-activity {
    list-style: none; margin: 12px 0 0; padding: 0; overflow: hidden;
    border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 16px;
    background: var(--bg-card, #121826);
}
.w-activity:empty { display: none; }
.w-act { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; }
.w-act + .w-act { border-top: 1px solid var(--border, rgba(255, 255, 255, .12)); }
.w-act-date { color: var(--text-muted, #7d8aa0); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-act-main { display: grid; gap: 1px; min-width: 0; }
.w-act-label { font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.w-act-detail { color: var(--text-muted, #7d8aa0); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-act-amt { display: flex; flex-direction: column; align-items: flex-end; justify-self: end; color: var(--text-primary, #e8ecf3); font-size: .95rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; line-height: 1.25; }
.w-act-amt--stack { gap: 1px; }
.w-act-amt small { margin-left: 2px; color: var(--text-muted, #7d8aa0); font-size: .7rem; font-weight: 600; }
.w-act-part.is-pos { color: var(--success-text, var(--success, #22c55e)); }
@media (max-width: 600px) { .w-act-detail { white-space: normal; } }
@media (max-width: 359px) {
    .w-act { grid-template-columns: 78px minmax(0, 1fr); row-gap: 3px; padding: 11px 13px; }
    .w-act-amt { grid-column: 2; justify-self: start; align-items: flex-start; text-align: left; font-size: .86rem; }
}

/* Where each works: one quiet line of chips per currency */
.w-where { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border, rgba(255, 255, 255, .12)); }
.w-where h2 { margin: 0 0 12px; color: var(--text-muted, #7d8aa0); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.w-where-list { display: grid; gap: 9px; margin: 0; }
.w-where-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.w-where-row dt { min-width: 76px; color: var(--text-secondary, #a8b3c4); font-size: .8rem; font-weight: 700; }
.w-where-row dd { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.w-tag {
    padding: 3px 10px; border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 999px;
    background: var(--bg-secondary, #101828); color: var(--text-secondary, #a8b3c4); font-size: .78rem; line-height: 1.5;
}

/* ── Sheets (Move to a project, Add money, Get Vibes) ── */
.w-sheet { color: var(--text-primary, #e8ecf3); }
.w-sheet .ovk-sheet-body { display: grid; gap: 12px; }
.w-sheet .ovk-sheet-head h2 { overflow-wrap: anywhere; }
.w-sheet-lede { margin: 0; color: var(--text-secondary, #a8b3c4); font-size: .9rem; line-height: 1.55; }
.w-sheet-note { margin: 0; color: var(--text-muted, #7d8aa0); font-size: .82rem; line-height: 1.5; }
.w-sheet-go { width: 100%; }
.w-sheet-cancel { width: 100%; }
.w-quiet {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 8px 12px; border: 0; background: none; color: var(--text-muted, #7d8aa0);
    font: inherit; font-size: .88rem; font-weight: 650; text-decoration: none; cursor: pointer; border-radius: 10px;
}
.w-quiet:hover { color: var(--text-primary, #e8ecf3); }

.w-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-secondary, #101828); }
.w-tab {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px;
    background: transparent; color: var(--text-muted, #7d8aa0); font: inherit; font-size: .88rem;
    font-weight: 700; cursor: pointer;
}
.w-tab[aria-selected="true"] { background: var(--bg-card, #121826); color: var(--text-primary, #e8ecf3); }

.w-field { display: grid; gap: 5px; min-width: 0; }
.w-field > span { color: var(--text-muted, #7d8aa0); font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.w-field input, .w-field select {
    width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 11px;
    border: 1px solid var(--border, rgba(255, 255, 255, .12)); background: var(--bg-input, #0f1522);
    color: var(--text-primary, #e8ecf3); font: inherit; font-size: 1rem; font-weight: 500;
}
.w-field input:focus, .w-field select:focus {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 22%, transparent);
    outline: 0;
}
.w-field input::placeholder { color: var(--text-muted, #7d8aa0); opacity: 1; }
.w-cost-line { margin: 0; color: var(--text-secondary, #a8b3c4); font-size: .9rem; line-height: 1.5; }
.w-cost-line b { color: var(--text-primary, #e8ecf3); font-variant-numeric: tabular-nums; }

.w-packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.w-pack {
    display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 12px 13px;
    border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 12px;
    background: var(--bg-card, #121826); color: var(--text-primary, #e8ecf3); text-decoration: none;
}
.w-pack:hover { border-color: var(--accent, #3b82f6); }
.w-pack b { font-size: .92rem; font-weight: 700; }
.w-pack small { color: var(--text-muted, #7d8aa0); font-size: .78rem; }
@media (max-width: 360px) { .w-packs { grid-template-columns: 1fr; } }

/* ── Vibes Pay (/pay/:id): one centred card, 420 px at most ── */
.w-pay-page { display: flex; align-items: flex-start; justify-content: center; min-height: 66vh; padding: 9vh 16px 48px; }
@media (max-height: 720px) { .w-pay-page { padding-top: 28px; } }
.w-pay-card { width: 100%; max-width: 420px; min-width: 0; margin: 0 auto; }
.w-pay {
    display: flex; flex-direction: column; gap: 10px; min-width: 0;
    padding: 26px 24px 22px; border: 1px solid var(--border, rgba(255, 255, 255, .12)); border-radius: 22px;
    background: var(--bg-card, #121826);
    box-shadow: 0 28px 70px -46px rgba(0, 0, 0, .95);
}
.w-pay-app { display: flex; align-items: center; gap: 12px; min-width: 0; }
.w-pay-mark {
    flex: none; display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden;
    border-radius: 14px; background: color-mix(in srgb, var(--accent, #3b82f6) 16%, var(--bg-secondary, #101828));
    color: var(--accent-light, var(--accent, #60a5fa)); font-size: 1.2rem; font-weight: 800;
}
.w-pay-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-pay-app-who { display: grid; gap: 1px; min-width: 0; }
.w-pay-app-who b { font-size: 1rem; font-weight: 750; overflow-wrap: anywhere; }
.w-pay-app-who span { color: var(--text-muted, #7d8aa0); font-size: .76rem; }
.w-pay-item { margin: 6px 0 0; color: var(--text-secondary, #a8b3c4); font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.w-pay-price {
    margin: 2px 0; font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.05; font-weight: 800;
    letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.w-pay-have { margin: 0; color: var(--text-secondary, #a8b3c4); font-size: .9rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.w-pay-need { margin: 2px 0 2px; color: var(--warning-text, var(--warning, #b45309)); font-size: .95rem; font-weight: 700; line-height: 1.45; }
.w-pay-go { width: 100%; margin-top: 6px; }
.w-pay-cancel { width: 100%; align-self: center; }
.w-pay-title { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.w-pay-line { margin: 0; color: var(--text-secondary, #a8b3c4); font-size: .95rem; line-height: 1.5; }
.w-pay-check {
    display: grid; place-items: center; width: 58px; height: 58px; margin: 4px 0 2px; border-radius: 50%;
    background: color-mix(in srgb, var(--success, #22c55e) 16%, transparent);
    color: var(--success-text, var(--success, #22c55e));
}
.w-pay-sentence { margin: 0; color: var(--text-secondary, #a8b3c4); font-size: 1rem; line-height: 1.6; }
.w-pay-loading { margin: 0; color: var(--text-muted, #7d8aa0); font-size: .95rem; }
.w-pay-error { margin: 0; color: var(--danger-text, var(--danger, #ef4444)); font-size: .86rem; line-height: 1.45; }
@media (max-width: 380px) {
    .w-pay { padding: 20px 18px 18px; border-radius: 18px; }
    .w-pay-page { padding-left: 12px; padding-right: 12px; }
}

/* Reduced motion: nothing here moves, and a person who asks for calm gets no transitions either. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
