h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#blazor-error-ui {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(11, 18, 14, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
}

#blazor-error-ui .blazor-error-card {
    width: min(100%, 480px);
    padding: 1.75rem;
    border-radius: 1.35rem;
    background: rgba(255, 253, 249, 0.97);
    box-shadow: 0 24px 60px rgba(16, 26, 20, 0.22);
    border: 1px solid rgba(216, 202, 181, 0.95);
}

#blazor-error-ui .blazor-error-kicker {
    margin: 0 0 .45rem;
    color: #2f7a37;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#blazor-error-ui h2 {
    margin: 0 0 .6rem;
    font-size: 1.35rem;
    color: var(--brand);
}

#blazor-error-ui p {
    margin: 0 0 1.1rem;
    color: var(--on-surface-variant);
    line-height: 1.6;
}

#blazor-error-ui .blazor-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

:root {
    --brand: #1b4f2d;
    --primary: #2f6b34;
    --primary-container: #e6f7d8;
    --on-primary: #ffffff;
    --on-primary-container: #16371d;
    --background: #f5f2eb;
    --surface: #fffdf9;
    --surface-container: #f1eadf;
    --surface-container-high: #e8dfcf;
    --on-surface: #151311;
    --on-surface-variant: #5d5349;
    --outline: #8c7f70;
    --outline-variant: #d8cab5;
    --secondary-container: #f6d481;
    --on-secondary-container: #6d4b00;
    --error: #ba1a1a;
    --muted: #f7f0e8;
    --shadow: rgba(16, 26, 20, 0.14);
}

/* Dark mode — toggled via .theme-toggle button in NavBar.razor, applied by wwwroot/js/theme.js
   (reads localStorage, falls back to prefers-color-scheme, sets this attribute before first paint
   to avoid a flash of the light theme). Everything built with var(--surface)/var(--on-surface)/etc
   picks this up automatically; the handful of pre-existing rules below that used literal near-white
   rgba() values instead of a variable get an explicit dark override each. */
:root[data-theme="dark"] {
    --brand: #7ed957;
    --primary: #5fcf6a;
    --primary-container: #1f3d22;
    --on-primary: #0b1a0f;
    --on-primary-container: #cdf5cf;
    --background: #10140f;
    --surface: #171c15;
    --surface-container: #1d2319;
    --surface-container-high: #262d20;
    --on-surface: #ece7dc;
    --on-surface-variant: #b7ae9e;
    --outline: #837a68;
    --outline-variant: #3a382e;
    --secondary-container: #4a3a12;
    --on-secondary-container: #f6d481;
    --error: #ff8a80;
    --muted: #1d2319;
    --shadow: rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(126, 217, 87, 0.10), transparent 32%),
        radial-gradient(circle at bottom right, rgba(246, 212, 129, 0.08), transparent 24%),
        linear-gradient(135deg, #12160f 0%, #0b0d0a 100%);
}

