/* ==========================================================================
   TropeWise — mobile-first styles.

   Layout lives here once; themes (bottom of file) only swap the custom
   properties below. To add a theme: copy a [data-theme] block, change the
   values, and add it to accounts/themes.py.
   ========================================================================== */

:root {
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: var(--font-body);

    --radius: 10px;
    --radius-chip: 999px;
    --gutter: 16px;
    --tap: 44px;              /* minimum touch target */
    --nav-height: 64px;
    --max-width: 760px;

    /* Which logo artwork to show. Dark themes flip these. */
    --show-logo-on-light: block;
    --show-logo-on-dark: none;
}


/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    /* Room for the bottom tab bar on phones. */
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin: 0 0 0.5em;
    overflow-wrap: anywhere;   /* very long titles wrap instead of overflowing */
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 1.25em;
}

p { margin: 0 0 0.75em; }

a {
    color: var(--link);
    text-underline-offset: 2px;
}

img { max-width: 100%; height: auto; }

/* Buttons and chips set their own display; keep hidden things hidden. */
[hidden] { display: none !important; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.text-center { text-align: center; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 16px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}


/* ---------- Header & navigation ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px var(--gutter);
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: block;
    flex-shrink: 1;
    min-width: 0;
}

.logo {
    height: 38px;
    width: auto;
    /* On narrow phones next to the Log In / Create Account links, shrink
       rather than push them onto two lines. */
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.beta-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 8px;
    border: 1px solid var(--chip-border);
    border-radius: var(--radius-chip);
    background: var(--chip-bg);
    color: var(--chip-text);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
    text-decoration: none;
    vertical-align: middle;
}

a.beta-badge:hover { border-color: var(--accent); }

.site-feedback {
    margin: 40px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.site-feedback .beta-badge { margin-right: 4px; }

/* Grouped site links at the bottom of every page. */
.site-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px 24px;
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.site-footer h2 {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 6px; }

.affiliate-note {
    margin: 16px 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logo-on-light { display: var(--show-logo-on-light); }
.logo-on-dark { display: var(--show-logo-on-dark); }

/* Stacked logo above the login / sign-up forms. */
.hero-logo {
    max-width: 190px;
    margin: 8px auto 20px;
}

.hero-logo img {
    width: 100%;
    height: auto;
}

.header-links {
    display: flex;
    gap: 14px;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Phones: app-style tab bar pinned to the bottom. */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--nav-height);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
}

.tab-bar a[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
}

.tab-icon { font-size: 1.35rem; line-height: 1; }

/* Seven tabs fit a phone with short labels; staff reach Admin from Account. */
.tab-bar .tab-admin { display: none; }
.tab-bar .tab-long { display: none; }
.tab-bar a { white-space: nowrap; }


/* ---------- Page layout ---------- */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px var(--gutter) 32px;
}

.page-section + .page-section { margin-top: 32px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 12px; }

.stack > * + * { margin-top: 12px; }


/* ---------- Messages ---------- */

.messages {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.messages li {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--border);
}

.messages li + li { margin-top: 8px; }

.messages li.error,
.messages li.warning {
    background: var(--danger-bg);
    color: var(--danger-text);
}


/* ---------- Buttons ---------- */

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-contrast);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover,
button:hover { filter: brightness(1.08); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-block { width: 100%; }

.btn-link {
    background: none;
    border: none;
    color: var(--link);
    padding: 0;
    min-height: auto;
    font-weight: 400;
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}


/* ---------- Forms ---------- */

label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: var(--tap);
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    /* 16px stops iOS Safari from zooming in on focus. */
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
}

textarea { min-height: 140px; resize: vertical; }

/* iPhone Safari draws its own dropdowns and date boxes, ignoring our
   padding (text jammed against the border) and column widths (date boxes
   spill out). Drawing them ourselves looks the same everywhere. */
select,
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Our own dropdown arrow, drawn in the theme's colors. */
select {
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        right 19px center,
        right 14px center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
}

input[type="date"] { max-width: 100%; }

.date-clear {
    margin-top: 6px;
    font-size: 0.85rem;
}

/* Safari centers the date text; line it up with the other fields. */
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
}

/* Password field with a show/hide eye (added by password-toggle.js). */
.password-field {
    position: relative;
    display: block;
}

.password-field input { padding-right: 48px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    min-height: 40px;
    width: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
}

.password-toggle:hover {
    color: var(--text);
    filter: none;
}

/* Hide Edge's built-in reveal button so there aren't two eyes. */
.password-field input::-ms-reveal { display: none; }

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    vertical-align: middle;
}

/* Django's {{ form.as_p }} output. */
.form p { margin-bottom: 16px; }

