/* Money / banknote themed styles layered on top of Tailwind utilities. */

/* Public privacy policy and terms share a readable, responsive document layout. */
.legal-heading { max-width: 48rem; }
.legal-eyebrow { margin-bottom: 0.8rem; color: var(--gold-300); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.legal-intro { margin-top: 1rem; color: rgba(243, 236, 216, 0.75); font-size: 0.95rem; line-height: 1.85; }
.legal-updated { margin-top: 1rem; color: rgba(243, 236, 216, 0.6); font-size: 0.75rem; }
.legal-updated time { color: var(--gold-200); }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0; border-bottom: 1px solid rgba(212, 167, 44, 0.2); padding-bottom: 0.75rem; }
.legal-tabs a { border: 1px solid transparent; border-radius: 0.65rem; padding: 0.75rem 1rem; color: rgba(243, 236, 216, 0.7); font-size: 0.85rem; }
.legal-tabs a:hover { background: rgba(212, 167, 44, 0.07); color: var(--gold-100); }
.legal-tabs a[aria-current="page"] { border-color: rgba(212, 167, 44, 0.3); background: rgba(212, 167, 44, 0.1); color: var(--gold-200); }
.legal-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); align-items: start; gap: 2rem; }
.legal-sidebar { position: sticky; top: 5.5rem; }
.legal-contents { padding: 1.25rem; }
.legal-contents h2 { margin-bottom: 0.8rem; color: var(--gold-200); font-size: 0.75rem; font-weight: 600; }
.legal-contents ol { display: grid; gap: 0.25rem; padding-left: 1.25rem; list-style: decimal; color: rgba(236, 201, 101, 0.6); }
.legal-contents li { font-size: 0.75rem; }
.legal-contents a { display: block; padding: 0.35rem 0; color: rgba(243, 236, 216, 0.7); line-height: 1.5; }
.legal-contents a:hover { color: var(--gold-200); }
.legal-article { min-width: 0; padding: clamp(1.25rem, 4vw, 3rem); }
.legal-provider { display: grid; gap: 1rem; border-bottom: 1px solid rgba(212, 167, 44, 0.2); padding-bottom: 1.75rem; }
.legal-provider dt { margin-bottom: 0.3rem; color: rgba(243, 236, 216, 0.55); font-size: 0.7rem; }
.legal-provider dd { color: var(--gold-100); font-size: 0.85rem; overflow-wrap: anywhere; }
.legal-section { margin-top: 2rem; scroll-margin-top: 6rem; }
.legal-section h2 { color: var(--gold-200); font-size: 1.15rem; font-weight: 600; line-height: 1.5; }
.legal-number { color: rgba(236, 201, 101, 0.55); }
.legal-section p { margin-top: 0.85rem; color: rgba(243, 236, 216, 0.8); font-size: 0.875rem; line-height: 1.95; overflow-wrap: anywhere; }
.legal-article a { color: var(--gold-200); text-decoration: underline; text-underline-offset: 0.2em; }
.legal-article a:hover { color: var(--gold-100); }
.legal-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2rem; border-top: 1px solid rgba(212, 167, 44, 0.2); padding-top: 1.5rem; font-size: 0.8rem; }
.legal-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin-top: 0.75rem; }
.legal-footer-links a { color: rgba(243, 236, 216, 0.65); text-decoration: underline; text-underline-offset: 0.2em; }
.legal-footer-links a:hover, .legal-footer-links a[aria-current="page"] { color: var(--gold-200); }
.legal-register-note { color: var(--bill-800); font-size: 0.75rem; line-height: 1.8; }
.legal-register-note a { font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
.legal-register-note > a:first-of-type { margin-left: 0.25rem; }
.legal-page a:focus-visible, .legal-footer-links a:focus-visible, .legal-register-note a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
#legal-top { scroll-margin-top: 5rem; }
@media (min-width: 640px) { .legal-provider { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .legal-sidebar { position: static; }
    .legal-contents ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1.75rem; }
}
@media (max-width: 540px) { .legal-contents ol { grid-template-columns: minmax(0, 1fr); } }

/* Sign-in controls */
.password-field { position: relative; }
.password-field > input { padding-right: 3.25rem; }
.password-toggle { position: absolute; inset: 0.125rem 0.125rem 0.125rem auto; display: inline-flex; width: 2.75rem; align-items: center; justify-content: center; border-radius: 0.4rem; color: var(--bill-700); }
.password-toggle[hidden], .password-eye-off, .password-toggle[aria-pressed="true"] .password-eye { display: none; }
.password-toggle[aria-pressed="true"] .password-eye-off { display: block; }
.password-toggle:hover { background: rgba(13, 61, 42, 0.08); }
.password-toggle:focus-visible, .google-sign-in:focus-visible { outline: 2px solid var(--bill-700); outline-offset: 2px; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; color: rgba(13, 61, 42, 0.65); font-size: 0.75rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(13, 61, 42, 0.2); }
.google-sign-in { display: flex; width: 100%; min-height: 2.75rem; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.75rem 1rem; border: 1px solid #747775; border-radius: 0.5rem; background: #fff; color: #1f1f1f; font-size: 0.875rem; font-weight: 600; transition: background 150ms; }
.google-sign-in > svg { flex-shrink: 0; }
.google-sign-in:hover:enabled { background: #f2f2f2; }
.google-sign-in:disabled { cursor: not-allowed; opacity: 0.65; }
.auth-recaptcha { width: 100%; min-width: 0; height: 78px; }
.auth-recaptcha > .g-recaptcha { width: 304px; height: 78px; transform-origin: top left; }

/* Zakat calculator */
.zakat-eyebrow { margin-bottom: 0.6rem; color: var(--gold-300); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.zakat-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 1.75rem; }
.zakat-form, .zakat-summary { display: grid; min-width: 0; gap: 1.5rem; }
.zakat-summary, #zakat-result { scroll-margin-top: 6rem; }
.zakat-section-heading { display: flex; gap: 0.75rem; align-items: center; }
.zakat-section-heading > span { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border: 1px solid rgba(212, 167, 44, 0.3); border-radius: 50%; color: var(--gold-300); font-size: 0.65rem; }
.zakat-hint { margin-top: 0.65rem; color: rgba(243, 236, 216, 0.55); font-size: 0.75rem; line-height: 1.7; }
.zakat-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.1rem; }
.zakat-field { display: block; min-width: 0; }
.zakat-field-name { display: block; margin-bottom: 0.4rem; color: rgba(243, 236, 216, 0.8); font-size: 0.8rem; }
.zakat-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.zakat-input-wrap > input { min-width: 0; }
.zakat-input-wrap > span { flex: 0 0 2rem; text-align: right; font-size: 0.7rem; color: var(--gold-200); }
.zakat-more { margin-top: 1.25rem; border-top: 1px solid rgba(212, 167, 44, 0.15); padding-top: 0.9rem; }
.zakat-more > summary { cursor: pointer; color: var(--gold-200); font-size: 0.75rem; }
.zakat-hint + .zakat-field { margin-top: 1rem; }
.zakat-year { display: flex; align-items: flex-start; gap: 0.65rem; margin-top: 1.5rem; font-size: 0.8rem; line-height: 1.7; color: rgba(243, 236, 216, 0.85); }
.zakat-year > input { flex-shrink: 0; width: 1rem; height: 1rem; margin-top: 0.2rem; accent-color: var(--gold-400); }
.zakat-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.zakat-result-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; color: var(--bill-700); }
.zakat-status { margin-top: 1rem; font-size: 0.8rem; font-weight: 600; line-height: 1.7; color: var(--bill-800); }
.zakat-result-note { margin-top: 0.75rem; font-size: 0.8rem; line-height: 1.8; color: var(--bill-800); }
.zakat-breakdown { display: grid; gap: 0.8rem; margin-top: 1.5rem; border-top: 1px solid rgba(13, 61, 42, 0.2); padding-top: 1.25rem; font-size: 0.75rem; }
.zakat-breakdown > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.35rem 1rem; }
.zakat-breakdown dd { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.zakat-pdf-button { display: block; width: 100%; margin-top: 1.5rem; border-radius: 0.75rem; padding: 0.8rem 1rem; background: var(--bill-800); color: var(--gold-200); font-size: 0.8rem; font-weight: 600; }
.zakat-pdf-button[hidden] { display: none; }
.zakat-pdf-button:hover { background: var(--bill-700); }
.zakat-pdf-button:disabled { opacity: 0.6; cursor: wait; }
.zakat-pdf-status { margin-top: 0.5rem; font-size: 0.75rem; color: var(--bill-800); }
.zakat-pdf-status:empty { display: none; }
.zakat-empty-facts { margin-top: 1.5rem; border-top: 1px solid rgba(13, 61, 42, 0.2); padding-top: 1rem; font-size: 0.75rem; line-height: 1.8; }
.zakat-empty-facts > p + p { margin-top: 0.5rem; }
.zakat-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.zakat-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.zakat-table th { color: rgba(243, 236, 216, 0.5); font-weight: 500; }
.zakat-table th, .zakat-table td { padding: 0.65rem 0; text-align: right; }
.zakat-table th:first-child, .zakat-table td:first-child { text-align: left; padding-right: 1rem; }
.zakat-table td { border-top: 1px solid rgba(212, 167, 44, 0.12); }
.zakat-table td:last-child { white-space: nowrap; padding-left: 0.75rem; }
@media (max-width: 850px) { .zakat-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .zakat-input-grid { grid-template-columns: minmax(0, 1fr); } }

/* Home shells render before external price providers. Keep placeholders sized to their content. */
.home-load-status { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.75rem; max-width: 80rem; margin: 0 auto; padding: 0.6rem 1rem; color: rgba(243, 236, 216, 0.65); font-size: 0.8rem; }
.home-load-status[hidden], .home-load-status [hidden] { display: none; }
.is-load-error > .home-load-status { color: #fde68a; padding: 1rem; }
.home-updated { min-height: 1rem; }
.home-updated > .skeleton { display: inline-block; max-width: 18rem; }
.skeleton { position: relative; display: block; overflow: hidden; border-radius: 0.5rem; background: rgba(247, 227, 161, 0.10); }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 15%, rgba(247, 227, 161, 0.18) 45%, transparent 75%); transform: translateX(-100%); animation: skeleton-shimmer 1.7s ease-in-out infinite; }
.banknote .skeleton { background: rgba(13, 61, 42, 0.14); }
.banknote .skeleton::after { background: linear-gradient(100deg, transparent 15%, rgba(255, 255, 255, 0.5) 45%, transparent 75%); }
.skeleton-line { width: 100%; height: 0.9rem; }
.skeleton-short { width: 46%; }
.skeleton-circle { flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; }
.skeleton-content { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.5rem; }
.skeleton-hero { min-height: 27rem; }
.skeleton-total { width: 75%; max-width: 28rem; height: 3.75rem; margin: 0.25rem 0 0.75rem; }
.skeleton-columns { display: flex; gap: 1.5rem; }
.skeleton-hero-bottom { margin-top: 7rem; height: 1.75rem; border-radius: 2rem; }
.skeleton-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.25rem; }
.skeleton-tile { height: 6rem; }
.skeleton-holding { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 0.5fr); gap: 1.25rem; align-items: center; min-height: 3.5rem; }
.skeleton-field { height: 3rem; }
.skeleton-chart { height: 16rem; margin-top: 1.25rem; }
.skeleton-ticker { display: flex; align-items: center; gap: 2.5rem; overflow: hidden; min-height: 2.75rem; padding: 0.5rem 1.5rem; border-bottom: 1px solid rgba(212, 167, 44, 0.1); }
.skeleton-ticker-item { display: flex; flex: 0 0 10rem; align-items: center; gap: 0.75rem; }
.skeleton-ticker .skeleton-circle { flex-basis: 1.25rem; width: 1.25rem; height: 1.25rem; }
.is-load-error .skeleton::after, .skeleton-paused::after { animation: none; opacity: 0; }
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }
@media (max-width: 640px) { .skeleton-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .skeleton-hero { min-height: 21rem; } .skeleton-total { height: 2.75rem; } .skeleton-hero-bottom { margin-top: 4rem; } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; opacity: 0; } }