:root[data-theme="dark"] #blazor-error-ui .blazor-error-card { background: rgba(23, 28, 21, 0.97); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .page-shell { background: rgba(23, 28, 21, 0.82); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .nav-bar { background: rgba(23, 28, 21, 0.84); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .nav-search input { background: rgba(29, 35, 25, 0.8); }
:root[data-theme="dark"] .search-bar { background: rgba(29, 35, 25, 0.8); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .hero { background: rgba(23, 28, 21, 0.78); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .section.promo-band { background: linear-gradient(135deg, rgba(29, 35, 25, 0.9), rgba(38, 45, 32, 0.85)); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .genre-chip { background: rgba(29, 35, 25, 0.7); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .title-card { background: rgba(23, 28, 21, 0.94); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .format-tab { background: rgba(29, 35, 25, 0.7); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .format-panel { background: rgba(29, 35, 25, 0.78); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .platform-card { background: rgba(23, 28, 21, 0.9); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .auth-card { background: rgba(23, 28, 21, 0.92); border-color: rgba(58, 56, 46, 0.9); }
:root[data-theme="dark"] .site-footer { background: rgba(23, 28, 21, 0.5); border-color: rgba(58, 56, 46, 0.9); }

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(126, 217, 87, 0.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(246, 212, 129, 0.3), transparent 24%),
        linear-gradient(135deg, #fcfbf7 0%, #f1ebde 100%);
    color: var(--on-surface);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(45px);
    opacity: 0.26;
}

body::before {
    top: -90px;
    right: -80px;
    width: 260px;
    height: 260px;
    background: rgba(47, 107, 52, 0.22);
}

body::after {
    bottom: -100px;
    left: -90px;
    width: 300px;
    height: 300px;
    background: rgba(246, 212, 129, 0.24);
}

a {
    color: var(--primary);
    transition: color 160ms ease, transform 160ms ease;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
    line-height: 1.08;
}

.page-container {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 4rem;
}

.page-shell {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.35rem;
    border-radius: 1.8rem;
    background: rgba(255, 253, 249, 0.82);
    border: 1px solid rgba(216, 202, 181, 0.95);
    box-shadow: 0 20px 48px rgba(16, 26, 20, 0.08);
    backdrop-filter: blur(16px);
}

.page-shell > :first-child {
    margin-top: 0;
}

/* One button treatment for the whole site — same shape, same gradient, same hover everywhere.
   format-tab-active and the hero's primary button reuse this exact --btn-primary-gradient value
   instead of their own bespoke colors, so "primary action" always looks identical. */
:root {
    --btn-primary-gradient: linear-gradient(135deg, var(--brand) 0%, var(--primary) 100%);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--outline-variant);
    background: var(--surface);
    color: var(--on-surface);
    padding: .85rem 1.4rem;
    border-radius: .65rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
    box-shadow: none;
}

.btn:hover {
    background: var(--muted);
    border-color: var(--outline);
}

.btn:disabled {
    opacity: .55;
    cursor: default;
}

.btn-primary {
    background: var(--btn-primary-gradient);
    border-color: transparent;
    color: var(--on-primary);
    box-shadow: 0 10px 24px rgba(29, 91, 43, 0.24);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(29, 91, 43, 0.3);
}

.btn-ghost {
    background: transparent;
    border-color: var(--outline-variant);
    color: var(--on-surface-variant);
}

.btn-ghost:hover {
    background: var(--muted);
    color: var(--primary);
}

/* Nav */
.nav-bar {
    position: sticky;
    top: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    max-width: 1180px;
    margin: 1rem auto 0;
    padding: .95rem 1.1rem;
    background: rgba(255, 253, 249, 0.84);
    border: 1px solid rgba(216, 202, 181, 0.9);
    border-radius: 999px;
    backdrop-filter: blur(24px);
    box-shadow: 0 16px 40px rgba(16, 26, 20, 0.08);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.16rem;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: -.02em;
}

.nav-brand img {
    display: block;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.nav-links a,
.nav-auth a {
    color: var(--on-surface-variant);
    text-decoration: none;
    font-weight: 700;
}

.nav-links a:hover,
.nav-auth a:hover {
    color: var(--primary);
}

/* .nav-auth a's descendant selector (0,1,1) otherwise beats .btn-primary's single class (0,1,0)
   and silently overrides its white text back to the muted nav color — the "Sign in" button needs
   this re-asserted at equal-or-higher specificity to actually render white. Found on AinsReads.Publish
   via an actual browser screenshot (2026-07-30), same bug confirmed present here since Web has the
   identical markup pattern and no such override. */
.nav-auth a.btn-primary,
.nav-auth a.btn-primary:hover {
    color: var(--on-primary);
}

.nav-search {
    margin: 0;
}

.nav-search input {
    width: 190px;
    padding: .5rem .9rem;
    border: 1px solid var(--outline-variant);
    border-radius: 999px;
    font-size: .9rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--on-surface);
    outline: none;
}

.nav-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(47, 107, 52, 0.12);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* Browse search bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1.4rem;
    max-width: 560px;
    padding: .45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(216, 202, 181, 0.95);
    box-shadow: 0 8px 22px rgba(16, 26, 20, 0.05);
}

.search-bar input {
    flex: 1;
    padding: .7rem .95rem;
    border: 0;
    border-radius: 999px;
    font-size: 1rem;
    background: transparent;
    color: var(--on-surface);
}

.search-bar input:focus {
    outline: none;
}

.search-bar .btn {
    white-space: nowrap;
}

.nav-profile-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 700;
    color: var(--on-surface);
    text-decoration: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--on-surface-variant);
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--surface-container);
    color: var(--primary);
}

.theme-icon-dark {
    display: none;
}

:root[data-theme="dark"] .theme-icon-light {
    display: none;
}

:root[data-theme="dark"] .theme-icon-dark {
    display: inline-flex;
}

.nav-notif {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1.05rem;
    text-decoration: none;
}

.nav-notif-badge {
    position: absolute;
    top: -.2rem;
    right: -.2rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--error);
    color: white;
    font-size: .65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-row {
    cursor: pointer;
}

.notification-unread {
    background: rgba(126, 217, 87, 0.08);
}

.notification-body {
    color: var(--on-surface-variant);
    font-size: .9rem;
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 2.2rem;
    margin-top: 1.2rem;
    border-radius: 2rem;
    border: 1px solid rgba(216, 202, 181, 0.95);
    background: rgba(255, 253, 249, 0.78);
    box-shadow: 0 24px 60px rgba(16, 26, 20, 0.08);
    text-align: left;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(47, 107, 52, 0.06), transparent 60%);
    pointer-events: none;
}

.hero h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 .7rem;
    font-size: clamp(2rem, 3vw, 2.9rem);
    color: var(--brand);
}

.hero p {
    position: relative;
    z-index: 1;
    color: var(--on-surface-variant);
    max-width: 680px;
    margin: 0 0 1.25rem;
    font-size: 1.02rem;
}

.hero-featured {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    padding: 2.4rem;
    background: linear-gradient(135deg, rgba(15, 33, 18, 0.98) 0%, rgba(47, 107, 52, 0.94) 58%, rgba(126, 96, 23, 0.92) 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.16);
}

.hero-featured::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 70%);
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.hero-kicker,
.hero-panel-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: .8rem;
}

