/* =====================================================================================
   DigiPay page layout (spec 032). Loaded after the shared style layer
   (_content/DigiByte.UI/css/ui.css) and built only from its tokens, so it follows the
   wallet's light and dark themes. Shared components (buttons, cards, fields, badges, QR
   frame, notices) live in ui.css; this file only arranges DigiPay's own pages.
   ===================================================================================== */

/* ----- Shopper pages: checkout, receipt, donation page ----- */
.ui-shopper-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8fafc;
    color: var(--ui-text);
}
.dark .ui-shopper-page { background: #001529; }

/* Inside a shop's embedded window the page should hug its card; the embed script sizes the frame. */
@media (max-width: 360px) {
    .ui-shopper-page { padding: 0.5rem; }
}

.ui-checkout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem;
}
@media (min-width: 480px) {
    .ui-checkout { padding: 1.5rem; }
}
.ui-checkout-center { text-align: center; padding-block: 2rem; }
.ui-checkout-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.ui-checkout-label { font-size: 1.125rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ui-checkout-merchant { margin-top: 0.125rem; font-size: 0.875rem; color: var(--ui-text-muted); overflow-wrap: anywhere; }
.ui-checkout-amount { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; }
.ui-checkout-big {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.ui-checkout-unit { font-family: Inter, system-ui, sans-serif; font-size: 0.6em; font-weight: 600; color: var(--ui-text-muted); letter-spacing: 0; }
.ui-checkout-muted { font-size: 0.9375rem; line-height: 1.5; color: var(--ui-text-muted); }

/* A value a shopper may need to paste, with its copy button. */
.ui-checkout-copyrow {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0.875rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-input-bg, transparent);
}
.ui-checkout-address {
    margin-top: 0.125rem;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-all;
    color: var(--ui-text);
}

/* Final states */
.ui-terminal { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; padding-top: 0.25rem; }
.ui-terminal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
}
.ui-terminal-amounts {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.ui-terminal-amounts > div {
    padding: 0.625rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
}
.ui-terminal-amounts dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ui-text-muted); }
.ui-terminal-amounts dd { margin-top: 0.125rem; font-size: 0.9375rem; font-weight: 600; overflow-wrap: anywhere; }

/* Confirming: paid, waiting for blocks (ConfirmationProgress.razor). Replaces the QR, address and
   countdown once money is on its way. */
.ui-confirm {
    --ui-confirm-done: #10b981;
    --ui-confirm-idle: #e2e8f0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    animation: ui-confirm-in 360ms ease-out both;
}
.dark .ui-confirm { --ui-confirm-done: #34d399; --ui-confirm-idle: #0b3a75; }
@keyframes ui-confirm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ui-confirm-ring { position: relative; width: 7.5rem; height: 7.5rem; margin-top: 0.25rem; }
.ui-confirm-ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ui-confirm-ring > svg circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ui-confirm-ring-track { stroke: var(--ui-confirm-idle); }
.ui-confirm-ring-fill { stroke: var(--ui-confirm-done); transition: stroke-dashoffset 700ms cubic-bezier(.22, 1, .36, 1); }
.ui-confirm-ring-spin { stroke: var(--ui-primary); transform-origin: 60px 60px; animation: ui-confirm-spin 1.4s linear infinite; }
@keyframes ui-confirm-spin { to { transform: rotate(360deg); } }
.ui-confirm-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ui-confirm-done);
}
.ui-confirm-ring.is-waiting .ui-confirm-ring-center { color: var(--ui-primary); }
.ui-confirm-count {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ui-text);
    letter-spacing: -0.02em;
}
.ui-confirm-of { font-size: 0.55em; font-weight: 600; color: var(--ui-text-muted); }
.ui-confirm-copy { display: flex; flex-direction: column; gap: 0.375rem; }

.ui-confirm-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-input-bg, transparent);
}
.ui-confirm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ui-confirm-panel-value { font-size: 0.875rem; font-weight: 600; color: var(--ui-text); }