:root {
    --bill-950: #04190f;
    --bill-900: #082b1d;
    --bill-800: #0d3d2a;
    --bill-700: #12553a;
    --gold-200: #f7e3a1;
    --gold-300: #ecc965;
    --gold-400: #d4a72c;
    --gold-600: #8c6512;
    --paper: #f3ecd8;
    --ink: #0d3d2a;
}

body {
    background-color: var(--bill-950);
    background-image:
        radial-gradient(1200px 600px at 10% -10%, rgba(212, 167, 44, 0.10), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(18, 85, 58, 0.55), transparent 60%),
        url("../img/waves.svg");
    background-attachment: fixed;
}

.font-display { font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto; }
.font-num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* Gold foil text */
.text-foil {
    background: linear-gradient(100deg, #fff4c9 0%, #ecc965 25%, #b8891a 50%, #f7e3a1 70%, #d4a72c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Dark panel with a fine gold hairline, like the frame of a banknote */
.panel {
    background: linear-gradient(180deg, rgba(13, 61, 42, 0.78), rgba(8, 43, 29, 0.88));
    border: 1px solid rgba(212, 167, 44, 0.22);
    box-shadow: 0 0 0 4px rgba(8, 43, 29, 0.6), 0 0 0 5px rgba(212, 167, 44, 0.10), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
    border-radius: 1.25rem;
    backdrop-filter: blur(6px);
}

/* Cream banknote card with guilloche rosettes and a micro-text border */
.banknote {
    position: relative;
    overflow: hidden;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        url("../img/rosette-green.svg"),
        url("../img/rosette-green.svg"),
        repeating-linear-gradient(115deg, rgba(13, 61, 42, 0.035) 0 2px, transparent 2px 7px),
        linear-gradient(135deg, #f8f2e0 0%, #ece2c4 55%, #e4d6ad 100%);
    background-size: 360px 360px, 200px 200px, auto, auto;
    background-position: right -110px center, left -90px top -90px, 0 0, 0 0;
    background-repeat: no-repeat, no-repeat, repeat, no-repeat;
    border-radius: 1.25rem;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(13, 61, 42, 0.25);
}

.banknote::before {
    /* Inner engraved frame */
    content: "";
    position: absolute;
    inset: 10px;
    border: 1.5px solid rgba(13, 61, 42, 0.45);
    border-radius: 0.9rem;
    outline: 1px dashed rgba(13, 61, 42, 0.25);
    outline-offset: -6px;
    pointer-events: none;
}

.banknote-serial {
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 0.18em;
    color: #9b2c2c;
}

/* Coin badge: radial gold with a reeded edge */
.coin {
    display: inline-grid;
    place-items: center;
    border-radius: 9999px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    color: #4a3407;
    background:
        radial-gradient(circle at 32% 28%, #fff6cf 0%, #f0cf6b 28%, #c99a24 62%, #8c6512 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 246, 207, 0.55),
        inset 0 -3px 6px rgba(74, 52, 7, 0.45),
        0 0 0 2px #8c6512,
        0 0 0 4px rgba(236, 201, 101, 0.35),
        0 6px 14px -4px rgba(0, 0, 0, 0.6);
    position: relative;
}

.coin::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 9999px;
    background: repeating-conic-gradient(from 0deg, rgba(74, 52, 7, 0.55) 0 4deg, transparent 4deg 8deg);
    -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px));
    mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px));
    pointer-events: none;
}