.hero-featured h1 {
    color: white;
    margin-top: .35rem;
}

.hero-featured p,
.hero-featured .title-card-meta {
    color: rgba(255, 255, 255, 0.84);
}

.hero-panel {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
}

.hero-panel-card {
    width: 100%;
    padding: 1.15rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-panel-card h3 {
    margin: .25rem 0 .45rem;
    font-size: 1.15rem;
}

.hero-panel-card p {
    margin: 0;
    font-size: .95rem;
}

.hero-panel-meta {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .8rem;
    font-size: .85rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-meta {
    justify-content: flex-start;
    gap: 1rem;
    margin: .85rem 0 1.25rem;
    font-size: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.hero-featured .btn {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: none;
}

/* .hero-featured .btn and .btn-primary are equal specificity — without this, the ghost style
   above would win over the gradient on the hero's primary CTA. Same --btn-primary-gradient as
   everywhere else, just re-asserted here so it isn't shadowed. */
.hero-featured .btn-primary {
    background: var(--btn-primary-gradient);
    border-color: transparent;
    color: var(--on-primary);
}


/* Genre quick links (Home) */
.genre-quick-links {
    margin: 0 0 1.2rem;
}

.genre-quick-links .genre-chip {
    text-decoration: none;
}

/* Coin promo band — markup always combines this with .section (see Home.razor), and .section's
   own padding is declared later in this file; .section.promo-band (two classes, higher specificity)
   guarantees this padding wins regardless of source order, instead of silently collapsing to
   .section's top-only padding like it was. */
.section.promo-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.65rem 1.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 234, 223, 0.88));
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 1.4rem;
    box-shadow: 0 16px 40px rgba(16, 26, 20, 0.06);
}

