/* dashboard page styles — scoped under .page--dashboard to prevent leakage across base.html-shared pages. Tokens from craft.css. */

/* The card owns whatever the toolbar leaves, so the page itself never scrolls. */
.page--dashboard {
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    min-height: 0;
    padding: var(--space-s);
}

.page--dashboard #dash {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: 100%;
    min-height: 0;
}

.page--dashboard .card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--craft-surface);
    border: 1px solid var(--craft-line);
    border-radius: 16px;
    padding: var(--space-m);
    text-align: center;
    box-shadow: 0 24px 60px light-dark(rgba(0,0,0,0.08), rgba(0,0,0,0.45));
}
/* Only .terms flexes — every other row keeps its height, so the shrink lands in the scroller. */
.page--dashboard .card > * { flex: 0 0 auto; }

.page--dashboard .mark {
    font-size: var(--step-4);
    line-height: 1;
}

.page--dashboard h1 {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: var(--step-2);
    line-height: 1.2;
    margin: 0;
    color: var(--craft-text);
}

.page--dashboard .sub {
    color: var(--craft-text-muted);
    font-size: var(--step-0);
    line-height: 1.45;
    margin: var(--space-2xs) 0 var(--space-s);
    text-wrap: balance;
}

/* The page's one and only scroll region — it takes whatever height the card has left. */
.page--dashboard .terms {
    flex: 1 1 auto;
    min-height: 4rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--craft-line) transparent;
    text-align: left;
    background: var(--craft-surface-2);
    border: 1px solid var(--craft-line);
    border-radius: 10px;
    padding: var(--space-s);
    margin-bottom: var(--space-s);
    font-size: var(--step--1);
    color: var(--craft-text-muted);
    line-height: 1.55;
}
.page--dashboard .terms p { margin: 0 0 var(--space-2xs); }
.page--dashboard .terms strong { color: var(--craft-text); }

.page--dashboard .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    width: 100%;
    background: var(--craft-accent);
    color: var(--craft-accent-ink);
    font-family: ui-monospace, monospace;
    font-weight: 700;
    font-size: var(--step-0);
    border: none;
    border-radius: 10px;
    padding: var(--space-2xs) var(--space-s);
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}
.page--dashboard .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.page--dashboard .btn:focus-visible {
    outline: 2px solid var(--craft-text);
    outline-offset: 3px;
}

.page--dashboard form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}
.page--dashboard input {
    width: 100%;
    padding: var(--space-2xs) var(--space-xs);
    font-size: var(--step-0);
    background: var(--craft-surface-2);
    color: var(--craft-text);
    border: 1px solid var(--craft-line);
    border-radius: 10px;
    font-family: ui-monospace, monospace;
}
.page--dashboard input:focus-visible {
    outline: 2px solid var(--craft-accent);
    outline-offset: 1px;
}

.page--dashboard .note  { font-size: var(--step--1); color: var(--craft-text-muted); margin: var(--space-2xs) 0 0; text-wrap: balance; }
.page--dashboard .error { color: var(--craft-err); font-size: var(--step--1); margin: 0; }
.page--dashboard .ok    { color: var(--craft-ok);  font-size: var(--step--1); margin: 0 0 var(--space-2xs); }

@media (prefers-reduced-motion: reduce) {
    .page--dashboard .btn { transition: none; }
}

/* Busy state for the OTP flow's in-flight button (data-indicator). */
.page--dashboard .btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* The signup door's derived next action — a column, so its lede and button never share a row. */
.page--dashboard .join-step {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    margin: var(--space-xs) 0 0;
}
.page--dashboard .join-step .sub { margin: 0; }
.page--dashboard .join-step .note { margin: 0; }
/* The alternatives read as one group under the primary action, not as two separate afterthoughts. */
.page--dashboard .join-step .note { margin: 0; }
.page--dashboard .join-step .note + .note { margin-top: var(--space-3xs); }