.ui-confirm-chain { display: flex; align-items: center; list-style: none; margin: 0; padding: 0 0.125rem; }
.ui-confirm-link { flex: 1; height: 2px; border-radius: 9999px; background: var(--ui-confirm-idle); transition: background-color 700ms; }
.ui-confirm-link.is-done { background: var(--ui-confirm-done); }
.ui-confirm-block {
    position: relative;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-confirm-idle);
    color: var(--ui-text-muted);
    transition: background-color 500ms, color 500ms, transform 500ms;
}
.ui-confirm-block.is-done { background: var(--ui-confirm-done); color: #fff; }
.dark .ui-confirm-block.is-done { color: #001529; }
.ui-confirm-block.is-mining { background: var(--ui-primary); color: #fff; }
.ui-confirm-block.is-mining::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 9999px;
    background: var(--ui-primary);
    opacity: 0.25;
    animation: ui-confirm-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ui-confirm-ping { 75%, 100% { transform: scale(1.5); opacity: 0; } }

.ui-confirm-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--ui-text-muted);
}
.ui-confirm-hint svg { color: var(--ui-primary); flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    .ui-confirm, .ui-confirm-ring-spin, .ui-confirm-block.is-mining::before { animation: none !important; }
    .ui-confirm-ring-fill, .ui-confirm-link, .ui-confirm-block { transition: none !important; }
}

/* Receipt and theme footer */
.ui-shopper-footer { margin-top: 1rem; display: flex; justify-content: center; }

/* Receipts print dark on white in either theme (FR-028). */
@media print {
    .ui-shopper-page, .dark .ui-shopper-page { background: #fff !important; color: #000 !important; min-height: 0; padding: 0; }
    .ui-shopper-page .card, .ui-shopper-page .card-raised { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 0 !important; }
    .ui-shopper-page .ui-checkout-muted, .ui-shopper-page .section-label, .ui-shopper-page .ui-checkout-merchant { color: #334155 !important; }
    .ui-shopper-page .ui-checkout-address, .ui-shopper-page .ui-checkout-big { color: #000 !important; }
    .ui-shopper-page .ui-checkout-copyrow { border-color: #cbd5e1 !important; background: #fff !important; }
    .ui-no-print, .ui-toast-stack, .ui-skip-link { display: none !important; }
}

/* Receipt (Receipt.razor): hero, amount, a torn-slip list of facts, then the transaction proof. */
.ui-receipt, .ui-terminal { --ui-receipt-ok: #10b981; --ui-receipt-idle: #e2e8f0; }
.ui-receipt { gap: 1.125rem; }
.dark .ui-receipt, .dark .ui-terminal { --ui-receipt-ok: #34d399; --ui-receipt-idle: #0b3a75; }
.ui-receipt-hero { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; text-align: center; }
.ui-receipt-seal {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.375rem;
    border-radius: 9999px;
    color: var(--ui-receipt-ok);
    background: color-mix(in srgb, var(--ui-receipt-ok) 14%, transparent);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--ui-receipt-ok) 7%, transparent);
    animation: ui-receipt-pop 420ms cubic-bezier(.34, 1.56, .64, 1) both;
}
.ui-receipt-seal.is-pending { --ui-receipt-ok: var(--ui-primary); }
.ui-receipt-seal.is-danger { --ui-receipt-ok: #dc2626; }
.ui-receipt-seal.is-refund { --ui-receipt-ok: #6366f1; }
.dark .ui-receipt-seal.is-danger { --ui-receipt-ok: #f87171; }
.dark .ui-receipt-seal.is-refund { --ui-receipt-ok: #a5b4fc; }
@keyframes ui-receipt-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ui-receipt-merchant { color: var(--ui-text); font-weight: 600; }

.ui-receipt-seal.is-neutral { --ui-receipt-ok: #64748b; }
.dark .ui-receipt-seal.is-neutral { --ui-receipt-ok: #94a3b8; }

/* Confirmed checkout (TerminalState.razor): the confirming ring completes, then the check pops in. */
.ui-terminal { --ui-confirm-done: #10b981; --ui-confirm-idle: #e2e8f0; }
.dark .ui-terminal { --ui-confirm-done: #34d399; --ui-confirm-idle: #0b3a75; }
.ui-terminal-copy { display: flex; flex-direction: column; gap: 0.375rem; }
.ui-terminal-ring-draw { animation: ui-terminal-draw 800ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes ui-terminal-draw { from { stroke-dashoffset: var(--ui-ring-length); } to { stroke-dashoffset: 0; } }
.ui-terminal-ring .ui-confirm-ring-center::before {
    content: "";
    position: absolute;
    inset: 1.125rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--ui-confirm-done) 14%, transparent);
}
.ui-terminal-check {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    stroke-width: 2.5;
    animation: ui-receipt-pop 420ms cubic-bezier(.34, 1.56, .64, 1) 550ms both;
}
.ui-terminal-final {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ui-receipt-ok);
    background: color-mix(in srgb, var(--ui-receipt-ok) 12%, transparent);
}
@media (prefers-reduced-motion: reduce) {
    .ui-terminal-ring-draw, .ui-terminal-check { animation: none !important; }
}

/* A perforated edge between sections, with notches cut into the card's sides. */
.ui-receipt-tear {
    position: relative;
    width: calc(100% + 2.5rem);
    margin-inline: -1.25rem;
    height: 0;
    border-top: 2px dashed var(--ui-border);
}
@media (min-width: 480px) { .ui-receipt-tear { width: calc(100% + 3rem); margin-inline: -1.5rem; } }
.ui-receipt-tear::before, .ui-receipt-tear::after {
    content: "";
    position: absolute;
    top: -0.6875rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #f8fafc;
}
.dark .ui-receipt-tear::before, .dark .ui-receipt-tear::after { background: #001529; }
.ui-receipt-tear::before { left: -0.625rem; }
.ui-receipt-tear::after { right: -0.625rem; }

/* Receipt facts (label / value pairs). */
.ui-receipt-facts { width: 100%; display: grid; gap: 0.625rem; font-size: 0.875rem; }
.ui-receipt-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.ui-receipt-facts dt { color: var(--ui-text-muted); flex-shrink: 0; }
.ui-receipt-facts dd { text-align: right; min-width: 0; font-weight: 500; }
.ui-receipt-wrap { overflow-wrap: anywhere; }
.ui-receipt-status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ui-primary); }
/* The status words need 4.5:1: emerald-700 on light (the #10b981 seal green is 2.5:1 on white); dark keeps the seal green. */
.ui-receipt-status.is-final { color: #047857; }
.dark .ui-receipt-status.is-final { color: var(--ui-receipt-ok); }
.ui-receipt-dots { display: inline-flex; gap: 0.1875rem; }
.ui-receipt-dots > span { width: 0.4375rem; height: 0.4375rem; border-radius: 9999px; background: var(--ui-receipt-idle); }
.ui-receipt-dots > span.is-done { background: var(--ui-receipt-ok); }

.ui-receipt-proof { width: 100%; display: flex; align-items: flex-start; gap: 0.875rem; text-align: left; }
.ui-receipt-qr { width: 6.5rem; height: 6.5rem; }
.ui-receipt-txid { font-size: 0.8125rem; }
.ui-receipt-note { font-size: 0.75rem; line-height: 1.45; color: var(--ui-text-muted); }
@media (max-width: 380px) {
    .ui-receipt-proof { flex-direction: column; align-items: center; text-align: center; }
}

.ui-receipt-actions { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.ui-receipt-actions-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ui-receipt-actions-row > * { white-space: nowrap; }
@media (max-width: 420px) { .ui-receipt-actions-row { grid-template-columns: 1fr; } }
/* No fading: 12px text needs 4.5:1 on the primary button and its hover shade (opacity 0.75 gave 3.8:1). */
.ui-receipt-via { font-size: 0.75rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) { .ui-receipt-seal { animation: none !important; } }
@media print {
    .ui-receipt-tear::before, .ui-receipt-tear::after { display: none; }
    .ui-receipt-tear { width: 100%; margin-inline: 0; border-color: #cbd5e1 !important; }
    .ui-receipt-facts dd, .ui-receipt-merchant { color: #000 !important; }
    .ui-receipt-seal { box-shadow: none !important; animation: none !important; }
}

/* =====================================================================================
   Merchant dashboard shell (spec 032, US2): a left rail from 1024px, like the wallet's
   wide-screen menu; below that a top bar and the wallet-style floating bottom menu with a
   raised main button and a More sheet.
   ===================================================================================== */
.dp-shell { min-height: 100dvh; background: #f8fafc; color: var(--ui-text); }
.dark .dp-shell { background: #001529; }

.dp-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 0.9375rem; letter-spacing: -0.01em; color: var(--ui-text); }

/* Rail (wide screens) */
.dp-rail { display: none; }
.dp-rail-nav { display: flex; flex-direction: column; gap: 2px; }
.dp-rail-group { border-top: 1px solid var(--ui-border); padding-top: 0.75rem; margin-top: 0.75rem; display: flex; flex-direction: column; gap: 2px; }
.dp-rail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--ui-radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ui-text-muted);
    transition: background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.dp-rail-item:hover { background: var(--ui-ghost-hover); color: var(--ui-text); }
.dp-rail-item:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.dp-rail-item[aria-current="page"] { background: var(--ui-ghost-hover); color: var(--ui-ghost-text); font-weight: 600; }

/* Top bar (phones and tablets) */
.dp-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.5rem 1rem;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
}

/* Content: wide for lists, tables, charts and logs (capped at 1280px); forms and single items
   use the wallet's 480px column. */
.dp-main {
    width: 100%;
    max-width: 1280px;
    padding: 1rem 1rem calc(env(safe-area-inset-bottom, 0px) + 7rem);
    box-sizing: border-box;
}
.dp-main-narrow { max-width: 480px; }
@media (min-width: 640px) { .dp-main { padding-left: 1.5rem; padding-right: 1.5rem; } }

/* Bottom menu (phones and tablets): a floating bar like the wallet's. */
.dp-bottom {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    transform: translateX(-50%);
    width: min(28rem, calc(100vw - 1.5rem));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 0.375rem;
    border-radius: 1.5rem;
    border: 1px solid var(--ui-border);
    background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: var(--ui-shadow-raised);
}
.dp-bottom-item, .dp-bottom-raised {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-height: 52px;
    border-radius: 1.125rem;
    color: var(--ui-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
}
.dp-bottom-item:hover { color: var(--ui-text); }
.dp-bottom-item:focus-visible, .dp-bottom-raised:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.dp-bottom-item[aria-current="page"] { color: var(--ui-ghost-text); background: var(--ui-ghost-hover); }
.dp-bottom-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 0.125rem; }
.dp-bottom-raised .dp-bottom-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -1.5rem;
    border-radius: 9999px;
    background: var(--ui-primary);
    color: #fff;
    box-shadow: var(--ui-primary-shadow);
}
.dp-bottom-raised { color: var(--ui-text); }
.dp-bottom-raised[aria-current="page"] .dp-bottom-icon { background: var(--ui-primary-hover); }

/* More sheet */
.dp-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 8, 20, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: backdrop-in 0.2s ease both;
}
.dp-sheet {
    width: min(32rem, 100vw);
    max-height: 85dvh;
    overflow-y: auto;
    padding: 1rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
    border-radius: 1.5rem 1.5rem 0 0;
    animation: sheet-up var(--motion-slow) var(--ease-out) both;
}
.dp-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.dp-sheet-list { display: flex; flex-direction: column; gap: 2px; }

@media (min-width: 1024px) {
    .dp-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
    .dp-rail {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        height: 100dvh;
        overflow-y: auto;
        padding: 1rem 0.75rem;
        background: var(--ui-surface);
        border-right: 1px solid var(--ui-border);
    }
    .dp-rail > .dp-brand { padding: 0.25rem 0.75rem 0.75rem; border-bottom: 1px solid var(--ui-border); margin-bottom: 0.25rem; }
    .dp-topbar, .dp-bottom, .dp-sheet-overlay { display: none; }
    .dp-main { padding: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .dp-sheet, .dp-sheet-overlay { animation: none !important; }
}

/* Muted body text in dashboard sections (meets the style guide's contrast in both themes). */
.dp-muted { font-size: 0.875rem; line-height: 1.5; color: var(--ui-text-muted); }

/* The shared `input` class removes the native control look; for <select> keep the browser's
   dropdown arrow so a select still reads as one (docs/UI_STYLE.md notes the gap). */
select.input { -webkit-appearance: menulist; appearance: auto; padding-right: 0.75rem; }

/* ----- Public site (spec 032, US7) ----- */
/* Sticky: stays at the top while the page scrolls, slightly see-through with a blur behind it. */
.dp-sitenav {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--ui-surface) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--ui-border);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .dp-sitenav { background: var(--ui-surface); } }
/* Anchors land below the sticky header on public pages. */
html:has(.dp-site) { scroll-padding-top: 4.75rem; }
.dp-sitenav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 40px;
    padding: 0.375rem 0.625rem;
    border-radius: var(--ui-radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ui-text-muted);
}
.dp-sitenav-link:hover { color: var(--ui-text); background: var(--ui-ghost-hover); }
.dp-sitenav-link:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.dp-sitenav-link[aria-current="page"] { color: var(--ui-ghost-text); font-weight: 600; }
/* The site sheet is used at every width below the md breakpoint, so it isn't hidden at 1024px. */
@media (min-width: 1024px) { .dp-sheet-overlay.dp-sheet-overlay-site { display: flex; } }

.dp-code { position: relative; margin: 0.75rem 0; }
.dp-code-pre {
    margin: 0;
    padding: 0.875rem 1rem;
    padding-right: 6rem;
    border-radius: var(--ui-radius);
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
}
.dp-code-copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 36px;
    padding: 0.25rem 0.625rem;
    border-radius: var(--ui-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 600;
}
.dp-code-copy:hover { background: rgba(255, 255, 255, 0.16); }
.dp-code-copy:focus-visible { outline: 2px solid #80b3ff; outline-offset: 2px; }

/* Public website frame (SiteLayout). */
.dp-site { min-height: 100dvh; display: flex; flex-direction: column; background: #f8fafc; color: var(--ui-text); }
.dark .dp-site { background: #001529; }
.dp-site > main { flex: 1; }

/* Tables stack into labelled rows on phones (spec 032, T061). Add data-label to each cell. */
@media (max-width: 767px) {
    .dp-stack-table thead { display: none; }
    .dp-stack-table, .dp-stack-table tbody { display: block; }
    .dp-stack-table tr { display: block; padding: 0.5rem 0; border-top: 1px solid var(--ui-border); }
    .dp-stack-table td { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.375rem 1rem; text-align: right; }
    .dp-stack-table td > * { min-width: 0; }
    .dp-stack-table td[data-label]::before { content: attr(data-label); flex-shrink: 0; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ui-text-muted); text-align: left; }
    .dp-stack-table td[data-label=""]::before { content: none; }
    .dp-stack-table td[colspan] { display: block; text-align: left; }
}

/* Grid and flex items shouldn't grow past their track on small screens because of long content. */
.grid > .card, .grid > a.card { min-width: 0; }
/* Public pages: cards never force their row wider than the screen. */
.dp-site .card { min-width: 0; max-width: 100%; }
/* Long tokens (file names, IDs) in public-page text wrap instead of widening the page. */
.dp-site code, .dp-site .min-w-0 { overflow-wrap: anywhere; }
/* Dashboard: long IDs, addresses and URLs wrap instead of widening the page on phones. */
.dp-main { min-width: 0; }
.dp-main .font-mono { overflow-wrap: anywhere; }
/* Column flex children (page sections) shrink to the screen, so wide tables scroll inside their card. */
.dp-site .flex-col > * { min-width: 0; }

/* =====================================================================================
   Contrast and link fixes from the axe pass (spec 032, T084). Tailwind colour utilities
   used by older markup are remapped to shades that meet WCAG AA in each theme.
   ===================================================================================== */
/* DigiByte blue as text on navy (dark theme) is too dark: use a lighter shade of the same blue. */
.dark .text-dgb-500, .dark .dark\:text-dgb-500, .dark .hover\:text-dgb-500:hover { color: #80b3ff; }
/* Small grey text on light backgrounds. */
html:not(.dark) .text-slate-500 { color: #475569; }
html:not(.dark) .text-slate-400 { color: #475569; }
.dark .dark\:text-slate-500 { color: #94a3b8; }
.dark .text-slate-500 { color: #94a3b8; }
/* Small red text on white. */
html:not(.dark) .text-red-500 { color: #dc2626; }
/* Telegram pill text. */
.text-\[\#229ED9\] { color: #0b6c99; }
/* Links inside running text are underlined, not told apart by colour alone. */
p a:not([class*="btn"]), li a:not([class*="btn"]):not(.dp-rail-item):not(.dp-sitenav-link),
.dp-muted a, figcaption a { text-decoration: underline; text-underline-offset: 2px; }
/* Code samples can be scrolled with the keyboard; show where focus is. */
.dp-code-pre:focus-visible { outline: 2px solid #80b3ff; outline-offset: 2px; }
/* Light theme: accent text one shade darker so small labels and badges reach 4.5:1. */
html:not(.dark) .text-dgb-500 { color: #0052a3; }
html:not(.dark) .text-emerald-500, html:not(.dark) .text-emerald-600 { color: #047857; }
html:not(.dark) .text-indigo-500 { color: #4338ca; }
html:not(.dark) .text-amber-600 { color: #b45309; }
html:not(.dark) .field-label .opacity-70 { opacity: 1; color: #475569; }
/* Text links styled with hover:underline are underlined at rest too (they sit in running text). */
.dp-site a.text-dgb-500.hover\:underline { text-decoration: underline; text-underline-offset: 2px; }
.dark .text-indigo-500 { color: #a5b4fc; }

/* =====================================================================================
   Currencies (Shared/Ui/CurrencyFlag, CurrencyPicker): the wallet's flags and picker, on the
   shared tokens so they follow light and dark everywhere (dashboard, POS, checkout).
   ===================================================================================== */
.ui-flag { width: 1.5rem; height: 1.125rem; border-radius: 3px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12); }
.ui-flag-round { height: 1.5rem; border-radius: 9999px; box-shadow: none; }
.ui-flag-badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 700; color: var(--ui-text-muted);
    background: color-mix(in srgb, var(--ui-text-muted) 16%, transparent);
}

.ui-picker-overlay {
    position: fixed; inset: 0; z-index: 70;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(4px);
    animation: ui-picker-fade 160ms ease-out both;
}
@media (min-width: 640px) { .ui-picker-overlay { align-items: center; padding: 1.5rem; } }
.ui-picker {
    width: 100%; max-width: 30rem; max-height: min(42rem, 85dvh);
    display: flex; flex-direction: column;
    background: var(--ui-surface); color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
    box-shadow: var(--ui-shadow-raised);
    animation: ui-picker-up 220ms cubic-bezier(.22, 1, .36, 1) both;
}
@media (min-width: 640px) { .ui-picker { border-radius: var(--ui-radius-lg); } }
@keyframes ui-picker-fade { from { opacity: 0; } }
@keyframes ui-picker-up { from { transform: translateY(24px); opacity: 0; } }
.ui-picker-grip { width: 2.5rem; height: 0.25rem; margin: 0.625rem auto 0; border-radius: 9999px; background: var(--ui-border); }
@media (min-width: 640px) { .ui-picker-grip { display: none; } }
.ui-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.875rem 1.25rem 0.5rem; }
.ui-picker-hint { margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: var(--ui-text-muted); }
.ui-picker-search {
    position: relative; margin: 0.25rem 1rem 0.75rem;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0 0.75rem; border-radius: var(--ui-radius);
    border: 1px solid var(--ui-border); background: var(--ui-input-bg, transparent);
    color: var(--ui-text-muted);
}
.ui-picker-search:focus-within { border-color: var(--ui-focus); box-shadow: var(--ui-focus-ring); }
.ui-picker-search input { flex: 1; min-width: 0; padding: 0.75rem 0; background: transparent; border: 0; outline: none; color: var(--ui-text); font-size: 1rem; }
.ui-picker-body { overflow-y: auto; padding: 0 1rem 1rem; overscroll-behavior: contain; }
.ui-picker-group { margin: 0.75rem 0.25rem 0.375rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-text-muted); }
.ui-picker-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); overflow: hidden; }
.ui-picker-list > li + li { border-top: 1px solid var(--ui-border); }
.ui-picker-row {
    width: 100%; min-height: 3.25rem; display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.875rem; text-align: left; background: transparent; color: inherit;
    transition: background-color 120ms;
}
.ui-picker-row:hover { background: var(--ui-ghost-hover); }
.ui-picker-row:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }
.ui-picker-row.is-selected { background: var(--ui-ghost-active, var(--ui-ghost-hover)); }
.ui-picker-names { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ui-picker-code { font-size: 0.9375rem; font-weight: 700; }
.ui-picker-name { font-size: 0.75rem; color: var(--ui-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-picker-symbol { font-size: 0.8125rem; color: var(--ui-text-muted); font-variant-numeric: tabular-nums; }
.ui-picker-check { color: var(--ui-primary); flex-shrink: 0; }
.ui-picker-empty { padding: 2rem 0; text-align: center; font-size: 0.875rem; color: var(--ui-text-muted); }
@media (prefers-reduced-motion: reduce) { .ui-picker, .ui-picker-overlay { animation: none !important; } }

/* =====================================================================================
   Numbers, as in the wallet (DigiByte.Web app.css): anything marked tabular-nums, plus amount
   and numeric fields, renders in JetBrains Mono with fixed-width digits so values line up and
   don't jitter as they change. The font is already declared by the shared ui.css.
   ===================================================================================== */
.tabular-nums,
input[type="number"],
input[inputmode="decimal"],
input[inputmode="numeric"] {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* =====================================================================================
   Loader (Shared/Loader.razor, Layout/ReconnectModal): the DigiByte mark breathing inside an
   orbiting gradient arc. Size with --dgb-loader-size. Theme colours come from the tokens.
   ===================================================================================== */
.dgb-loader {
    --dgb-loader-size: 4rem;
    position: relative;
    width: var(--dgb-loader-size);
    height: var(--dgb-loader-size);
    flex-shrink: 0;
}
.dgb-loader-sm { --dgb-loader-size: 2.5rem; }
.dgb-loader-lg { --dgb-loader-size: 5.5rem; }
/* Track */
.dgb-loader::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 3px solid color-mix(in srgb, var(--ui-primary) 14%, transparent);
}
/* Orbiting arc: a conic gradient cut to a ring. */
.dgb-loader-arc {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 200deg,
        color-mix(in srgb, var(--ui-primary) 35%, transparent) 260deg, var(--ui-primary) 340deg, transparent 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    animation: dgb-loader-spin 1.1s linear infinite;
}
/* Glow behind the mark */
.dgb-loader-glow {
    position: absolute;
    inset: 22%;
    border-radius: 9999px;
    background: radial-gradient(circle, color-mix(in srgb, var(--ui-primary) 45%, transparent), transparent 70%);
    filter: blur(6px);
    animation: dgb-loader-glow 1.6s ease-in-out infinite;
}
.dgb-loader-mark {
    position: absolute;
    inset: 22%;
    width: 56%;
    height: 56%;
    animation: dgb-loader-breathe 1.6s ease-in-out infinite;
}
@keyframes dgb-loader-spin { to { transform: rotate(360deg); } }
@keyframes dgb-loader-breathe { 0%, 100% { transform: scale(0.9); } 50% { transform: scale(1.04); } }
@keyframes dgb-loader-glow { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 0.9; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
    .dgb-loader-arc { animation-duration: 3s; }
    .dgb-loader-mark, .dgb-loader-glow { animation: none; }
}
.dgb-loader-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.875rem; text-align: center; }
.dgb-loader-text { font-size: 0.875rem; color: var(--ui-text-muted); }
.dgb-loader-text::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: dgb-loader-dots 1.4s steps(4, end) infinite; }
@keyframes dgb-loader-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .dgb-loader-text::after { animation: none; content: "…"; } }

/* =====================================================================================
   Thin scrollbars everywhere (like the wallet's .thin-scrollbar): a slim rounded thumb on a
   clear track, in both themes. Firefox and current Chromium use scrollbar-width/-color;
   older WebKit uses the pseudo-elements.
   ===================================================================================== */
:root { --dp-scroll-thumb: rgba(100, 116, 139, 0.35); --dp-scroll-thumb-hover: rgba(100, 116, 139, 0.6); }
.dark { --dp-scroll-thumb: rgba(148, 163, 184, 0.28); --dp-scroll-thumb-hover: rgba(148, 163, 184, 0.5); }
* { scrollbar-width: thin; scrollbar-color: var(--dp-scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--dp-scroll-thumb); border-radius: 9999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--dp-scroll-thumb-hover); }
*::-webkit-scrollbar-corner { background: transparent; }

/* Blazor focuses the page heading after each navigation (FocusOnNavigate) so screen readers start there. That
   focus isn't a keyboard user's, so don't draw the browser's ring around the heading. */
h1[tabindex="-1"]:focus { outline: none; }

/* Wallet buttons on the checkout and tip page (Shared/Ui/WalletButtons). */
.ui-wallet-buttons { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.ui-wallet-web { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.ui-wallet-web-logo { width: 1.125rem; height: 1.125rem; border-radius: 0.25rem; }
.ui-wallet-hint { margin: 0; text-align: center; font-size: 0.75rem; color: var(--ui-text-muted); }
.dp-signin-wallet { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; max-width: 22rem; }