.promo-band h2 {
    margin-top: 0;
    margin-bottom: .35rem;
}

.promo-band p {
    color: var(--on-surface-variant);
    max-width: 560px;
    margin: 0;
}

/* Sections */
.section {
    padding: 1.25rem 0 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
}

.section-header h2 {
    margin: 0;
}

.section-header a {
    font-weight: 700;
    text-decoration: none;
}

/* Genre chips */
.genre-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.25rem;
}

.genre-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(255, 255, 255, 0.7);
    color: var(--on-surface-variant);
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 999px;
    padding: .3rem .75rem;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.genre-chip-icon {
    color: var(--error);
    flex-shrink: 0;
}

.genre-popular-icon {
    color: var(--on-secondary-container);
    vertical-align: -2px;
}

.genre-chip-active {
    background: var(--primary-container);
    color: var(--on-primary-container);
}

/* Genre tree (Browse) */
.genre-tree {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1rem;
}

.genre-tree-node {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.genre-tree-row {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.genre-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    color: var(--on-surface-variant);
    cursor: pointer;
    font-size: .8rem;
}

.genre-tree-toggle:hover {
    color: var(--primary);
}

.genre-tree-children {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: 1.5rem;
    padding-left: .75rem;
    border-left: 2px solid var(--outline-variant);
}

.genre-chip-child {
    font-size: .74rem;
    padding: .25rem .65rem;
    background: rgba(255, 255, 255, 0.55);
}

.genre-popular {
    margin-bottom: 1.25rem;
}

.genre-popular-label {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .5rem;
}

/* Title grid + cards */
.title-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.title-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 253, 249, 0.94);
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 1.2rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--on-surface);
    box-shadow: 0 18px 38px rgba(16, 26, 20, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.title-card:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 107, 52, 0.3);
    box-shadow: 0 24px 48px rgba(16, 26, 20, 0.1);
}

/* Book covers — real image or generated placeholder (see BookCover.razor) */
.book-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 1.1rem;
    overflow: hidden;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(16, 26, 20, 0.16);
}

.book-cover-generated {
    position: relative;
    background: var(--surface-container);
    line-height: 0;
}

.book-cover-generated svg {
    display: block;
    width: 100%;
    height: 100%;
}

.title-card-cover-wrap {
    position: relative;
}

.title-card .book-cover.title-card-cover {
    border-radius: 0;
    box-shadow: none;
}

.format-badges {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
}