.form .helptext,
.form .helptext ul {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form .helptext ul { padding-left: 18px; }

.errorlist {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
    color: var(--danger-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row label { margin: 0; }

.radio-list { display: grid; gap: 4px; }
.radio-list .checkbox-row { margin: 0; font-weight: 400; }

/* Spam trap on the feedback form: off-screen for people, still "there" for bots. */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-bottom: 12px;
}

.checkbox-grid .checkbox-row {
    font-weight: 500;
    margin: 0;
}

.form input[type="number"],
.form input[type="url"] {
    width: 100%;
    min-height: var(--tap);
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

/* "Waiting for review" note on reader-submitted books. */
.pending-note {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
    background: var(--chip-bg);
    font-size: 0.9rem;
}

fieldset {
    min-width: 0;   /* browsers default this to min-content, which overflows */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px 4px;
    margin: 0 0 16px;
}

legend {
    font-weight: 700;
    padding: 0 6px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.search-form {
    display: flex;
    gap: 8px;
}

/* Inputs sitting beside a button: let them shrink instead of pushing the
   button (or the whole page) past the screen edge. */
.search-form input,
.add-tag-form select {
    flex: 1;
    width: auto;
    min-width: 0;
}


/* ---------- Chips (filters and tags) ---------- */

.chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 calc(var(--gutter) * -1) 12px;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.chip-list form { margin: 0; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--chip-border);
    border-radius: var(--radius-chip);
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.chip:hover { filter: brightness(0.97); }

.chip[aria-current="true"],
.chip[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.chip-count {
    font-size: 0.8rem;
    opacity: 0.8;
}


/* ---------- Book lists ---------- */

.book-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.book-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.book-row:last-child { border-bottom: none; }

/* Jumping to #book-12 shouldn't tuck the row under the sticky header. */
.book-row { scroll-margin-top: 90px; }

.load-more {
    list-style: none;
    padding: 16px 0;
}

.load-more.is-loading a {
    opacity: 0.6;
    pointer-events: none;
}

.load-more.is-loading a::after { content: "…"; }

.book-row h3 {
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.book-row h3 a {
    color: var(--text);
    text-decoration: none;
}

.book-row p { margin-bottom: 6px; }

.book-genres {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface-2);
    box-shadow: var(--shadow);
}

/* Stand-in when a book has no cover image. */
.cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.status-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.status-form select {
    width: auto;
    min-height: 38px;
    padding: 6px 34px 6px 12px;
}

.status-form select:disabled { opacity: 0.6; }

/* My Books: "Search my library" sits first in the toolbar, as wide as it can. */
.library-search { flex: 1 1 100%; min-width: 0; }   /* own row on phones */
.library-search input { min-height: 40px; padding: 8px 12px; }
.library-count { margin: 4px 0 0; }
.book-row[hidden] { display: none; }

/* "✓ Moved to Read" after a status change saves in place (my-books.js). */
.status-note {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success-text);
    opacity: 0;
    transition: opacity 0.2s;
}

.status-note.is-visible { opacity: 1; }

/* A book leaving a filtered list after its status changed. */
.book-row.is-leaving {
    opacity: 0;
    transition: opacity 0.4s 0.9s;
}

/* Small tag chips on search results; suggested ones are lighter/dashed. */
.result-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 11px;
    border: 1px solid var(--chip-border);
    border-radius: var(--radius-chip);
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tag-chip:hover { border-color: var(--accent); }

.tag-chip-suggested,
.chip-suggested {
    background: transparent;
    border-style: dashed;
    font-weight: 500;
}

.tag-chip-warning { color: var(--danger-text); }

/* "Coming Oct 6" / "Out today!" on search results. */
.release-label {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 10px;
    border-radius: var(--radius-chip);
    background: var(--chip-bg);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

/* "Series: Knockemout #1" under a book's author line. */
.series {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.series-label {
    color: var(--text-muted);
}

.series-name {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text);
}

/* {% rating %}: stars and spice peppers. Empty peppers are faded copies. */
.ratings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-bottom: 6px;
}

.rating {
    white-space: nowrap;
    line-height: 1;
}

.rating-stars {
    color: var(--star);
    letter-spacing: 1px;
}

.rating-peppers { letter-spacing: -1px; }

.rating-peppers .rating-off {
    opacity: 0.2;
    filter: grayscale(1);
}

.stars {
    color: var(--star);
    letter-spacing: 1px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 8px;
}

.toolbar-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.toolbar-field select {
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
}

.toolbar label { margin: 0; font-weight: 500; }

/* Search: pick several tags (a book shows if it has any of them). The
   panel drops down below the button; on phones it opens in place. */
.tag-field { position: relative; }
.tag-field:has(details[open]) { flex-basis: 100%; }
.tag-picker { width: 100%; }

.tag-picker summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 34px 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background-color: var(--input-bg);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: right 19px center, right 14px center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
}

.tag-picker summary::-webkit-details-marker { display: none; }

.tag-picker-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: var(--radius-chip);
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.tag-picker-panel {
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tag-picker-panel > p { margin-bottom: 8px; }
.tag-picker-panel fieldset { padding: 8px 12px 6px; margin-bottom: 10px; }
.tag-picker-panel legend { font-size: 0.85rem; }

.tag-picker-panel .checkbox-row {
    margin: 0 0 6px;
    font-weight: 400;
    gap: 8px;
}

.tag-picker-panel input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }

.tag-picker-actions {
    position: sticky;
    bottom: -12px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0 2px;
    background: var(--surface);
}

.chosen-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.chosen-tag { border-color: var(--accent); }

.toolbar select {
    width: auto;
    min-height: 38px;
    padding: 6px 34px 6px 12px;
}


/* ---------- Landing page (logged-out homepage) ---------- */

.landing-hero {
    text-align: center;
    padding: 8px 0 24px;
}

.landing-hero .hero-logo { margin-bottom: 16px; }

.landing-hero h1 {
    font-size: 1.9rem;
    margin-bottom: 12px;
}

.landing-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 34em;
    margin: 0 auto 20px;
}

/* Demo video at the very top of the landing page. */
.landing-video {
    max-width: 720px;
    margin: 0 auto 20px;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    background: var(--surface-2);
}

.landing-video video {
    display: block;
    width: 100%;
    height: auto;
}

.landing-sublead {
    max-width: 34em;
    margin: -8px auto 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

/* A made-up review card showing off the ratings. */
.landing-sample {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    max-width: 440px;
    margin: 0 auto;
}

.landing-sample + .page-section { margin-top: 32px; }

.landing-sample h3 { margin-bottom: 8px; }

.landing-sample-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    background: linear-gradient(160deg, var(--accent), var(--chip-bg));
    font-size: 2rem;
}

.landing-sample-status {
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

.landing-sample-ratings {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.landing-sample-ratings dt { color: var(--text-muted); }
.landing-sample-ratings dd { margin: 0; }

.feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-grid .card + .card { margin-top: 0; }

.feature h3 { margin: 6px 0 4px; }
.feature p { margin: 0; color: var(--text-muted); }
.feature-icon { font-size: 1.6rem; line-height: 1; }

/* Numbered steps with round badges. */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding: 4px 0 16px 48px;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
}

.steps strong { display: block; }

.landing-cta { margin-top: 32px; padding: 24px 16px; }


/* ---------- Homepage ---------- */

/* ---------- Ask Claude for your next read ---------- */

.next-read-form fieldset { margin-bottom: 12px; }
.next-read-form .checkbox-row { font-weight: 500; }

.form button:disabled { opacity: 0.6; cursor: wait; }

.thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    color: var(--text-muted);
}

.thinking[hidden] { display: none; }

.thinking-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: thinking-pulse 1s ease-in-out infinite alternate;
}

@keyframes thinking-pulse {
    from { opacity: 0.25; transform: scale(0.8); }
    to   { opacity: 1;    transform: scale(1.1); }
}

.shared-note { margin-bottom: 12px; }

.next-read-form + #suggestions { margin-top: 32px; }

/* The homepage's Ask Claude box. */
.ask-claude-box,
#ask-claude.dash-card {
    border-color: var(--chip-border);
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        var(--surface);
}