.coin-silver {
    color: #2f3a3f;
    background: radial-gradient(circle at 32% 28%, #ffffff 0%, #dfe6ea 30%, #a3b1b8 65%, #5f6e75 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.6),
        inset 0 -3px 6px rgba(47, 58, 63, 0.45),
        0 0 0 2px #5f6e75,
        0 6px 14px -4px rgba(0, 0, 0, 0.6);
}

/* Banknote-style badge for currencies */
.note-badge {
    display: inline-grid;
    place-items: center;
    border-radius: 0.55rem;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    color: var(--ink);
    background:
        repeating-linear-gradient(45deg, rgba(13, 61, 42, 0.12) 0 1px, transparent 1px 4px),
        linear-gradient(135deg, #e7f3df, #b9d9b0);
    box-shadow: inset 0 0 0 1.5px rgba(13, 61, 42, 0.55), inset 0 0 0 4px rgba(255, 255, 255, 0.35), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
}

/* Shared asset logos: currency symbols, crypto marks and metal medallions. */
.asset-logo {
    display: block;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(247, 227, 161, 0.2), 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Let market panels and their chart shrink inside the mobile grid. */
[data-detail], [data-converter] { min-width: 0; }
[data-detail] canvas { max-width: 100%; }

/* Exchange board ticker */
.ticker {
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker-scroll 60s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
}

/* Form controls */
.field {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 167, 44, 0.25);
    background: rgba(4, 25, 15, 0.65);
    color: #f3ecd8;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus {
    border-color: var(--gold-300);
    box-shadow: 0 0 0 3px rgba(236, 201, 101, 0.18);
}

.field::placeholder { color: rgba(243, 236, 216, 0.35); }

/* Profile photos */
#profile { scroll-margin-top: 6rem; }
.profile-photo-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.profile-photo-form { display: flex; align-items: flex-start; gap: 1.5rem; margin-top: 1.25rem; }
.profile-avatar { display: grid; flex: 0 0 6rem; width: 6rem; height: 6rem; place-items: center; overflow: hidden; border-radius: 50%; border: 2px solid rgba(236, 201, 101, 0.4); background: rgba(212, 167, 44, 0.12); color: var(--gold-200); font-family: "Fraunces", Georgia, serif; font-size: 2.25rem; }
.profile-avatar > img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-fields { flex: 1; min-width: 0; }
.profile-photo-input { display: block; margin-top: 0.375rem; font-size: 0.8125rem; }
.profile-photo-input::file-selector-button { margin-right: 0.75rem; border: 0; border-radius: 0.375rem; padding: 0.35rem 0.625rem; background: rgba(212, 167, 44, 0.18); color: var(--gold-200); cursor: pointer; }
.profile-photo-status { margin-top: 0.5rem; color: var(--gold-200); font-size: 0.75rem; }
.profile-photo-status:empty { display: none; }
.profile-photo-status.is-error { color: #fecaca; }
.profile-photo-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.profile-photo-buttons [hidden] { display: none; }
.profile-photo-buttons button:disabled { opacity: 0.5; cursor: wait; }
.profile-photo-remove { font-size: 0.75rem; }
.avatar > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
@media (max-width: 479px) {
    .profile-photo-form { flex-direction: column; gap: 1rem; }
    .profile-photo-fields { width: 100%; }
}

select.field option, select.field optgroup { background: #082b1d; color: #f3ecd8; }

/* Themed selects; native controls remain available when JavaScript is disabled. */
.custom-select { position: relative; min-width: 0; width: 100%; }
.custom-select--auto { width: auto; max-width: 100%; }
.custom-select__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}
.custom-select__trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
}
.custom-select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: contain;
}
.custom-select__icon[hidden] { display: none; }
.custom-select__trigger:has(.custom-select__icon:not([hidden])) { gap: 0.65rem; }
.custom-select__trigger:hover:not(:disabled) { border-color: rgba(236, 201, 101, 0.6); }
.custom-select__trigger[aria-expanded="true"] {
    border-color: var(--gold-300);
    box-shadow: 0 0 0 3px rgba(236, 201, 101, 0.18);
}
.custom-select__trigger:disabled { opacity: 0.45; cursor: not-allowed; }
.custom-select__trigger[aria-invalid="true"] { border-color: #f87171; }
.custom-select__arrow {
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    margin: -0.25rem 0.15rem 0 0;
    border-right: 1.5px solid var(--gold-200);
    border-bottom: 1.5px solid var(--gold-200);
    transform: rotate(45deg);
    transition: transform 0.15s;
}
.custom-select__trigger[aria-expanded="true"] .custom-select__arrow { transform: translateY(0.25rem) rotate(225deg); }
.custom-select__menu {
    position: fixed;
    z-index: 100;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.375rem;
    border: 1px solid rgba(212, 167, 44, 0.45);
    border-radius: 0.875rem;
    background: linear-gradient(160deg, #0d3d2a, #082b1d 65%);
    color: var(--paper);
    box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.75), 0 0 0 3px rgba(212, 167, 44, 0.06);
    scrollbar-width: thin;
    scrollbar-color: var(--gold-600) var(--bill-900);
}
.custom-select__menu[hidden], .custom-select__menu [hidden] { display: none; }
.custom-select__group {
    padding: 0.7rem 0.65rem 0.35rem;
    color: rgba(247, 227, 161, 0.65);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.custom-select__menu [role="group"] + [role="group"] { margin-top: 0.375rem; border-top: 1px solid rgba(212, 167, 44, 0.15); }
.custom-select__option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 2.1rem 0.65rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.custom-select__option.is-active { background: rgba(236, 201, 101, 0.10); border-color: rgba(236, 201, 101, 0.28); }
.custom-select__option[aria-selected="true"] { background: rgba(212, 167, 44, 0.14); color: var(--gold-200); font-weight: 600; }
.custom-select__option[aria-selected="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.8rem;
    width: 0.35rem;
    height: 0.65rem;
    border-right: 1.5px solid var(--gold-300);
    border-bottom: 1.5px solid var(--gold-300);
    transform: translateY(-65%) rotate(45deg);
}
.custom-select__option[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.market-history-select { flex: 0 0 auto; width: 20rem; max-width: 100%; min-width: 0; }
.custom-select__menu--single-line .custom-select__option > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
    .custom-select__arrow { transition: none; }
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.65rem 1.1rem;
    font-weight: 600;
    color: #3a2905;
    background: linear-gradient(180deg, #f7e3a1 0%, #ecc965 40%, #c99a24 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 1px #8c6512, 0 8px 18px -8px rgba(212, 167, 44, 0.7);
    transition: filter 0.15s, transform 0.15s;
}

.btn-gold:hover { filter: brightness(1.06); }
.btn-gold:active { transform: translateY(1px); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.75rem;
    padding: 0.55rem 0.9rem;
    font-weight: 500;
    color: #f3ecd8;
    border: 1px solid rgba(212, 167, 44, 0.28);
    background: rgba(4, 25, 15, 0.4);
    transition: background 0.15s, border-color 0.15s;
}

.btn-ghost:hover { background: rgba(212, 167, 44, 0.12); border-color: rgba(212, 167, 44, 0.5); }

/* Shared confirmation and information dialogs. The top layer keeps the page inert. */
html.has-app-dialog { overflow: hidden; }
.app-dialog {
    position: fixed;
    inset: 0;
    width: min(28rem, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(236, 201, 101, 0.3);
    border-radius: 1.25rem;
    color: var(--paper);
    background: linear-gradient(145deg, #0d3525, #07261a 70%);
    box-shadow: 0 32px 100px -24px rgba(0, 0, 0, 0.85), 0 0 0 4px rgba(236, 201, 101, 0.035), inset 0 1px 0 rgba(247, 227, 161, 0.04);
    scrollbar-width: thin;
    scrollbar-color: var(--gold-600) var(--bill-900);
}
.app-dialog[open] { animation: app-dialog-enter 0.16s ease-out; }
.app-dialog::backdrop { background: rgba(1, 12, 7, 0.76); backdrop-filter: blur(5px); }
.app-dialog [hidden] { display: none; }
.app-dialog-content { position: relative; padding: 1.75rem 1.75rem 1.5rem; }
.app-dialog-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    color: rgba(243, 236, 216, 0.45);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.app-dialog-close:hover { color: var(--paper); background: rgba(243, 236, 216, 0.06); }
.app-dialog-close svg { width: 1.125rem; height: 1.125rem; }
.app-dialog-symbol {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(236, 201, 101, 0.22);
    border-radius: 0.875rem;
    color: var(--gold-300);
    background: rgba(212, 167, 44, 0.1);
    box-shadow: inset 0 1px 0 rgba(247, 227, 161, 0.05);
}
.app-dialog-symbol svg { width: 1.5rem; height: 1.5rem; }
.app-dialog-title { padding-right: 1rem; color: var(--gold-200); font-size: 1.5rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.app-dialog-message { margin-top: 0.75rem; color: rgba(243, 236, 216, 0.7); font-size: 0.875rem; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.app-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; padding: 1.25rem 1.75rem; border-top: 1px solid rgba(236, 201, 101, 0.1); background: rgba(4, 25, 15, 0.25); }
.app-dialog-button { min-width: 6.5rem; min-height: 2.75rem; max-width: 100%; font-size: 0.8125rem; text-align: center; overflow-wrap: anywhere; }
.app-dialog :where(button):focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }
@keyframes app-dialog-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 479px) {
    .app-dialog-content { padding: 1.5rem 1.25rem; }
    .app-dialog-title { font-size: 1.375rem; }
    .app-dialog-actions { gap: 0.625rem; padding: 1rem 1.25rem; }
    .app-dialog-button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .app-dialog[open] { animation: none; }
    .app-dialog-close { transition: none; }
}

.seg { display: inline-flex; padding: 3px; border-radius: 0.8rem; background: rgba(13, 61, 42, 0.12); box-shadow: inset 0 0 0 1px rgba(13, 61, 42, 0.3); }
.seg a { padding: 0.35rem 0.75rem; border-radius: 0.6rem; font-weight: 600; font-size: 0.85rem; color: rgba(13, 61, 42, 0.75); }
.seg a.active { background: var(--ink); color: var(--gold-200); }

.progress-gold {
    background: linear-gradient(90deg, #8c6512, #ecc965 60%, #fff4c9);
    box-shadow: 0 0 12px rgba(236, 201, 101, 0.5);
}

/* Savings goal: the existing green and gold palette, with room for the personal goal. */
.goal-page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; }
.goal-eyebrow { margin-bottom: 0.65rem; color: var(--gold-300); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.16em; }
.goal-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 1.75rem; margin-top: 2rem; }
.goal-overview { display: grid; gap: 1.75rem; min-width: 0; }
.goal-hero { position: relative; overflow: hidden; padding: 2rem; background: radial-gradient(ellipse at 100% 0%, rgba(212, 167, 44, 0.13), transparent 60%), linear-gradient(155deg, #10452f, #082b1d 65%); }
.goal-hero-top, .goal-progress-heading, .goal-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.goal-hero-icon { display: grid; place-items: center; width: 4rem; height: 4rem; border: 1px solid rgba(236, 201, 101, 0.3); border-radius: 1.2rem; color: var(--gold-200); background: rgba(212, 167, 44, 0.09); }
.goal-hero-icon svg { width: 2.3rem; height: 2.3rem; }
.goal-status { padding: 0.4rem 0.7rem; border: 1px solid rgba(236, 201, 101, 0.22); border-radius: 2rem; font-size: 0.65rem; color: var(--gold-200); background: rgba(4, 25, 15, 0.3); }
.goal-status.is-complete { color: #86efac; border-color: rgba(134, 239, 172, 0.4); }
.goal-hero-title { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.2; color: var(--gold-100, #fff4c9); overflow-wrap: anywhere; }
.goal-note { margin-top: 0.75rem; color: rgba(243, 236, 216, 0.65); font-size: 0.85rem; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.goal-target-label { margin-top: 2rem; color: rgba(243, 236, 216, 0.6); font-size: 0.75rem; }
.goal-target { margin-top: 0.25rem; font-size: clamp(1.6rem, 3vw, 2.6rem); color: var(--gold-200); overflow-wrap: anywhere; }
.goal-progress-heading { margin-top: 1.75rem; font-size: 0.75rem; color: rgba(243, 236, 216, 0.7); }
.goal-progress-heading strong { color: var(--gold-200); font-size: 1rem; }
.goal-progress-track { height: 0.85rem; margin-top: 0.7rem; overflow: hidden; border-radius: 1rem; background: rgba(4, 25, 15, 0.65); box-shadow: inset 0 0 0 1px rgba(212, 167, 44, 0.2); }
.goal-progress-fill { height: 100%; border-radius: inherit; }
.goal-progress-scale { display: flex; justify-content: space-between; margin-top: 0.65rem; color: rgba(243, 236, 216, 0.4); font-family: "JetBrains Mono", monospace; font-size: 0.6rem; }
.goal-motivation { margin-top: 1rem; color: var(--gold-200); font-size: 0.75rem; line-height: 1.7; }
.goal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.75rem; padding-top: 1.4rem; border-top: 1px solid rgba(212, 167, 44, 0.2); }
.goal-stats span, .goal-plan-stats span { display: block; color: rgba(243, 236, 216, 0.55); font-size: 0.7rem; }
.goal-stats strong, .goal-plan-stats strong { display: block; margin-top: 0.5rem; font-size: 0.9rem; overflow-wrap: anywhere; }
.goal-source { margin-top: 1.5rem; font-size: 0.65rem; color: rgba(243, 236, 216, 0.45); line-height: 1.7; overflow-wrap: anywhere; }
.goal-empty-copy { max-width: 30rem; margin-top: 1rem; color: rgba(243, 236, 216, 0.65); font-size: 0.9rem; line-height: 1.8; }
.goal-empty-illustration { display: flex; align-items: center; max-width: 22rem; margin: 2.5rem 0; color: var(--gold-300); }
.goal-empty-illustration > span:not(.goal-empty-line) { padding: 0.9rem; border: 1px solid rgba(236, 201, 101, 0.2); border-radius: 1rem; background: rgba(236, 201, 101, 0.05); }
.goal-empty-illustration svg { width: 2rem; height: 2rem; }
.goal-empty-line { flex: 1; border-top: 1px dashed rgba(236, 201, 101, 0.35); }
.goal-plan, .goal-editor { min-width: 0; padding: 1.6rem; }
.goal-section-heading { justify-content: flex-start; }
.goal-small-icon { color: var(--gold-300); }
.goal-small-icon svg { width: 1.5rem; height: 1.5rem; }
.goal-plan-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.goal-plan-copy { margin-top: 0.75rem; font-size: 0.8rem; line-height: 1.7; color: rgba(243, 236, 216, 0.7); }
.goal-plan-copy.up { color: #86efac; }
.goal-plan-copy.down { color: #fca5a5; }
.goal-plan-footnote { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(212, 167, 44, 0.15); font-size: 0.65rem; line-height: 1.7; color: rgba(243, 236, 216, 0.45); }
.goal-plan-link { display: inline-block; margin-top: 1rem; color: var(--gold-200); font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }
.goal-rate-warning { margin-top: 1rem; padding: 0.85rem; border-radius: 0.75rem; background: rgba(212, 167, 44, 0.08); color: var(--gold-200); font-size: 0.75rem; line-height: 1.7; }
.goal-editor { scroll-margin-top: 6rem; }
.goal-form { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.goal-field-label { font-size: 0.75rem; color: rgba(243, 236, 216, 0.8); }
.goal-optional { color: rgba(243, 236, 216, 0.4); font-size: 0.65rem; }
.goal-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.goal-type { position: relative; cursor: pointer; min-width: 0; }
.goal-type > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.goal-type > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; height: 100%; min-height: 5.2rem; padding: 0.75rem 0.3rem; border: 1px solid rgba(212, 167, 44, 0.2); border-radius: 0.85rem; font-size: 0.7rem; text-align: center; color: rgba(243, 236, 216, 0.6); background: rgba(4, 25, 15, 0.35); transition: border-color 0.15s, background 0.15s; }
.goal-type svg { width: 1.5rem; height: 1.5rem; }
.goal-type > input:checked + span { border-color: var(--gold-300); color: var(--gold-200); background: rgba(212, 167, 44, 0.12); }
.goal-type:hover > span { border-color: rgba(236, 201, 101, 0.6); }
.goal-type > input:focus-visible + span { outline: 2px solid var(--gold-300); outline-offset: 3px; }
.goal-amount-fields { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0.75rem; }
.goal-amount-fields > label { min-width: 0; }
.goal-date { color-scheme: dark; min-width: 0; }
.goal-form textarea { resize: vertical; }
.goal-remove { margin-top: 1rem; text-align: center; }
.goal-remove-button { padding: 0.5rem; font-size: 0.7rem; color: rgba(252, 165, 165, 0.8); text-decoration: underline; text-underline-offset: 3px; }
.goal-remove-button:hover { color: #fecaca; }
.goal-errors { margin-top: 1rem; padding: 0.85rem 1rem; border: 1px solid rgba(248, 113, 113, 0.35); border-radius: 0.75rem; background: rgba(127, 29, 29, 0.2); color: #fecaca; font-size: 0.75rem; line-height: 1.8; }
.goal-errors ul { padding-left: 1rem; list-style: disc; }
.goal-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.goal-list-heading > span { color: rgba(243, 236, 216, 0.55); font-size: 0.75rem; }
.goal-list-heading + .goal-layout { margin-top: 1.25rem; }
.goal-card { scroll-margin-top: 6rem; }
.goal-card .goal-hero-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.goal-card .goal-target { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.goal-card .goal-target-label { margin-top: 1.25rem; }
.goal-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.goal-card-plan { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(212, 167, 44, 0.15); }
.goal-card-plan > summary { color: var(--gold-200); font-size: 0.8rem; cursor: pointer; }
.goal-editor-heading { justify-content: space-between; }
.goal-editor-heading .goal-plan-link { margin-top: 0; }
.goal-dashboard-list { display: grid; gap: 1rem; margin-top: 1rem; }
.goal-dashboard-item + .goal-dashboard-item { padding-top: 1rem; border-top: 1px solid rgba(212, 167, 44, 0.15); }
.goal-dashboard-heading, .goal-dashboard-values { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.75rem; }
.goal-dashboard-heading a { color: var(--gold-200); min-width: 0; overflow-wrap: anywhere; }
.goal-dashboard-heading strong { flex-shrink: 0; }
.goal-dashboard-values { margin-top: 0.6rem; color: rgba(243, 236, 216, 0.65); flex-wrap: wrap; font-size: 0.65rem; }
@media (max-width: 900px) { .goal-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
    .goal-hero, .goal-plan, .goal-editor { padding: 1.25rem; }
    .goal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .goal-stats > div:last-child { grid-column: 1 / -1; }
    .goal-status { max-width: 11rem; text-align: center; }
    .goal-plan-stats { grid-template-columns: minmax(0, 1fr); }
}

.up { color: #4ade80; }
.down { color: #f87171; }

table.ledger tbody tr { border-top: 1px dashed rgba(212, 167, 44, 0.14); }
table.ledger tbody tr:hover { background: rgba(212, 167, 44, 0.05); }

/* Odometer for the total wealth figure */
[data-odometer] {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A brief directional flash when the live portfolio total changes. */
[data-portfolio-total].total-increase {
    --total-flash-color: #15803d;
    --total-flash-glow: rgba(21, 128, 61, 0.3);
    --total-flash-offset: -3px;
    animation: total-change 1.8s ease-out;
}

[data-portfolio-total].total-decrease {
    --total-flash-color: #b91c1c;
    --total-flash-glow: rgba(185, 28, 28, 0.3);
    --total-flash-offset: 3px;
    animation: total-change 1.8s ease-out;
}

@keyframes total-change {
    0%, 35% {
        color: var(--total-flash-color);
        text-shadow: 0 0 16px var(--total-flash-glow);
    }
    15% { transform: translateY(var(--total-flash-offset)); }
    50%, 100% { transform: translateY(0); }
    100% { color: var(--bill-900); text-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    [data-portfolio-total].total-increase,
    [data-portfolio-total].total-decrease {
        animation: none;
        color: var(--total-flash-color);
    }
}

.odo-digit {
    display: inline-block;
    height: 1.1em;
    line-height: 1.1em;
    overflow: hidden;
    vertical-align: bottom;
    /* Soft fade at the edges so rolling digits look like they pass behind a window */
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}

.odo-strip {
    display: flex;
    flex-direction: column;
    transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.odo-strip > span {
    display: block;
    height: 1.1em;
    text-align: center;
}

.odo-char {
    display: inline-block;
    /* Keep the space before the currency symbol; inline-block would collapse it */
    white-space: pre;
    line-height: 1.1em;
    vertical-align: bottom;
}

/* Privacy mode: blur amounts until the eye toggle is switched off */
[data-sensitive],
table.ledger .font-num { transition: filter 0.2s; }
.privacy [data-sensitive],
.privacy table.ledger .font-num { filter: blur(7px); user-select: none; }
.privacy-on { display: none; }
.privacy .privacy-on { display: block; }
.privacy .privacy-off { display: none; }

/* The wordmark in logo.png has a 3:1 aspect ratio. */
.brand-logo {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(243, 236, 216, 0.18)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.brand-logo-nav { width: 108px; }
.brand-logo-auth { width: 432px; }

@media (min-width: 640px) {
    .brand-logo-nav { width: 144px; }
}

/* Markets page: filter/range chips, sortable headers, selected row */
.chip {
    border-radius: 0.6rem;
    border: 1px solid rgba(212, 167, 44, 0.2);
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(243, 236, 216, 0.7);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: rgba(212, 167, 44, 0.45); color: #f3ecd8; }
.chip.is-active { border-color: var(--gold-300); background: rgba(212, 167, 44, 0.15); color: #fff4c9; }

.sort-btn { text-transform: inherit; letter-spacing: inherit; }
.sort-btn:hover { color: #f3ecd8; }
.sort-btn[data-dir="asc"]::after { content: " \25B2"; }
.sort-btn[data-dir="desc"]::after { content: " \25BC"; }

tr[data-row].is-selected { background: rgba(212, 167, 44, 0.09); box-shadow: inset 3px 0 0 var(--gold-300); }
tr[data-row]:focus-visible { outline: 2px solid var(--gold-300); outline-offset: -2px; }

.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: .65rem;
    background: rgba(14, 165, 233, .12);
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -.02em;
}

/* Token badge for crypto: a minted disc in violet, distinct from gold coins and banknotes */
.token {
    display: inline-grid;
    place-items: center;
    border-radius: 9999px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #ede9fe;
    background: radial-gradient(circle at 32% 28%, #8b7ad8 0%, #4c3b9a 45%, #241a5c 100%);
    box-shadow:
        inset 0 0 0 1.5px rgba(221, 214, 254, 0.55),
        inset 0 -3px 6px rgba(15, 10, 40, 0.5),
        0 0 0 1.5px #3b2f7a,
        0 6px 14px -4px rgba(0, 0, 0, 0.6);
}

/* Live chart: chip dot and connection status */
.live-dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.35rem;
    border-radius: 9999px;
    background: #4ade80;
    vertical-align: 0.05em;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    100% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.live-status {
    display: inline-block;
    border-radius: 9999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(4, 25, 15, 0.85);
    border: 1px solid rgba(212, 167, 44, 0.25);
}
.live-status.is-on { color: #86efac; border-color: rgba(74, 222, 128, 0.4); }
.live-status.is-connecting, .live-status.is-lost { color: #fcd34d; border-color: rgba(252, 211, 77, 0.4); }
.live-status.is-failed { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }

/* Landing content stays visible unless scroll reveals are supported and enabled. */
[data-reveal].reveal-pending { opacity: 0; }
[data-reveal].reveal-enter { animation: landing-reveal 650ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes landing-reveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    [data-reveal].reveal-pending { opacity: 1; }
    [data-reveal].reveal-enter { animation: none; }
}

/* Public tools: equal cards, with room for descriptions on smaller screens. */
.landing-tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.landing-tools-grid > a:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 4px; }
@media (max-width: 1100px) { .landing-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .landing-tools-grid { grid-template-columns: minmax(0, 1fr); } }

/* Public tool navigation: a compact directory shared by the home and tool pages. */
.tool-navigation-wrap { padding-top: 1.5rem; padding-bottom: 2rem; }
.tool-navigation {
    position: relative;
    scroll-margin-top: 6rem;
    overflow: hidden;
    padding: clamp(1.1rem, 3vw, 2rem);
    border: 1px solid rgba(212, 167, 44, 0.23);
    border-radius: 1.5rem;
    background: radial-gradient(ellipse at 100% 0, rgba(212, 167, 44, 0.09), transparent 48%), linear-gradient(135deg, rgba(13, 61, 42, 0.8), rgba(4, 25, 15, 0.94));
    box-shadow: inset 0 1px 0 rgba(247, 227, 161, 0.06), 0 20px 55px -35px rgba(0, 0, 0, 0.65);
}
.tool-navigation-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.tool-navigation-eyebrow { margin-bottom: 0.6rem; color: rgba(247, 227, 161, 0.6); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.tool-navigation-title { display: inline-flex; align-items: center; gap: 0.9rem; border-radius: 0.4rem; color: var(--gold-200); font-size: clamp(1.3rem, 2.4vw, 1.85rem); font-weight: 700; line-height: 1.25; }
.tool-navigation-directory-arrow { display: inline-grid; flex-shrink: 0; width: 2rem; height: 2rem; place-items: center; border: 1px solid rgba(212, 167, 44, 0.3); border-radius: 50%; transition: background 180ms, transform 180ms; }
.tool-navigation-directory-arrow svg { width: 1rem; height: 1rem; }
.tool-navigation-title:hover .tool-navigation-directory-arrow { background: rgba(212, 167, 44, 0.15); transform: translateX(3px); }
.tool-navigation-emblem { flex-shrink: 0; width: 3.5rem; height: 3.5rem; color: var(--gold-300); stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.45; }
.tool-navigation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.tool-navigation-grid > li { min-width: 0; }
.tool-navigation-card {
    display: flex;
    scroll-margin-top: 6rem;
    scroll-margin-bottom: 1rem;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    min-height: 6.5rem;
    padding: 1rem;
    border: 1px solid rgba(212, 167, 44, 0.14);
    border-radius: 1rem;
    background: rgba(4, 25, 15, 0.6);
    transition: border-color 180ms, background 180ms, box-shadow 180ms, transform 180ms;
}
.tool-navigation-icon { display: inline-grid; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; place-items: center; border: 1px solid rgba(212, 167, 44, 0.22); border-radius: 0.8rem; color: var(--gold-300); background: linear-gradient(145deg, rgba(212, 167, 44, 0.12), rgba(13, 61, 42, 0.3)); transition: border-color 180ms, background 180ms; }
.tool-navigation-icon svg { width: 1.3rem; height: 1.3rem; }
.tool-navigation-card-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.5rem; }
.tool-navigation-card-title { color: rgba(243, 236, 216, 0.9); font-size: 0.875rem; font-weight: 500; line-height: 1.5; }
.tool-navigation-access { display: inline-flex; align-items: center; gap: 0.4rem; color: rgba(243, 236, 216, 0.62); font-size: 0.6875rem; line-height: 1.4; }
.tool-navigation-access::before { content: ''; width: 0.3rem; height: 0.3rem; flex-shrink: 0; border-radius: 50%; background: #70b897; }
.tool-navigation-card-account .tool-navigation-access::before { background: var(--gold-400); }
.tool-navigation-card-arrow { flex: 0 0 1rem; width: 1rem; height: 1rem; color: rgba(247, 227, 161, 0.4); transition: color 180ms, transform 180ms; }
.tool-navigation-card:hover, .tool-navigation-card[aria-current="page"] { border-color: rgba(236, 201, 101, 0.5); background: rgba(18, 85, 58, 0.5); box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.7); }
.tool-navigation-card:hover { transform: translateY(-3px); }
.tool-navigation-card:hover .tool-navigation-icon, .tool-navigation-card[aria-current="page"] .tool-navigation-icon { border-color: rgba(236, 201, 101, 0.5); background: rgba(212, 167, 44, 0.13); }
.tool-navigation-card:hover .tool-navigation-card-arrow { color: var(--gold-200); transform: translate(2px, -2px); }
.tool-navigation-title:focus-visible, .tool-navigation-card:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 4px; }
@media (max-width: 1000px) { .tool-navigation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .tool-navigation-grid { grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
    .tool-navigation-header { margin-bottom: 1.25rem; }
    .tool-navigation-emblem { display: none; }
    .tool-navigation-card { min-height: 5.5rem; padding: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tool-navigation-card, .tool-navigation-icon, .tool-navigation-directory-arrow, .tool-navigation-card-arrow { transition: none; }
    .tool-navigation-card:hover, .tool-navigation-title:hover .tool-navigation-directory-arrow, .tool-navigation-card:hover .tool-navigation-card-arrow { transform: none; }
}

/* Landing page: smooth jumps to the section links in the header */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- App header ---------- */
.app-header {
    position: sticky;
    background: rgba(4, 25, 15, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.9);
}
/* Thin engraved gold rule along the bottom edge, like the frame of a banknote */
.app-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 167, 44, 0.45) 20%, rgba(236, 201, 101, 0.6) 50%, rgba(212, 167, 44, 0.45) 80%, transparent);
}

details[data-menu] > summary { list-style: none; }
details[data-menu] > summary::-webkit-details-marker { display: none; }
details[data-menu] .chev { transition: transform 0.15s; }
details[data-menu][open] > summary .chev { transform: rotate(180deg); }

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.8rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(243, 236, 216, 0.68);
    cursor: pointer;
    transition: color 0.15s;
}
.nav-link:hover, details[open] > .nav-link { color: #f3ecd8; }
.nav-link.is-active { color: #fff4c9; }
.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, #b8891a, #ecc965, #b8891a);
    box-shadow: 0 0 10px rgba(236, 201, 101, 0.55);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.7rem;
    color: rgba(243, 236, 216, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.icon-btn:hover, details[open] > .icon-btn, .icon-btn.is-active { background: rgba(212, 167, 44, 0.1); color: #f3ecd8; }
.icon-btn .menu-close { display: none; }
details[open] > .icon-btn .menu-open { display: none; }
details[open] > .icon-btn .menu-close { display: block; }

.vault-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.25rem;
    padding: 0 0.7rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(212, 167, 44, 0.22);
    background: rgba(13, 61, 42, 0.45);
    font-size: 0.8rem;
    color: rgba(243, 236, 216, 0.85);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.vault-chip:hover, details[open] > .vault-chip { border-color: rgba(212, 167, 44, 0.5); background: rgba(13, 61, 42, 0.7); }

.account-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.3rem 0.2rem 0.2rem;
    margin-left: 0.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s;
}
.account-btn:hover, details[open] > .account-btn { background: rgba(212, 167, 44, 0.1); }

.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #3a2905;
    background: radial-gradient(circle at 32% 28%, #fff6cf 0%, #f0cf6b 35%, #c99a24 75%, #8c6512 100%);
    box-shadow: 0 0 0 1.5px #8c6512, 0 0 0 3px rgba(236, 201, 101, 0.25);
}

.menu-panel {
    position: absolute;
    z-index: 40;
    margin-top: 0.5rem;
    padding: 0.35rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(212, 167, 44, 0.2);
    background: #082b1d;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9), 0 0 0 4px rgba(4, 25, 15, 0.5);
}
.menu-drawer {
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.menu-heading {
    padding: 0.35rem 0.75rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(243, 236, 216, 0.4);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.875rem;
    color: rgba(243, 236, 216, 0.85);
    transition: background 0.12s, color 0.12s;
}
.menu-item:hover { background: rgba(212, 167, 44, 0.1); color: #f3ecd8; }
.menu-item.is-active { background: rgba(212, 167, 44, 0.14); color: #fff4c9; }
.menu-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(212, 167, 44, 0.18);
    background: rgba(4, 25, 15, 0.5);
    color: #ecc965;
}
.menu-item.is-active .menu-icon { border-color: rgba(236, 201, 101, 0.45); }
.menu-item.is-danger { color: #fecaca; }
.menu-item.is-danger:hover { background: rgba(239, 68, 68, 0.12); color: #fee2e2; }
.menu-item.is-danger .menu-icon { color: #fca5a5; border-color: rgba(248, 113, 113, 0.25); }
/* A non-clickable row inside a menu (e.g. the language switch) */
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.75rem; font-size: 0.875rem; color: rgba(243, 236, 216, 0.6); }