.format-badges-overlay {
    position: absolute;
    top: .6rem;
    right: .6rem;
    justify-content: flex-end;
    max-width: 75%;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: rgba(21, 19, 17, 0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    line-height: 1;
}

/* Icon.razor — stroke/fill both use currentColor, so every placement (format badge, format tab,
   platform card) just sets `color` and the icon follows automatically; no per-instance overrides. */
.icon {
    flex-shrink: 0;
}

/* Catalog loading skeleton */
.title-card-skeleton {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.skeleton-block {
    border-radius: .6rem;
    background: linear-gradient(100deg, var(--surface-container) 30%, var(--surface-container-high) 50%, var(--surface-container) 70%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-cover {
    aspect-ratio: 2 / 3;
    border-radius: 1.1rem;
}

.skeleton-line {
    height: .85rem;
}

.skeleton-line-wide {
    width: 80%;
}

.skeleton-line-narrow {
    width: 45%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.title-card-body {
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.title-card-body h3 {
    margin: 0;
    font-size: 1.03rem;
}

.title-card-desc {
    color: var(--on-surface-variant);
    font-size: .9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.title-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: .84rem;
    color: var(--on-surface-variant);
    margin-top: .15rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: .75rem;
}

/* Title details */
.title-header {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 1.75rem;
    align-items: start;
    padding: 1.2rem 0 1.4rem;
    margin-bottom: .4rem;
}

.title-header-cover {
    max-width: 240px;
}

.title-header h1 {
    color: var(--brand);
    margin: .4rem 0 .2rem;
}

.title-author {
    color: var(--on-surface-variant);
    margin: 0 0 .75rem;
}

.title-description {
    max-width: 760px;
    margin: 0 0 1rem;
    color: var(--on-surface-variant);
}

.format-tabs-section {
    margin-top: 1.5rem;
}

.format-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1rem;
}

.format-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(216, 202, 181, 0.95);
    background: rgba(255, 255, 255, 0.7);
    color: var(--on-surface-variant);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.format-tab:hover {
    border-color: rgba(47, 107, 52, 0.3);
}

.format-tab-active {
    background: var(--btn-primary-gradient);
    border-color: transparent;
    color: var(--on-primary);
}

.format-tab-icon {
    display: inline-flex;
    align-items: center;
}

.format-panel {
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 1.3rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 40px rgba(16, 26, 20, 0.06);
}

.format-panel-header {
    margin-bottom: 1rem;
}

.format-panel-header h2 {
    margin: 0 0 .3rem;
}

.edition-tile {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.edition-tile-cover {
    width: 140px;
    flex-shrink: 0;
}

.edition-tile-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 0;
}

.edition-tile-body h2 {
    margin: 0;
}

.edition-lang {
    color: var(--on-surface-variant);
    font-weight: 400;
    font-size: .9rem;
}

.currency-picker {
    max-width: 260px;
}

.cart-row {
    justify-content: flex-start;
}

.cart-row-cover {
    width: 48px;
    flex-shrink: 0;
}

.cart-row-cover-img {
    aspect-ratio: 2 / 3;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.cart-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    border-top: 1px solid var(--outline-variant);
}

.chapter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--outline-variant);
}

.chapter-row a {
    text-decoration: none;
    color: var(--on-surface);
    font-weight: 600;
}

.badge {
    font-size: .75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .2rem .6rem;
}

.badge-free {
    background: var(--primary-container);
    color: var(--on-primary-container);
}

.badge-locked {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
}

/* "Download the app to read" modal — shared by every start-reading/listen/chapter-tap action */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(11, 18, 14, 0.6);
    backdrop-filter: blur(6px);
}

.app-modal-card {
    width: min(100%, 420px);
    padding: 2rem 1.75rem;
    border-radius: 1.35rem;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(16, 26, 20, 0.22);
    border: 1px solid var(--outline-variant);
    text-align: center;
}

.app-modal-icon {
    display: inline-flex;
    justify-content: center;
    color: var(--primary);
    margin-bottom: .75rem;
    width: 100%;
}

.app-modal-icon-danger {
    color: var(--error);
}

.app-modal-card h2 {
    margin: 0 0 .6rem;
    color: var(--brand);
}

.app-modal-card p {
    color: var(--on-surface-variant);
    margin: 0 0 1.25rem;
}

/* Download page */
.download-hero {
    text-align: center;
    padding-top: 1rem;
}

.download-hero h1 {
    color: var(--brand);
}

.download-hero .title-description {
    margin-left: auto;
    margin-right: auto;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 1.3rem;
    background: rgba(255, 253, 249, 0.9);
    box-shadow: 0 16px 40px rgba(16, 26, 20, 0.06);
}

.platform-icon {
    display: inline-flex;
    color: var(--brand);
    margin-bottom: .3rem;
}

.platform-card h3 {
    margin: 0;
}

.platform-card p {
    color: var(--on-surface-variant);
    margin: 0 0 .4rem;
}

.download-note {
    text-align: center;
    margin-top: 1.5rem;
}

/* Auth pages */
.auth-page {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: rgba(255, 253, 249, 0.92);
    border: 1px solid rgba(216, 202, 181, 0.95);
    border-radius: 1.4rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(16, 26, 20, 0.08);
}

.auth-card h1 {
    font-size: 1.4rem;
    color: var(--brand);
    margin-top: 0;
}

/* Forms — general material styling for every label/input/textarea/select on the site (Profile,
   Wallet, Delete account, Kyc, auth pages). Previously only .auth-card had any input styling at
   all, so every other form on the site fell back to bare browser defaults. */
label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--on-surface-variant);
    margin-bottom: 1rem;
}