.ask-claude-box h2 { font-size: 1.2rem; margin: 0; }
.ask-claude-box .widget-header { margin-bottom: 10px; }

.ask-claude-form {
    display: flex;
    gap: 8px;
}

.ask-claude-form input { flex: 1; width: auto; min-width: 0; }
.ask-claude-form button { flex-shrink: 0; }
.ask-claude-form button:disabled { opacity: 0.6; cursor: wait; }

.ask-claude-note { margin: 8px 0 0; }

.ask-claude-box + .home-shelf { border-top: none; padding-top: 4px; }

.suggestion-list { padding-top: 4px; padding-bottom: 4px; }

.suggestion-why {
    margin: 6px 0 10px;
    font-style: italic;
}

#suggestions { scroll-margin-top: 90px; }


/* ---------- Privacy policy and account data ---------- */

.legal { max-width: 680px; }
.legal h1 { font-size: 1.8rem; margin-bottom: 4px; }
.legal h2 { font-size: 1.3rem; margin-top: 1.8em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.2em; }
.legal ul { padding-left: 20px; margin: 0 0 1em; }
.legal li + li { margin-top: 6px; }
.legal h2[id] { scroll-margin-top: 90px; }
.legal-summary { margin: 16px 0 8px; }
.legal-summary h2 { margin-top: 0; }
.legal-summary ul { margin-bottom: 0; }

.agree-row label { font-weight: 400; }

.danger-link { color: var(--danger-text); }

.btn-danger {
    background: var(--danger-text);
    color: var(--danger-bg);   /* readable in light and dark themes */
}

.danger-zone { border-color: var(--danger-text); }
.danger-zone ul { padding-left: 20px; }


/* ---------- Import books ---------- */

.import-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.import-columns li {
    padding: 2px 10px;
    border-radius: var(--radius-chip);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    color: var(--chip-text);
    font-size: 0.8rem;
    font-weight: 600;
}

.import-help { padding-left: 18px; }

.rematch-box { border-color: var(--accent); background: var(--chip-bg); }

.send-list { border-color: var(--accent); }
.send-list h4 { margin-top: 20px; }
.send-list .author-list { list-style: none; padding: 0; margin: 0; }
.list-status { min-height: 28px; padding: 0 10px; font-size: 0.78rem; }
.list-status-done { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
#send-list { scroll-margin-top: 90px; }
.rematch-box p { margin-bottom: 10px; }

.import-waiting {
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--chip-bg);
    color: var(--chip-text);
}

.import-waiting[hidden] { display: none; }
.import-help li + li { margin-top: 4px; }

.progress {
    height: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-chip);
    background: var(--surface-2);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.4s;
}

.import-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.import-summary strong { font-size: 1.15rem; margin-right: 4px; }

input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}


/* Hero: greeting, this year's stats and the reading-goal ring. */
.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--chip-border);
    border-radius: calc(var(--radius) + 4px);
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
        var(--chip-bg);
}

.hero-text { min-width: 0; }

.home-hero h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.hero-status {
    margin-bottom: 10px;
    color: var(--text-muted);
}

.hero-news {
    margin-bottom: 10px;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-stats li {
    padding: 4px 10px;
    border-radius: var(--radius-chip);
    background: var(--surface);
    border: 1px solid var(--chip-border);
    font-size: 0.82rem;
    color: var(--chip-text);
    white-space: nowrap;
}

/* Phones: the ring sits beside its caption under the greeting. */
.hero-goal {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Progress ring: a conic gradient with the middle cut out. */
.goal-ring {
    --size: 68px;
    flex-shrink: 0;
    position: relative;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface) 0);
}

.goal-ring::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--chip-bg);
}

.goal-ring span {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.75rem;
    line-height: 1.1;
    color: var(--text-muted);
}

.goal-ring strong {
    font-size: 1.2rem;
    color: var(--text);
}

.goal-caption {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.goal-caption a { margin-left: 4px; }

.goal-form label {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.goal-form-row {
    display: flex;
    gap: 6px;
}

.goal-form input[type="number"] {
    width: 76px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    text-align: center;
}

.goal-form button { min-height: 40px; padding: 0 14px; }

/* Your reading (left) and discovery (right) on wide screens. */
.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.home-you,
.home-discover {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* long shelves scroll instead of widening the column */
    gap: 16px;
    align-content: start;
    min-width: 0;
}

.home-you .card + .card { margin-top: 0; }

/* Links like #next-read and #how-was-it land below the sticky header. */
.home-grid [id] { scroll-margin-top: 90px; }
.home-you .getting-started { margin-bottom: 0; }

/* Discovery shelves: open rows rather than boxes. */
.home-shelf {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* The first shelf in the column needs no divider above it. */
.home-discover > .home-shelf:first-child { border-top: none; padding-top: 0; }

.chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* "How was it?": tap a star (or pepper) to rate. Buttons are in 5..1
   order and shown reversed, so hovering one lights it and those before it. */
.tap-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 2px;
    margin: 2px 0 6px;
}

.tap-star {
    min-height: 40px;
    width: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--border-strong);
    font-size: 1.7rem;
    line-height: 1;
}

.tap-star:hover,
.tap-star:hover ~ .tap-star,
.tap-star:focus-visible,
.tap-star:focus-visible ~ .tap-star {
    color: var(--star);
    filter: none;
}

.tap-peppers .tap-star {
    font-size: 1.4rem;
    filter: grayscale(1);
    opacity: 0.35;
}

.tap-peppers .tap-star:hover,
.tap-peppers .tap-star:hover ~ .tap-star,
.tap-peppers .tap-star:focus-visible,
.tap-peppers .tap-star:focus-visible ~ .tap-star {
    filter: none;
    opacity: 1;
}

.how-was-it .book-row p { margin-bottom: 0; }

.pick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.next-read .picked { padding-top: 0; border-bottom: none; }

/* ---------- Dashboard widgets ---------- */

.dash-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}