/* Reserves its one line so a message never shifts the card, without opening a gap when it is empty. */
.page--dashboard #buy-status,
.page--dashboard #prove-status { margin: var(--space-3xs) 0 0; min-height: 1.25em; font-size: var(--step--1); }
/* Shown only where no fiat rail exists and a deposit is the one way in. */
.page--dashboard .wallet-address {
    font-size: var(--step--2);
    background: var(--craft-surface-2);
    border: 1px solid var(--craft-line);
    border-radius: 8px;
    padding: var(--space-2xs);
    font-family: ui-monospace, monospace;
    word-break: break-all;
    color: var(--craft-text);
    margin: 0;
}

/* The send-it-yourself half of funding, folded away: the newcomer who needs the card must not have to read past it. */
.page--dashboard .fund-alt { text-align: center; }
.page--dashboard .fund-alt summary {
    cursor: pointer;
    font-size: var(--step--1);
    color: var(--craft-text-muted);
    padding: var(--space-2xs) 0;
}
.page--dashboard .btn--quiet { background: var(--craft-surface-2); color: var(--craft-text); border: 1px solid var(--craft-line); }

/* The hint under an action — its own line, tight to what it qualifies. */
.page--dashboard .sub--hint { font-size: var(--step--2); margin: 0 0 var(--space-2xs); }



/* codex-old's New/Existing convention: the MECHANISM is picked before any prompt fires, so nobody
   has to cancel the wrong picker to reach the right one. Tabs, then rich option rows. */
/* ONE segmented control, not two buttons: a shared track with a filled active segment reads as a
   choice between two views. Two bordered boxes read as two actions, which is why clicking the
   already-selected one felt broken. */
.page--dashboard .wallet-tabs {
    display: flex;
    gap: 0;
    margin: var(--space-2xs) 0 var(--space-xs);
    padding: var(--space-3xs);
    background: var(--craft-surface-2);
    border: 1px solid var(--craft-line);
    border-radius: 10px;
}
.page--dashboard .wallet-tab {
    flex: 1;
    padding: var(--space-2xs);
    background: none;
    border: 0;
    border-radius: 7px;
    color: var(--craft-text-muted);
    font-family: inherit;
    font-size: var(--step--1);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.page--dashboard .wallet-tab.active {
    background: var(--craft-surface);
    color: var(--craft-text);
    font-weight: 600;
    box-shadow: 0 1px 3px light-dark(rgba(0,0,0,0.10), rgba(0,0,0,0.35));
}
@media (prefers-reduced-motion: reduce) {
    .page--dashboard .wallet-tab { transition: none; }
}
.page--dashboard .wallet-options { display: flex; flex-direction: column; gap: var(--space-2xs); }
.page--dashboard .wallet-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-2xs) var(--space-xs);
    text-align: left;
    background: var(--craft-surface-2);
    border: 1px solid var(--craft-line);
    border-radius: 10px;
    color: var(--craft-text);
    font-family: inherit;
    cursor: pointer;
}
.page--dashboard .wallet-option:hover { border-color: var(--craft-accent); }
.page--dashboard .wallet-option-icon { font-size: var(--step-1); line-height: 1.4; }
.page--dashboard .wallet-option-text { display: flex; flex-direction: column; }
.page--dashboard .wallet-option-label { font-weight: 600; font-size: var(--step-0); }
.page--dashboard .wallet-option-desc { font-size: var(--step--2); color: var(--craft-text-muted); line-height: 1.4; }

/* The card centres its copy; these two blocks are read left-to-right like the forms they are. */
.page--dashboard .identity,
.page--dashboard .field { text-align: left; }

/* A folded panel's field fills it, like every other input on the card. */
.page--dashboard .fund-alt input[type="text"] {
    width: 100%;
    margin-top: var(--space-2xs);
    padding: var(--space-2xs) var(--space-xs);
    font-family: ui-monospace, monospace;
    font-size: var(--step-0);
    background: var(--craft-surface-2);
    color: var(--craft-text);
    border: 1px solid var(--craft-line);
    border-radius: 10px;
}