/* Element selectors, not input[type=...] — Blazor's <InputText>/<InputTextArea> components render
   a bare <input>/<textarea> with NO type attribute at all (confirmed: this is why the whole form
   styling pass looked like it did nothing — every attribute-selector rule here silently matched
   zero elements on Profile/Wallet/Delete account, since those pages are built almost entirely out
   of InputText fields). :not() excludes the control types that shouldn't get text-field chrome. */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=range]):not([type=color]):not([type=hidden]),
textarea,
select {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .75rem .95rem;
    border: 1px solid var(--outline-variant);
    border-radius: .85rem;
    font-size: .95rem;
    font-family: inherit;
    box-sizing: border-box;
    background: var(--surface-container);
    color: var(--on-surface);
    box-shadow: inset 0 1px 2px rgba(16, 26, 20, 0.04);
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=range]):not([type=color]):not([type=hidden]):focus,
textarea:focus,
select:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(47, 107, 52, 0.16);
}

textarea {
    resize: vertical;
    min-height: 4rem;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--on-surface-variant) 50%), linear-gradient(135deg, var(--on-surface-variant) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 15px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: .6;
    cursor: not-allowed;
}

input[type=checkbox],
input[type=radio] {
    width: auto;
    accent-color: var(--primary);
}

.validation-summary {
    color: var(--error);
    font-size: .85rem;
    margin-bottom: .9rem;
}

.validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-checkbox {
    display: flex !important;
    align-items: center;
    gap: .5rem;
}

.auth-card .btn {
    width: 100%;
    text-align: center;
    margin-top: .5rem;
}

.auth-error {
    color: var(--error);
    font-weight: 700;
}

.auth-switch {
    margin-top: 1.25rem;
    font-size: .9rem;
    text-align: center;
    color: var(--on-surface-variant);
}

/* Legal / support pages */
.legal-page {
    max-width: 760px;
    padding: 1rem 0 0;
}

.legal-page h1 {
    color: var(--brand);
}

.legal-page h2 {
    margin-top: 2rem;
    font-size: 1.1rem;
}

.legal-body p, .legal-page p {
    color: var(--on-surface-variant);
    line-height: 1.7;
}

.faq-item {
    margin-top: 1.5rem;
}

.faq-item h2 {
    margin-top: 0;
    margin-bottom: .35rem;
    font-size: 1rem;
    color: var(--on-surface);
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(216, 202, 181, 0.95);
    padding: 1.5rem 1.25rem 2.25rem;
    text-align: center;
    background: rgba(255, 253, 249, 0.4);
}

.footer-logo {
    display: block;
    margin: 0 auto .75rem;
    opacity: .85;
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--on-surface-variant);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
}

.site-footer .footer-copy {
    color: var(--outline);
    font-size: .8rem;
    margin: 0;
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--error);
    color: var(--error);
}

/* Categories page */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
    margin-top: 1rem;
}

.category-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-top: .75rem;
}

.category-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    min-height: 140px;
    padding: 1.2rem 1.3rem;
    border-radius: 1.2rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(16, 26, 20, 0.16);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.category-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(16, 26, 20, 0.22);
}

.category-tile-compact {
    min-height: 90px;
    padding: .9rem 1.1rem;
    justify-content: center;
}