.dash-toggle { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.dash-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.dash-help { margin: -4px 0 12px; }
.dash-help[hidden], .dash-add[hidden] { display: none; }

/* Two columns like the homepage before widgets: a narrow one for your
   reading and a wide one for discovery (one column on phones). Cards stack
   in each column, so nothing leaves holes or gets stretched. */
.dash-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.dash-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dash-col .card + .card { margin-top: 0; }

/* While customizing, each column is a visible drop area (even when empty). */
.is-customizing .dash-col {
    min-height: 140px;
    padding: 8px;
    border-radius: calc(var(--radius) + 8px);
    background: color-mix(in srgb, var(--chip-bg) 45%, transparent);
}

/* Softer cards: no hard border, a gentle lift, rounder corners. */
.dash-card {
    position: relative;
    min-width: 0;
    scroll-margin-top: 90px;
    padding: 16px 18px;
    border-color: transparent;
    border-radius: calc(var(--radius) + 6px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.06);
}

.dash-card .widget-header { flex-wrap: wrap; margin-bottom: 10px; }
.dash-card .widget-header h2 { font-size: 1.05rem; }
.dash-card .widget-source { margin-top: 8px; }

/* Compact book rows in dashboard cards (e.g. Currently Reading). */
.dash-card .book-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.dash-card .book-row h3 { font-size: 0.98rem; }
.dash-card .book-row p { margin-bottom: 4px; }
.dash-card .book-row .cover-placeholder { font-size: 1.1rem; }

.btn-small {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
}

/* Customize controls: hidden until Customize is on. */
.dash-edit { display: none; }

.is-customizing .dash-card {
    outline: 2px dashed var(--chip-border);
    outline-offset: 3px;
}

.is-customizing .dash-edit {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: -4px -4px 8px 0;
}

.dash-edit form { margin: 0; }

/* The ⠿ drag handle: a wide, easy target on the left of the card's top bar. */
.dash-handle {
    margin-right: auto;
    min-height: 34px;
    padding: 0 12px 0 10px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: grab;
    touch-action: none;       /* the finger drags the card, not the page */
    user-select: none;
    -webkit-user-select: none;
}

.dash-handle-text { font-size: 0.8rem; font-weight: 600; }
.dash-handle:hover { color: var(--text); filter: none; }

.dash-card.is-dragging {
    opacity: 0.75;
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    transform: scale(1.01);
}

body.dash-dragging,
body.dash-dragging * {
    cursor: grabbing !important;
    user-select: none;
    -webkit-user-select: none;
}

.dash-edit-button {
    min-height: 34px;
    width: 34px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem;
}

.dash-edit-button[data-action="hide"] { color: var(--danger-text); }

.dash-add { margin-top: 20px; }

.dash-add-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-add-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.dash-add-item p { margin: 2px 0 0; }
.dash-add-item form { margin: 0; flex-shrink: 0; }

/* Horizontal bar charts (tags, genres, authors, ratings). */
.bar-chart {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 2.2em;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-label a { color: var(--text); text-decoration: none; }
.bar-label a:hover { text-decoration: underline; }

.bar-track {
    height: 10px;
    border-radius: var(--radius-chip);
    background: var(--surface-2);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: var(--accent);
}

.bar-count { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.rating-spread { display: grid; gap: 14px; }
.rating-spread p { margin-bottom: 6px; }

/* Books finished per month: twelve little columns. */
.month-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4px;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

.month-bar {
    display: grid;
    grid-template-rows: 1.2em 90px auto;
    justify-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.month-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 22px;
    height: 100%;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
}

.month-fill { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.month-count { font-weight: 600; color: var(--text); }
.month-bar.is-current .month-label { color: var(--accent); font-weight: 700; }

/* First visit with an empty library. */
.getting-started { margin-bottom: 24px; }
.getting-started .steps { margin-top: 12px; }
.getting-started .steps li:last-child { padding-bottom: 0; }

/* My Books → the reader's own lists. These chips wrap (rather than scroll
   sideways) so the "+ New list" form can open below them. */
.list-chips { flex-wrap: wrap; overflow: visible; align-items: center; }
.chip-row-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.new-list summary { list-style: none; cursor: pointer; }
.new-list summary::-webkit-details-marker { display: none; }
.new-list[open] { flex-basis: 100%; }
.new-list-form { display: flex; gap: 8px; margin-top: 8px; }
.new-list-form input { flex: 1; min-width: 0; }

.list-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 4px 0 8px; }
.list-header h3 { margin: 0; }
.list-edit summary { cursor: pointer; color: var(--link); }
.list-edit[open] { flex-basis: 100%; }
.list-edit form + form { margin-top: 8px; }

.remove-from-list { margin-top: 4px; }

/* Ask AI → earlier suggestions, one collapsible card each. */
.earlier-request summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; cursor: pointer; }
.earlier-prompt { font-weight: 600; }
.earlier-request .suggestion-list { margin-top: 12px; box-shadow: none; border: none; padding: 0; }

/* Book clubs and friends. */
.club-head h2 { margin-bottom: 4px; }
.club-head { margin-bottom: 20px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-actions form { margin: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input, .copy-row select { flex: 1; min-width: 0; }
.start-club summary { cursor: pointer; }
.start-club form { margin-top: 12px; }
.club-pick + .club-pick { margin-top: 12px; }
.club-pick-book { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.club-pick-book .cover { width: 64px; }
.club-pick-title { font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 2px; }
.club-readers { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); }
.club-readers li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }

.club-choice-name { margin: 0; }
.bp-clubs .bp-lists-form + .bp-lists-form { padding-top: 10px; border-top: 1px solid var(--border); }

/* The club's current read ("Now reading" panel). */
.club-now { border: 2px solid var(--accent); }
.club-now-badge {
    display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px;
    background: var(--accent); color: var(--accent-contrast); font-weight: 600; font-size: 0.85rem;
}
.club-now-book { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.club-now-cover .cover { width: 120px; }
.club-now-title { font-size: 1.35rem; margin: 0 0 2px; }
.club-now-step { margin-top: 8px; }
.club-now-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.club-now-actions .btn { flex: 1; min-width: 150px; text-align: center; }
@media (min-width: 700px) {
    .club-now-book { grid-template-columns: 160px minmax(0, 1fr); }
    .club-now-cover .cover { width: 160px; }
}

/* Club AI picks. */
.ai-picks-form label { font-weight: 600; display: block; margin-bottom: 6px; }
.ai-picks-form .small { margin: 8px 0 0; }
.ai-description { margin: 4px 0 8px; }
.ai-description summary { cursor: pointer; color: var(--link); font-size: 0.9rem; }
.ai-description[open] summary { margin-bottom: 6px; }
.ai-description .small p { margin-bottom: 0.5em; }

/* Club votes on the next read. */
.poll-options { list-style: none; margin: 0; padding: 0 16px; }
.poll-option { padding: 12px 0; border-bottom: 1px solid var(--border); }
.poll-option:last-child { border-bottom: none; }
.poll-option-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.poll-bar { height: 8px; margin: 8px 0; border-radius: 999px; background: var(--chip-bg); overflow: hidden; }
.poll-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.poll-option.is-mine .poll-option-head strong::before { content: "✓ "; color: var(--accent); }

/* Club discussions. */
.club-posts { list-style: none; margin: 0; padding: 0; }
.club-post + .club-post { margin-top: 10px; }
.club-post-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.club-post-body p { margin-bottom: 0.5em; overflow-wrap: anywhere; }
.spoiler summary { cursor: pointer; color: var(--text-muted); }
.report summary { list-style: none; cursor: pointer; }
.report summary::-webkit-details-marker { display: none; }
.report[open] { flex-basis: 100%; }

/* A pending book's "Look it up again" (and staff's Amazon link). */
.match-again { display: grid; gap: 8px; margin: -8px 0 16px; }
.match-again-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.match-again-form input { flex: 1; min-width: 200px; }

/* Monthly wrap-up (/wrap-up/) */
.wrap-nav { display: flex; justify-content: space-between; margin-bottom: 8px; }
.wrap-hero { text-align: center; margin: 8px 0 24px; }
.wrap-kicker { margin: 0; color: var(--accent); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.wrap-hero h1 { margin: 4px 0; font-size: 2rem; }
.wrap-stats { display: flex; justify-content: center; gap: 12px; list-style: none; margin: 16px 0 0; padding: 0; }
.wrap-stats li {
    flex: 1 1 0; max-width: 140px; padding: 12px 8px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem;
}
.wrap-stats strong { display: block; font-size: 1.8rem; color: var(--accent); line-height: 1.1; }
.wrap-covers {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 12px;
    list-style: none; margin: 0; padding: 0;
}
.wrap-covers li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wrap-cover-title { font-size: 0.85rem; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wrap-list { list-style: none; margin: 0; }
.wrap-list li + li { margin-top: 8px; }
.wrap-share img { display: block; width: 100%; max-width: 280px; height: auto; margin: 12px auto; border-radius: 12px; box-shadow: var(--shadow); }
.wrap-share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Ads ({% ad_slot %}): clearly labeled, set apart, with room reserved so
   the page doesn't jump when one loads. */
.ad-spot {
    margin: 24px 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 120px;
    overflow: hidden;
}
.ad-label {
    margin: 0 0 6px;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Staff: All books (covers) */
.staff-books-toolbar .library-search { flex: 1 1 220px; }
.staff-book h3 { margin: 0 0 2px; font-size: 1rem; }
.staff-book p { margin: 0 0 6px; }
.staff-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.staff-book details summary { cursor: pointer; color: var(--text-muted); }
.staff-book details .match-again-form { margin-top: 6px; }
.staff-pages { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; }

/* Edit book details → the cover beside its upload/link fields. */
.cover-edit-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; align-items: start; }
.cover-edit-row .cover { width: 90px; }
.cover-edit-row input[type="file"] { max-width: 100%; }

/* A book's page → "📋 My lists". */
.bp-lists summary { cursor: pointer; font-weight: 600; }
.bp-lists-form { display: grid; gap: 8px; margin-top: 10px; }
.bp-lists-form .checkbox-row { font-weight: 400; }

/* "✓ Added to your Want to Read list" (Claude's suggestions, added in place). */
.added-note { color: var(--accent); }

/* The Getting started page (/getting-started/): numbered step cards. */
.gs-intro { margin-bottom: 20px; }
.gs-intro h1 { font-size: 1.75rem; }
.gs-count { color: var(--accent); }

.gs-steps { list-style: none; margin: 0; padding: 0; }

.gs-step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
}

.gs-step h2 { font-size: 1.25rem; margin-top: 6px; }

.gs-num {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
    font-size: 1.1rem;
}

.gs-step.is-done .gs-num { background: var(--chip-bg); color: var(--accent); border: 2px solid var(--accent); }
.gs-step.is-done h2 { color: var(--text-muted); }

.gs-status { font-weight: 600; color: var(--accent); }

.gs-options { padding-left: 18px; margin: 0 0 14px; }
.gs-options li + li { margin-top: 8px; }

.gs-links { padding-left: 18px; margin: 0 0 14px; }
.gs-links li + li { margin-top: 4px; }

.gs-rate-list { margin-bottom: 12px; }
.gs-rate-list .tap-rating { gap: 0; }
.gs-rate-list .tap-star { width: 34px; }   /* five fit beside the cover on a phone */

.gs-extras { margin-top: 24px; }
.gs-extras h2 { font-size: 1.15rem; }
.gs-extras ul { list-style: none; padding: 0; margin: 0 0 12px; }
.gs-extras li + li { margin-top: 8px; }

.gs-tutorial { margin-top: 16px; }
.gs-tutorial h2 { font-size: 1.15rem; }

/* Newsletter issues on the web (/newsletter/<slug>/). */
.newsletter-issue { padding: 20px 22px; }
.newsletter-issue h2 { font-size: 1.35rem; margin-top: 1.4em; color: var(--accent); }
.newsletter-issue h2:first-of-type { margin-top: 0.4em; }
.newsletter-issue ul { padding-left: 22px; }
.newsletter-issue li + li { margin-top: 8px; }
.newsletter-issue blockquote { margin: 14px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--chip-bg); }
.newsletter-issue blockquote p:last-child { margin-bottom: 0; }

/* How to use TropeWise (/how-to-use/). */
.tutorial-toc h2 { font-size: 1.1rem; }
.tutorial-toc ol { columns: 2; column-gap: 24px; margin: 0; padding-left: 20px; }
.tutorial-toc li { break-inside: avoid; margin-bottom: 4px; }
.tutorial-section { margin-top: 16px; scroll-margin-top: 16px; }
.tutorial-section h2 { font-size: 1.25rem; }
.tutorial-section h3 { font-size: 1.05rem; margin-top: 14px; }
.tutorial-section ol, .tutorial-section ul { padding-left: 20px; margin: 0 0 10px; }
.tutorial-section li + li { margin-top: 6px; }
.tutorial-section li ul { margin-top: 6px; }
.tutorial .tip { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--chip-bg); font-size: 0.92rem; }
@media (max-width: 420px) { .tutorial-toc ol { columns: 1; } }

.gs-feedback { margin-top: 16px; border-color: var(--accent); background: var(--chip-bg); }
.gs-feedback h2 { font-size: 1.15rem; }

/* One-time tip (e.g. "choose a theme in Account"). */
.tip-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 12px 12px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--chip-bg);
    color: var(--text);
}

.tip-banner p { margin: 0; flex: 1; }

.tip-banner form { margin: 0; }

.tip-dismiss {
    min-height: 32px;
    width: 32px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
}

.tip-dismiss:hover { background: var(--surface); filter: none; }

.dashboard {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 16px;
}

.widget h2 {
    font-size: 1.2rem;
    margin: 0;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.widget .book-list .book-row:first-child { padding-top: 0; }

.widget-source {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.genre-picker select {
    width: auto;
    max-width: 55vw;
    min-height: 36px;
    padding: 4px 32px 4px 12px;
}

.shelf-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 16px 0 8px;
}

/* A sideways-scrolling row of covers. */
.shelf {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    list-style: none;
    margin: 0 -16px;
    padding: 0 16px 6px;
    scroll-snap-type: x proximity;
    scroll-padding: 0 16px;   /* snap to the padding, not the card's edge */
    scrollbar-width: none;
}

.shelf::-webkit-scrollbar { display: none; }

.shelf-item {
    flex: 0 0 96px;
    scroll-snap-align: start;
}

.shelf-item a {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.shelf-cover {
    position: relative;
    display: block;
    margin-bottom: 6px;
}

.shelf-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.shelf-title,
.shelf-author {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.25;
}

.shelf-title {
    -webkit-line-clamp: 2;
    font-weight: 600;
}

.shelf-author {
    -webkit-line-clamp: 1;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.shelf-detail {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}


/* Kindle Unlimited: the book-page box and the little "KU" badges. */
.ku-box h3 { margin-bottom: 6px; }

.ku-box.ku-yes { border-color: var(--accent); }

.ku-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ku-actions button[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

.ku-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.shelf-cover .ku-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
}

/* Author rows with a Follow button (book page, Following page). */
.author-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.author-row + .author-row { border-top: 1px solid var(--border); }

.author-row p { margin: 2px 0 0; }

.card.author-list { padding: 6px 16px; }

.author-search { margin: 8px 0 20px; }
.author-results { margin-top: 0; }
.author-results h3 { font-size: 1.05rem; }
.author-results .author-list + p { margin-top: 10px; }


/* ---------- Book detail ---------- */

.book-hero {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.book-hero h2 { margin-bottom: 4px; }

.book-hero .cover-placeholder { font-size: 2.5rem; }

.description p { margin-bottom: 0.9em; }
.description > :last-child { margin-bottom: 0; }

/* Book page layout. Phones: one column, with the cover beside the title
   (the side/main wrappers step aside via display: contents so each piece
   can be placed in the page grid). Wider screens: sidebar + main column. */
.book-page {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-areas:
        "cover   head"
        "actions actions"
        "review  review"
        "lists   lists"
        "clubs   clubs"
        "ku      ku"
        "tags    tags"
        "desc    desc"
        "join    join";
    column-gap: 16px;
    align-items: start;
}

.book-side,
.book-main { display: contents; }

/* Row gaps would double up around missing pieces, so space with margins. */
.book-page > * > * { margin: 0 0 20px; }
.book-page .card + .card { margin-top: 0; }

.bp-cover   { grid-area: cover; }
.bp-head    { grid-area: head; }
.bp-actions { grid-area: actions; }
.bp-review  { grid-area: review; }
.bp-lists   { grid-area: lists; }
.bp-clubs   { grid-area: clubs; }
.bp-ku      { grid-area: ku; }
.bp-tags    { grid-area: tags; }
.bp-description { grid-area: desc; }
.bp-join    { grid-area: join; }

.community-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.visitor-cta { border-color: var(--accent); }

/* Public trope/theme pages. */
.page-heading { font-size: 1.7rem; margin-bottom: 6px; }
.section-heading { font-size: 1.2rem; }
.breadcrumbs { margin-bottom: 8px; color: var(--text-muted); }
.tag-links { list-style: none; margin: 0; padding: 0; }
.tag-book-list { padding-top: 4px; padding-bottom: 4px; }
.tag-book-title { font-size: 1.05rem; margin-bottom: 2px; }
.tag-book-title a { color: var(--text); text-decoration: none; }
.visitor-cta .btn { margin-right: 12px; }

.bp-cover .cover-placeholder { font-size: 2.5rem; }

.book-title {
    font-size: 1.45rem;
    margin-bottom: 4px;
}

.book-byline {
    margin-bottom: 6px;
    color: var(--text-muted);
}

.book-series {
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.genre-list { margin: 0; }

.genre-list .tag-chip { font-weight: 500; }

.bp-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.bp-actions form { margin: 0; }

.bp-actions .btn { padding: 0 10px; }

/* Community tags: soft like the genre pills rather than solid accent.
   Your votes keep their ✓ and get an accent outline. */
.bp-tags .chip {
    min-height: 32px;
    padding: 4px 12px;
    white-space: normal;   /* long names wrap inside a narrow column */
    text-align: left;
    background: var(--chip-bg);
    border-color: var(--chip-border);
    color: var(--chip-text);
    font-size: 0.82rem;
    font-weight: 500;
}

.bp-tags .chip[aria-pressed="true"] {
    background: var(--chip-bg);
    border-color: var(--accent);
    color: var(--chip-text);
    font-weight: 600;
}

.bp-tags .chip-suggested {
    background: transparent;
    border-style: dashed;
}

/* Tropes / Themes / Content Warnings: stacked on phones, side by side wider. */
.tag-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px 24px;
}

.tag-group h4 { margin-top: 0; }

/* After voting, the page jumps to #tags; keep it clear of the sticky header. */
.bp-tags,
#authors { scroll-margin-top: 90px; }

.bp-tags .chip-list { gap: 6px; }

/* "by Author [+ Follow]" under the book title. */
.byline-author {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-right: 4px;
}

.byline-author form { display: inline; margin: 0; }

.follow-chip {
    min-height: 24px;
    padding: 0 9px;
    font-size: 0.72rem;
    font-weight: 600;
}
.bp-authors h3 { margin-bottom: 0; }

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.review-header h3 { margin: 0; }

.review-status {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.8rem;
}

/* Ratings side by side, each a small label over its stars/peppers. */
.rating-table {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    margin: 12px 0 14px;
}

.rating-table div { min-width: 0; }

.rating-table dt {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rating-table dd { margin: 0; white-space: nowrap; }

.review-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.review-actions form { margin: 0; }
#my-review { scroll-margin-top: 90px; }
.review-actions .btn-link { font-size: 0.875rem; }

.review-notes {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 0.95rem;
}

.detail-list {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    margin: 12px 0 0;
    font-size: 0.875rem;
}

.detail-list dt { color: var(--text-muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }

.add-tag-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}


/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
    body { padding-bottom: 0; }

    .site-header { padding-left: 24px; padding-right: 24px; }

    /* The tab bar moves up into the header as plain links. */
    .tab-bar {
        position: static;
        background: none;
        border: none;
        padding: 0;
        gap: 4px;
    }

    .tab-bar a {
        flex: none;
        flex-direction: row;
        min-height: 40px;
        padding: 0 12px;
        border-radius: var(--radius);
        font-size: 0.95rem;
    }

    .tab-bar a[aria-current="page"] { background: var(--chip-bg); }

    .tab-bar .tab-admin { display: flex; }
    .tab-bar .tab-long { display: inline; }

    .tab-icon { font-size: 1rem; }

    main { padding-top: 32px; }

    .logo { height: 44px; }

    h2 { font-size: 1.85rem; }

    .book-hero { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }

    /* Book page: sidebar beside the main column. */
    .main-wide { max-width: 1040px; }

    .book-page {
        grid-template-columns: 220px minmax(0, 1fr);
        grid-template-areas: none;
        column-gap: 36px;
    }

    .book-side,
    .book-main { display: block; min-width: 0; }

    .book-page > * > * { margin-bottom: 24px; }
    .book-side > * { margin-bottom: 16px; }

    .bp-actions { grid-template-columns: minmax(0, 1fr); }

    .book-title { font-size: 2.1rem; }
    .book-byline { font-size: 1.1rem; }

    .bp-ku h3 { font-size: 1.05rem; }

    .rating-table { grid-template-columns: repeat(5, minmax(0, 1fr)); }

    .tag-field:has(details[open]) { flex-basis: auto; }

    .library-search { flex-basis: 260px; }   /* beside Sort by on wider screens */

    .dash-add-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Tag picker drops down over the results instead of pushing them down. */
    .tag-picker-panel {
        position: absolute;
        z-index: 20;
        top: 100%;
        left: 0;
        width: 340px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .book-row { grid-template-columns: 72px minmax(0, 1fr); }

    .chip-row {
        flex-wrap: wrap;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .shelf-item { flex-basis: 112px; }

    .landing-hero h1 { font-size: 2.5rem; }
    .landing-actions { flex-direction: row; justify-content: center; max-width: none; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Room for the tag groups side by side (narrower windows keep them stacked). */
@media (min-width: 1000px) {
    .tag-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Homepage: your reading beside the discovery shelves. */
@media (min-width: 900px) {
    .home-grid,
    .dash-columns {
        grid-template-columns: 340px minmax(0, 1fr);
        gap: 32px;
    }

    .home-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 24px;
        align-items: center;
        padding: 24px 28px;
    }
    .home-hero h1 { font-size: 2rem; }

    /* Ring above its caption, centered, beside the greeting. */
    .hero-goal { flex-direction: column; gap: 6px; text-align: center; }
    .goal-ring { --size: 112px; }
    .goal-ring strong { font-size: 1.6rem; }
    .goal-form-row { justify-content: center; }
}


/* ==========================================================================
   Themes
   ========================================================================== */

/* Cozy Library — warm paper, serif, burgundy and brass. */
[data-theme="cozy"] {
    color-scheme: light;
    --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

    --bg: #FBF7F0;
    --surface: #FFFDF9;
    --surface-2: #F3ECDF;
    --input-bg: #FFFFFF;
    --text: #2B2320;
    --text-muted: #6B5E57;
    --border: #E8DECF;
    --border-strong: #CDBFAB;
    --link: #7A2E3A;
    --accent: #7A2E3A;
    --accent-contrast: #FFFFFF;
    --focus: #B08D57;
    --chip-bg: #F3E8D8;
    --chip-border: #E2D2BA;
    --chip-text: #5A4632;
    --star: #B08D57;
    --success-bg: #EEF3E6;
    --success-text: #3D5226;
    --danger-bg: #F8E6E6;
    --danger-text: #8A1F1F;
    --shadow: 0 1px 2px rgba(60, 40, 20, 0.08);
}

/* Moody Romantasy — ink and plum, soft gold. */
[data-theme="moody"] {
    color-scheme: dark;
    --show-logo-on-light: none;
    --show-logo-on-dark: block;
    --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

    --bg: #1C1624;
    --surface: #251D30;
    --surface-2: #2F2540;
    --input-bg: #1F1829;
    --text: #EDE6F2;
    --text-muted: #B3A6C0;
    --border: #3A2E4B;
    --border-strong: #574670;
    --link: #E2C487;
    --accent: #D4AF6A;
    --accent-contrast: #1C1624;
    --focus: #E2C487;
    --chip-bg: #3A2650;
    --chip-border: #4F3668;
    --chip-text: #EBDDF5;
    --star: #D4AF6A;
    --success-bg: #22332A;
    --success-text: #BFE3C9;
    --danger-bg: #3D1F28;
    --danger-text: #F5B8C4;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Clean & Modern — bright, crisp, one teal accent. */
[data-theme="modern"] {
    color-scheme: light;
    --radius: 8px;

    --bg: #F7F8FA;
    --surface: #FFFFFF;
    --surface-2: #F1F3F5;
    --input-bg: #FFFFFF;
    --text: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --border-strong: #D1D5DB;
    --link: #0F766E;
    --accent: #0F766E;
    --accent-contrast: #FFFFFF;
    --focus: #14B8A6;
    --chip-bg: #E6F4F2;
    --chip-border: #CCE9E5;
    --chip-text: #115E59;
    --star: #D97706;
    --success-bg: #ECFDF5;
    --success-text: #065F46;
    --danger-bg: #FEF2F2;
    --danger-text: #991B1B;
    --shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

/* Soft & Playful — blush and lavender, rounded everything. */
[data-theme="playful"] {
    color-scheme: light;
    --font-body: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
    --radius: 18px;

    --bg: #FFF5F7;
    --surface: #FFFFFF;
    --surface-2: #FCE8EE;
    --input-bg: #FFFFFF;
    --text: #3B2A3F;
    --text-muted: #7A6680;
    --border: #F3D5DF;
    --border-strong: #E5B8C8;
    --link: #7552B0;
    --accent: #7552B0;
    --accent-contrast: #FFFFFF;
    --focus: #E58FB0;
    --chip-bg: #FCE1EA;
    --chip-border: #F6C9D8;
    --chip-text: #7B3F61;
    --star: #E0719B;
    --success-bg: #EEF8F1;
    --success-text: #2F6B45;
    --danger-bg: #FDECEF;
    --danger-text: #9B2342;
    --shadow: 0 2px 6px rgba(117, 82, 176, 0.08);
}

/* ---------- Book games (/games/) ---------- */
.game-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game-grid .card + .card { margin-top: 0; }
.game-tile { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--text); text-decoration: none; }
.game-tile:hover { border-color: var(--accent); }
.game-tile.is-played { opacity: 0.8; }
.game-emoji { font-size: 2rem; line-height: 1.1; }
.game-status { margin-top: auto; color: var(--accent); font-weight: 600; }
.game-problem { color: var(--danger-text); background: var(--danger-bg); padding: 8px 12px; border-radius: var(--radius); }
.game-badges { background: var(--success-bg); color: var(--success-text); }
.game-badges p { margin: 0; }
.game-verdict { font-size: 1.2rem; font-weight: 600; text-align: center; }
.game-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.game-share { margin-top: 16px; }
.game-share-text { width: 100%; font-family: inherit; resize: none; }
.game-flag { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.game-flag input { min-width: 0; flex: 1 1 180px; }
.game-picker { position: relative; margin: 12px 0; }
.game-picker input { width: 100%; }
.game-picker-list { list-style: none; margin: 4px 0 0; padding: 0; border-radius: var(--radius); }
.game-picker-list li button { width: 100%; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 0; padding: 10px 12px; min-height: var(--tap); }
.game-picker-list li:first-child button { border-radius: var(--radius) var(--radius) 0 0; }
.game-picker-list li:last-child button { border-radius: 0 0 var(--radius) var(--radius); }
.game-answer { display: flex; gap: 12px; align-items: center; }
.game-answer img { border-radius: 4px; object-fit: cover; }
.game-answer p { margin: 0 0 2px; }
.guess-list { padding-left: 20px; }

.trivia-card { display: flex; flex-direction: column; gap: 8px; }
.trivia-question { font-size: 1.25rem; margin: 0 0 4px; }
.trivia-choice { width: 100%; text-align: left; background: var(--surface); color: var(--text); border: 2px solid var(--border-strong); justify-content: flex-start; }
.trivia-choice:disabled { opacity: 1; cursor: default; }
.trivia-choice.is-right { background: var(--success-bg); color: var(--success-text); border-color: var(--success-text); }
.trivia-choice.is-wrong { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-text); }
.trivia-verdict { font-weight: 600; margin: 4px 0; }
.trivia-review { list-style: none; padding: 0; }
.trivia-review p { margin: 0 0 4px; }

.zoom-frame { width: 220px; height: 330px; margin: 0 auto 12px; overflow: hidden; border-radius: 8px; background: var(--chip-bg); }
.zoom-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }

.bookle-guesses { list-style: none; padding: 0; }
.bookle-guess p { margin: 0 0 8px; }
.bookle-guess.is-win { border-color: var(--success-text); }
.bookle-clues { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.bookle-clue { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--chip-bg); color: var(--chip-text); font-size: 0.85rem; }
.bookle-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }
.bookle-clue.is-match { background: var(--success-bg); color: var(--success-text); font-weight: 600; }
.bookle-clue.is-close { background: #FFF1C9; color: #6B4E00; }
.bookle-clue.is-miss { opacity: 0.7; }

.puzzle-board { display: grid; gap: 2px; width: min(100%, 330px); aspect-ratio: 2 / 3; margin: 0 auto; background: var(--border); border-radius: 8px; overflow: hidden; }
.puzzle-tile { min-height: 0; padding: 0; border: none; border-radius: 0; background-color: var(--chip-bg); background-repeat: no-repeat; cursor: pointer; }
.puzzle-tile.is-gap { background: var(--bg); cursor: default; }
.puzzle-board.is-solved { gap: 0; }

.emoji-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.emoji-card.is-right { border-color: var(--success-text); }
.emoji-card.is-wrong { border-color: var(--danger-text); }
.emoji-clue { font-size: 2.4rem; margin: 0; letter-spacing: 0.1em; }
.emoji-form { display: flex; gap: 8px; }
.emoji-form input { flex: 1; min-width: 0; }

.bingo-card { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.bingo-card td { height: 84px; padding: 4px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); text-align: center; vertical-align: middle; font-size: 0.72rem; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; }
.bingo-card td a { color: inherit; text-decoration: none; display: block; }
.bingo-card td.is-filled { background: var(--success-bg); color: var(--success-text); border-color: var(--success-text); }
.bingo-card td.is-free { background: var(--accent); color: var(--accent-contrast); }
.bingo-trope { display: block; font-weight: 600; }
.bingo-book { display: block; margin-top: 4px; font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.quest-list { list-style: none; padding: 0; }
.quest-list li { display: flex; gap: 12px; align-items: center; }
.quest-list li > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.quest-list progress { width: 100%; accent-color: var(--accent); }
.quest-list li.is-done { border-color: var(--success-text); }