.category-tile h3 {
    margin: 0;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.category-tile-badge {
    position: absolute;
    top: .8rem;
    right: .8rem;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.category-tile-children {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: auto;
}

.category-tile-chip {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.category-tile-skeleton {
    aspect-ratio: 3 / 2;
    border-radius: 1.2rem;
}

/* Profile page */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-generated {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(16, 26, 20, 0.18);
}

.profile-header-body h1 {
    margin: 0 0 .2rem;
}

.profile-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .4rem;
}

.profile-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.profile-joined {
    color: var(--on-surface-variant);
    font-size: .84rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.1rem;
}

.profile-card {
    padding: 1.5rem 1.6rem;
    border-radius: 1.3rem;
    background: var(--surface);
    border: 1px solid var(--outline-variant);
    box-shadow: 0 12px 30px rgba(16, 26, 20, 0.05);
    margin-bottom: 1.1rem;
}

.profile-grid .profile-card {
    margin-bottom: 0;
}

.profile-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .6rem;
    font-size: 1.05rem;
}

.profile-card-danger {
    border-color: rgba(186, 26, 26, 0.3);
}

.profile-card-danger .profile-card-title {
    color: var(--error);
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .9rem 1.2rem;
    margin-bottom: .9rem;
}

.profile-form-bio {
    display: block;
    margin-bottom: 1.1rem;
}

/* 3D-ish coin/wallet tile — layered radial highlight + deep shadow to fake an embossed coin,
   reused identically on Profile (balance summary) and Wallet (top of the buy-coins flow). */
.coin-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background:
        radial-gradient(120% 140% at 20% 15%, rgba(255, 255, 255, 0.55), transparent 55%),
        linear-gradient(135deg, var(--secondary-container), #d9a441 120%);
    border: 1px solid rgba(109, 75, 0, 0.25);
    box-shadow: 0 18px 34px rgba(109, 75, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.coin-card-icon {
    display: inline-flex;
    color: var(--on-secondary-container);
    filter: drop-shadow(0 3px 4px rgba(109, 75, 0, 0.35));
}

.coin-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.coin-card-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--on-secondary-container);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.coin-card-balance {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--on-secondary-container);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Wallet page */
.wallet-amount-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .7rem;
    margin: 1rem 0;
}

.wallet-amount-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .9rem .5rem;
    border-radius: 1rem;
    border: 1px solid var(--outline-variant);
    background: var(--muted);
    color: var(--on-surface-variant);
    font-weight: 800;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.wallet-amount-tile:hover {
    border-color: rgba(47, 107, 52, 0.3);
}

.wallet-amount-tile-active {
    background: var(--btn-primary-gradient);
    border-color: transparent;
    color: var(--on-primary);
}

/* Delete account page */
.delete-consequence-list {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    color: var(--on-surface-variant);
}

.delete-consequence-list li {
    margin-bottom: .3rem;
}

@media (max-width: 900px) {
    .nav-bar {
        flex-wrap: wrap;
        border-radius: 1.25rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .hero-featured {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-container {
        padding: 1rem 1rem 3rem;
    }

    .page-shell {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .nav-bar {
        margin-top: .75rem;
        padding: .8rem 1rem;
    }

    .nav-search input {
        width: 100%;
    }

    .hero,
    .hero-featured,
    .promo-band,
    .auth-card {
        padding: 1.25rem;
    }

    .title-grid {
        grid-template-columns: 1fr;
    }

    .title-header {
        grid-template-columns: 1fr;
    }

    .title-header-cover {
        max-width: 200px;
        margin: 0 auto;
    }

    .format-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: .3rem;
    }

    .format-tab {
        flex-shrink: 0;
    }

    .edition-tile {
        flex-direction: column;
    }

    .edition-tile-cover {
        width: 120px;
        margin: 0 auto;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .coin-card {
        flex-direction: column;
        text-align: center;
    }
}
