/* ── Colour palette ── */
:root {
    --bg: #f4f9f4;
    --bg-card: #ffffff;
    --text: #2d3a2d;
    --primary: #4a7c59;
    --primary-dark: #3a6347;
    --accent: #6aaa78;
    --border: #c8dcc8;
    --error: #c4856c;          /* soft muted coral */
    --error-bg: #f8efe8;
    --correct: #3a7ca5;       /* calm blue for correct answers */
    --correct-bg: #e4f0f8;

    /* frequency underline colours — distinct hues, nature-inspired */
    --freq-1: #a3c4a8;      /* soft sage */
    --freq-2: #6a9fb5;      /* muted teal */
    --freq-3: #c49a6c;      /* warm amber */
    --freq-4: #b07aa1;      /* dusty plum */
    --freq-5: #c76e6e;      /* warm rose */

    --nav-bg: var(--primary);
    --nav-text: #fff;
    --nav-text-muted: rgba(255, 255, 255, 0.85);
    --input-placeholder: #8a9f8a;
    --muted: #5a7a5a;
    --etymology-bg: #eef5ee;
    --selected-bg: #eef5ee;

    --warning: #b07a20;
    --warning-bg: #fdf5e0;

    /* word-count tier colours */
    --wc-sm:  #3a9a5c;
    --wc-md:  #2a7a44;
    --wc-lg:  #c49a30;
    --wc-xl:  #d4782a;
    --wc-xxl: #8c5aaa;
    --wc-max: #c4730a;
}

/* ── Dark theme ── */
:root[data-theme="dark"] {
    --bg: #1a1e1a;
    --bg-card: #252b25;
    --text: #d4ddd4;
    --primary: #6aaa78;
    --primary-dark: #8ac496;
    --accent: #5a9a68;
    --border: #3a4a3a;
    --error: #d4937a;
    --error-bg: #352a24;
    --correct: #6aafe0;
    --correct-bg: #1e2e3a;

    --freq-1: #7a9a80;
    --freq-2: #5a8aa0;
    --freq-3: #b08a5a;
    --freq-4: #9a6a8a;
    --freq-5: #b06060;

    --warning: #d4aa40;
    --warning-bg: #2a2010;

    --nav-bg: #252b25;
    --nav-text: #d4ddd4;
    --nav-text-muted: rgba(212, 221, 212, 0.7);
    --input-placeholder: #6a7a6a;
    --muted: #7a9a7a;
    --etymology-bg: #2a322a;
    --selected-bg: #2a362a;

    --wc-sm:  #5aba7a;
    --wc-md:  #40a060;
    --wc-lg:  #d4aa40;
    --wc-xl:  #e09030;
    --wc-xxl: #a878cc;
    --wc-max: #e89020;
}

/* ── Light theme ── */
:root[data-theme="light"] {
    --bg: #fdf8f0;
    --bg-card: #ffffff;
    --text: #4a3728;
    --primary: #c4843a;
    --primary-dark: #a06a2a;
    --accent: #d4a05a;
    --border: #e8d8c4;
    --error: #c4856c;
    --error-bg: #f8efe8;
    --correct: #3a7ca5;
    --correct-bg: #e4f0f8;

    --freq-1: #d4c4a8;
    --freq-2: #8ab4c4;
    --freq-3: #c4943a;
    --freq-4: #b07aa1;
    --freq-5: #c47a5a;

    --warning: #c4843a;
    --warning-bg: #faf2e8;

    --nav-bg: #c4843a;
    --nav-text: #fff;
    --nav-text-muted: rgba(255, 255, 255, 0.85);
    --input-placeholder: #b0a090;
    --muted: #8a7a6a;
    --etymology-bg: #faf2e8;
    --selected-bg: #faf2e8;

    --wc-sm:  #3a9a5c;
    --wc-md:  #2a7a44;
    --wc-lg:  #c49a30;
    --wc-xl:  #d4782a;
    --wc-xxl: #8c5aaa;
    --wc-max: #c4730a;
}

/* ── Dyslexia-friendly theme ── */
:root[data-theme="dyslexia"] {
    --bg: #fef9e7;
    --bg-card: #fffef5;
    --text: #3c2a1e;
    --primary: #2c6ea6;
    --primary-dark: #1a5080;
    --accent: #5a9abf;
    --border: #d4c8a8;
    --error: #c8622a;
    --error-bg: #fdf2e6;
    --correct: #2c7a6e;
    --correct-bg: #e6f5f3;

    --freq-1: #7ab4d4;
    --freq-2: #5a9abf;
    --freq-3: #c49a6c;
    --freq-4: #9a7ab4;
    --freq-5: #c47a5a;

    --warning: #c4942a;
    --warning-bg: #fdf5e0;

    --nav-bg: #2c6ea6;
    --nav-text: #fff;
    --nav-text-muted: rgba(255, 255, 255, 0.85);
    --input-placeholder: #9a8a70;
    --muted: #7a6a5a;
    --etymology-bg: #fdf5e0;
    --selected-bg: #fdf5e0;

    --wc-sm:  #4a9a7a;
    --wc-md:  #3a7a60;
    --wc-lg:  #c49a30;
    --wc-xl:  #d4782a;
    --wc-xxl: #8c5aaa;
    --wc-max: #c4730a;
}

[data-theme="dyslexia"] body {
    line-height: 1.9;
    letter-spacing: 0.02em;
    word-spacing: 0.08em;
}

/* ── High contrast theme ── */
:root[data-theme="high-contrast"] {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --text: #f5f5f5;
    --primary: #ffd700;
    --primary-dark: #ffec6e;
    --accent: #ffd700;
    --border: #555555;
    --error: #ff7070;
    --error-bg: #2a0a0a;
    --correct: #7adba0;
    --correct-bg: #0a2a15;

    --freq-1: #88ccff;
    --freq-2: #88ffcc;
    --freq-3: #ffcc44;
    --freq-4: #ff88cc;
    --freq-5: #ff8080;

    --warning: #ffcc44;
    --warning-bg: #2a1e00;

    --nav-bg: #000000;
    --nav-text: #ffd700;
    --nav-text-muted: rgba(255, 215, 0, 0.8);
    --input-placeholder: #888888;
    --muted: #aaaaaa;
    --etymology-bg: #1a1a1a;
    --selected-bg: #1a2a1a;

    --wc-sm:  #70e0a0;
    --wc-md:  #50c080;
    --wc-lg:  #ffd060;
    --wc-xl:  #ffb060;
    --wc-xxl: #d090ff;
    --wc-max: #ff9040;
}

/* ── Colour-blind friendly theme (Okabe-Ito palette) ── */
:root[data-theme="colour-blind"] {
    --bg: #f5f5f0;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --primary: #0072b2;
    --primary-dark: #005a8e;
    --accent: #56b4e9;
    --border: #cccccc;
    --error: #d55e00;
    --error-bg: #fdf0e8;
    --correct: #009e73;
    --correct-bg: #e8f5f0;

    --freq-1: #56b4e9;
    --freq-2: #009e73;
    --freq-3: #e69f00;
    --freq-4: #cc79a7;
    --freq-5: #d55e00;

    --warning: #e69f00;
    --warning-bg: #fdf8e8;

    --nav-bg: #0072b2;
    --nav-text: #ffffff;
    --nav-text-muted: rgba(255, 255, 255, 0.85);
    --input-placeholder: #999999;
    --muted: #666666;
    --etymology-bg: #f0f0ee;
    --selected-bg: #e8f0f8;

    --wc-sm:  #009e73;
    --wc-md:  #0072b2;
    --wc-lg:  #e69f00;
    --wc-xl:  #d55e00;
    --wc-xxl: #cc79a7;
    --wc-max: #8c6a00;
}

/* ── Reset & base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Focus for accessibility ── */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ── Layout ── */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

/* ── Page rainbow ── */
.page-rainbow {
    position: absolute;
    top: 0;
    right: 0;
    width: 260px;
    height: 260px;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
}

.page-emoji {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 2.8rem;
    line-height: 1;
    z-index: 1;
}

.growth-emoji-link {
    text-decoration: none;
    display: block;
}

.home-emoji {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 1.8rem;
    line-height: 1;
}

.growing-page {
    text-align: center;
    padding: 3rem 1rem;
}

.growing-emoji {
    font-size: 6rem;
    line-height: 1;
    margin-bottom: 1.5rem;
}

.growing-message {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 2rem;
    font-style: italic;
}

.growing-back a {
    color: var(--accent);
    text-decoration: none;
}

.growing-back a:hover {
    color: var(--primary-dark);
}

/* ── Navigation ── */
.nav {
    background: var(--nav-bg);
    padding: 0.8rem 0;
    margin-bottom: 2rem;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--nav-text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-menu {
    position: relative;
}

.nav-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.nav-dropdown a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.15s;
}

.nav-dropdown a:hover {
    background: var(--selected-bg);
}

/* ── Headings ── */
h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--primary-dark);
}

/* ── Search form ── */
.lookup-section {
    margin-bottom: 1.5rem;
}

.home-search-input {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s;
}

.home-search-input:focus {
    border-color: var(--primary);
    outline: none;
}

.home-search-input::placeholder {
    color: var(--input-placeholder);
}

/* ── Error message ── */
.error {
    padding: 1rem 1.2rem;
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* ── Add word (manual entry after failed lookup) ── */
.add-word-btn {
    margin-top: 0.8rem;
    padding: 0.5rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.add-word-btn:hover {
    background: var(--primary);
    color: #fff;
}

.add-word-form {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.add-word-field label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.add-word-success {
    margin-top: 1rem;
    color: var(--primary);
    font-weight: 700;
}

/* ── Results ── */
#results {
    margin-bottom: 2rem;
}

/* ── Word view tabs (Definition / Synonyms / Antonyms) ── */
.word-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1.2rem;
}

.word-tab {
    padding: 0.4rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    min-height: 40px;
}

.word-tab:hover {
    background: var(--primary);
    color: #fff;
}

.word-tab-active {
    background: var(--primary);
    color: #fff;
}

.syn-ant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.syn-ant-word {
    padding: 0.4rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.syn-ant-word:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#result-word {
    text-transform: capitalize;
    font-weight: 400;
}

.pos-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
}

.pos-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.def-list {
    list-style: decimal inside;
    padding: 0;
}

.def-list li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
}

.def-list li:last-child {
    border-bottom: none;
}

.def-list li.primary-def {
    font-weight: 700;
}

.def-list li.def-extra {
    display: none;
}

.more-btn {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    font-style: italic;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.more-btn:hover {
    color: var(--primary-dark);
}

/* ── Pronunciation ── */
.pronunciation {
    margin: 0.1rem 0 0.9rem 0;
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.6;
}

.ipa {
    font-style: italic;
    letter-spacing: 0.02em;
}

.pron-accent {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}

.pron-sep {
    color: var(--border);
    font-style: normal;
}

/* ── Etymology ── */
.etymology-btn {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin: 0.5rem 0 1rem;
    min-height: 48px;
}

.etymology-btn:hover {
    background: var(--primary);
    color: #fff;
}

.etymology-box {
    background: var(--etymology-bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.etymology-box.visible {
    max-height: 600px;
    opacity: 1;
    padding: 1rem 1.5rem;
}

/* ── History ── */
.history-legend {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 1.2rem;
}

.history-list {
    list-style: none;
    padding: 0;
}

.history-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.history-list li:last-child {
    border-bottom: none;
}

.history-word {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    padding-bottom: 2px;
    transition: color 0.2s;
}

.history-word:hover {
    color: var(--primary);
}

/* Frequency underline classes */
.freq-1 { border-bottom: 3px solid var(--freq-1); }
.freq-2 { border-bottom: 3px solid var(--freq-2); }
.freq-3 { border-bottom: 3px solid var(--freq-3); }
.freq-4 { border-bottom: 3px solid var(--freq-4); }
.freq-5 { border-bottom: 3px solid var(--freq-5); }

.history-meta {
    font-size: 0.95rem;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    margin-left: 1rem;
}

.muted {
    color: var(--muted);
    font-style: italic;
}

/* ── Frequency key ── */
.freq-key {
    display: flex;
    gap: 1.2rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.freq-key-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.freq-key-line {
    display: inline-block;
    width: 1.5em;
    height: 0;
    border-bottom-width: 3px;
    border-bottom-style: solid;
}

/* ── Utility ── */
.hidden {
    display: none !important;
}

/* ── Loading spinner ── */
.loading::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Revise circle button (home page) ── */
.home-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.home-circle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--nav-text);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.home-circle-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.08);
}

.home-more-btn {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

.home-circle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.home-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    height: 64px;
    border-radius: 32px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.home-book-btn:hover {
    background: var(--primary);
    color: var(--nav-text);
}

/* ── Home watermark ── */
.home-watermark {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.watermark-word {
    position: absolute;
    color: var(--text);
    opacity: 0.07;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.lookup-section,
#error,
#add-word-section,
#results {
    position: relative;
    z-index: 1;
}


/* ── Settings page ── */
.theme-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.theme-group-label {
    width: 100%;
    margin: 0.25rem 0 -0.25rem 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.theme-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, transform 0.2s;
}

.theme-card:hover {
    border-color: var(--primary);
}

.theme-card.active {
    border-color: var(--primary);
    transform: scale(1.03);
}

.theme-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.theme-swatch {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.swatch-calm {
    background: linear-gradient(135deg, #f4f9f4 50%, #4a7c59 50%);
}

.swatch-dark {
    background: linear-gradient(135deg, #1a1e1a 50%, #6aaa78 50%);
}

.swatch-light {
    background: linear-gradient(135deg, #fdf8f0 50%, #c4843a 50%);
}

.swatch-dyslexia {
    background: linear-gradient(135deg, #fef9e7 50%, #2c6ea6 50%);
}

.swatch-high-contrast {
    background: linear-gradient(135deg, #0a0a0a 50%, #ffd700 50%);
}

.swatch-colour-blind {
    background: linear-gradient(135deg, #f5f5f0 50%, #0072b2 50%);
}

/* ── Revise options page ── */
.revise-empty {
    margin: 2rem 0;
}

.revise-options-grid {
    display: grid;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.mode-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.mode-card:hover:not(.disabled) {
    border-color: var(--primary);
}

.mode-card.selected {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.mode-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mode-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
    font-size: 1.15rem;
}

.mode-card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.card-note {
    font-size: 0.85rem !important;
    font-style: italic;
    margin-top: 0.3rem !important;
}

.source-options {
    display: flex;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.source-btn {
    flex: 1;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 48px;
}

.source-btn:hover {
    border-color: var(--primary);
}

.source-btn.selected {
    border-color: var(--primary);
    background: var(--selected-bg);
    color: var(--primary-dark);
}

.source-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.start-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 48px;
}

.start-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

a.start-btn {
    text-decoration: none;
}

.choose-words-action {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ── Revise practice page ── */
#revise-controls {
    margin-top: 2rem;
}

.revise-back {
    margin-top: 1.5rem;
}

.see-words-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.chosen-words-summary {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.chosen-words-limit-note {
    margin: 0 0 1.25rem 0;
    font-size: 0.88rem;
}

.chosen-words-edit-link {
    margin: 0 0 1.25rem 0;
}

.chosen-words-edit-link a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.chosen-words-edit-link a:hover {
    color: var(--primary-dark);
}

.recent-words-btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.recent-words-btn:hover {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.recent-word-entry {
    padding: 1.1rem 0;
    border-bottom: 1.5px dashed var(--border);
}

.recent-word-entry:last-child {
    border-bottom: none;
}

.recent-word-name {
    margin: 0 0 0.35rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.recent-word-link {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
}

.recent-word-link:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}

.recent-word-def {
    margin: 0;
    font-size: 0.97rem;
    color: var(--text);
    line-height: 1.5;
}

.recent-word-sentence {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.4;
}

.recent-word-reference {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.revise-back a {
    color: var(--accent);
    text-decoration: none;
}

.revise-back a:hover {
    color: var(--primary-dark);
}

.revise-source-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.revise-source-note a {
    color: var(--accent);
    text-decoration: none;
}

/* ── Flip card ── */
.flip-card {
    perspective: 800px;
    width: 100%;
    height: 320px;
    margin: 1.5rem 0;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.flip-card-inner.flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 2px solid var(--border);
    overflow-y: auto;
}

.flip-card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

.flip-word {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.flip-hint {
    margin-top: 0.8rem;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--input-placeholder);
}

.flip-card-back {
    background: var(--etymology-bg);
    transform: rotateY(180deg);
    padding: 1.5rem;
}

.flip-back-word {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
    text-transform: capitalize;
}

.flip-card-back .pos-label {
    margin-bottom: 0.4rem;
}

.flip-card-back .def-list {
    margin-bottom: 0.8rem;
}

/* ── Multiple choice (Easy / Nearest Neighbours) ── */
.revise-prompt {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.revise-definition {
    font-size: 1.15rem;
    margin: 0.5rem 0 0;
}

.revise-prompt.correct-prompt {
    border-color: var(--correct);
    background: var(--correct-bg);
    transition: background 0.3s, border-color 0.3s;
}

.revise-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.revise-option-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: left;
    color: var(--text);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 48px;
}

.revise-option-btn:hover:not(:disabled) {
    border-color: var(--primary);
}

.revise-option-btn.selected {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.revise-option-btn.correct {
    border-color: var(--correct);
    background: var(--correct-bg);
    color: var(--correct);
}

.revise-option-btn.incorrect {
    border-color: var(--error);
    background: var(--error-bg);
    color: var(--error);
}

.revise-option-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.check-btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.8rem 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 48px;
}

.check-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Spell It mode ── */
.spell-input-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.spell-input {
    flex: 1;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s;
}

.spell-input:focus {
    border-color: var(--primary);
    outline: none;
}

.spell-input.spell-correct {
    border-color: var(--correct);
    background: var(--correct-bg);
}

.spell-input.spell-incorrect {
    border-color: var(--error);
    background: var(--error-bg);
}

.spell-feedback {
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.correct-feedback {
    color: var(--correct);
    background: var(--correct-bg);
}

/* ── Clue buttons ── */
.clue-section {
    margin-top: 1rem;
}

.clue-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.clue-content {
    margin-top: 0.5rem;
}

.clue-btn {
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 44px;
}

.clue-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.clue-btn.clue-used {
    opacity: 0.5;
    cursor: default;
}

.clue-btn.clue-coming-soon {
    opacity: 0.4;
    cursor: not-allowed;
}

.clue-hint {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--accent);
}

.sentence-clue {
    margin-top: 0.8rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
}

.sentence-blank {
    display: inline-block;
    width: 5em;
    height: 1.4em;
    background: var(--border);
    border-radius: 4px;
    vertical-align: middle;
}

/* ── Sentence button on results page ── */
.sentence-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    margin-bottom: 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 44px;
}

.sentence-display {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 0.8rem;
}

.sentence-ref {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.sentence-display strong {
    color: var(--text);
    font-style: normal;
}

.sentence-btn:hover {
    border-color: var(--primary);
    background: var(--selected-bg);
}

/* ── Sentence page ── */
.photo-upload-section {
    margin-bottom: 1rem;
}

.photo-upload-btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    background: var(--selected-bg);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

.photo-upload-btn:hover {
    background: var(--border);
}

.photo-preview {
    display: block;
    max-width: 100%;
    max-height: 200px;
    margin-top: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: contain;
}

.photo-status {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.sentence-input {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.6;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    resize: vertical;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.sentence-input:focus {
    border-color: var(--primary);
    outline: none;
}

.sentence-confirmation {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ── Reference field ── */
.reference-field {
    margin-bottom: 1rem;
}

.reference-field label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.reference-wrapper {
    position: relative;
}

.reference-input {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s;
}

.reference-input:focus {
    border-color: var(--primary);
    outline: none;
}

.reference-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0.3rem 0;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.reference-suggestions li {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
}

.reference-suggestions li:hover {
    background: var(--selected-bg);
}

/* ── Reference clue display ── */
.reference-clue {
    margin-top: 0.8rem;
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
}

/* ── Stats page ── */
.words-total-count {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.words-total-count .word-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.stats-instruction {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}
.stats-word-list {
    padding: 0.3rem 0;
}

.stats-word-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.2rem;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
}

.stats-word-row:hover {
    background: var(--selected-bg);
}

.stats-word-row input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary);
    cursor: pointer;
}

.stats-word-name {
    font-weight: 700;
    font-size: 1.05rem;
    flex: 1;
}

.stats-revision-count {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.stats-word-sentence {
    margin: 0 0 0.5rem 2rem;
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.4;
}

.stats-browse-btns {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.source-default-note {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.choose-words-link {
    font-size: 0.95rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
}

.choose-words-link a {
    color: var(--accent);
    text-decoration: none;
}

.choose-words-link a:hover {
    color: var(--primary-dark);
}

/* ── About page ── */
.about-content p {
    margin-bottom: 1rem;
}

.about-list {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.about-list li {
    margin-bottom: 0.4rem;
}

.about-tagline {
    font-weight: 700;
    font-style: italic;
    color: var(--primary);
}

.back-link {
    color: var(--accent);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary-dark);
}

/* ── Manage words page ── */
.settings-action-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 48px;
}

.settings-action-btn:hover {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.danger-btn {
    color: #c0392b;
    border-color: #e0b0ad;
}

.danger-btn:hover {
    border-color: #c0392b;
    background: #fdf2f2;
}

.danger-action {
    margin-bottom: 1.5rem;
}

.danger-confirm {
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e0b0ad;
    border-radius: 8px;
    background: #fdf2f2;
    max-width: 540px;
}

.danger-warning {
    margin: 0 0 0.9rem 0;
    font-size: 0.95rem;
    color: #7a2a22;
    line-height: 1.5;
}

.danger-confirm-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.danger-confirm-btn {
    padding: 0.55rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: #c0392b;
    border: 2px solid #c0392b;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 40px;
}

.danger-confirm-btn:hover:not(:disabled) {
    background: #a93226;
    border-color: #a93226;
}

.danger-confirm-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.danger-cancel-btn {
    padding: 0.55rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #7a2a22;
    background: transparent;
    border: 2px solid #e0b0ad;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 40px;
}

.danger-cancel-btn:hover {
    border-color: #c0392b;
}

.settings-section-note {
    margin: 0 0 0.9rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.settings-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1rem;
    cursor: pointer;
}

.settings-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.manage-group {
    margin-bottom: 0.5rem;
}

.group-toggle-btn {
    display: block;
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.group-toggle-btn:hover {
    background: var(--selected-bg);
}

.group-toggle-btn.open {
    border-radius: 8px 8px 0 0;
    border-bottom-color: transparent;
}

.group-words {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem 0;
    background: var(--bg-card);
    margin-bottom: 0.5rem;
}

.word-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s;
}

.word-checkbox:hover {
    background: var(--selected-bg);
}

.word-checkbox input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary);
    cursor: pointer;
}

.remove-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--error);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
}

.remove-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cancel-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 44px;
}

.cancel-btn:hover {
    border-color: var(--primary);
}

.manage-warning {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: 8px;
}

.manage-warning p {
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--error);
}

.warning-actions {
    display: flex;
    gap: 0.75rem;
}

.incorrect-feedback {
    color: var(--error);
    background: var(--error-bg);
}

.close-feedback {
    color: var(--warning);
    background: var(--warning-bg);
}

.soft-spell-comparison {
    margin-top: 0.75rem;
    font-size: 0.97rem;
    font-weight: 400;
}

.soft-spell-typed {
    margin: 0 0 0.3rem 0;
    color: var(--muted);
}

.soft-spell-correct {
    margin: 0;
}

.diff-char {
    background: var(--warning);
    color: var(--warning-bg);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

.spell-soft-close {
    border-color: var(--warning);
    background: var(--warning-bg);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    body {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .history-list li {
        flex-direction: column;
        gap: 0.2rem;
    }

    .history-meta {
        text-align: left;
        margin-left: 0;
    }

    .source-options {
        flex-direction: column;
    }

    .flip-card {
        height: 280px;
    }

    .flip-word {
        font-size: 1.8rem;
    }

    .spell-input-row {
        flex-direction: column;
    }

    .theme-options {
        flex-direction: column;
    }

    .home-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .home-circle-btn {
        width: 56px;
        height: 56px;
        font-size: 0.75rem;
    }

    .clue-buttons {
        flex-wrap: wrap;
    }

    .clue-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .freq-key {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .flip-card {
        height: 300px;
    }

    .flip-card-back {
        padding: 1rem;
    }

    .warning-actions {
        flex-direction: column;
    }

    .revise-options-grid .mode-card h3 {
        font-size: 1rem;
    }

    .stats-browse-btns {
        flex-direction: column;
    }

    .nav-dropdown {
        min-width: 140px;
    }
}

/* ── Desktop device frame ── */
@media (min-width: 1024px) {
    .nav {
        border-radius: 20px 20px 0 0;
    }

    html {
        min-height: 100vh;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 8px 2rem 2rem;
        /* outer canvas: follows OS light/dark preference, not the app theme */
        background: #c8d4c8;
    }

    body {
        width: 100%;
        max-width: 900px;
        min-height: 640px;
        border-radius: 20px;
        overflow-x: hidden;
        box-shadow: 0 20px 60px rgba(0,0,0,0.28), 0 4px 12px rgba(0,0,0,0.14);
        /* contain fixed-position children (e.g. Recall button) inside the frame */
        transform: translateZ(0);
        flex-shrink: 0;
    }
}

@media (min-width: 1024px) and (prefers-color-scheme: dark) {
    html {
        background: #161c16;
    }
}

/* ── Word-count colour tiers ── */
.word-count-none { color: var(--muted); }
.word-count-sm   { color: var(--wc-sm); }
.word-count-md   { color: var(--wc-md); }
.word-count-lg   { color: var(--wc-lg); }
.word-count-xl   { color: var(--wc-xl); }
.word-count-xxl  { color: var(--wc-xxl); }
.word-count-max  { color: var(--wc-max); }

/* ── Books listing page ── */
.books-summary {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.books-summary-count {
    font-size: 1.4rem;
    font-weight: 700;
}

#books-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.book-btn {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.book-btn:hover {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.book-btn-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.book-btn-count {
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.add-book-section {
    margin-bottom: 2rem;
}

.book-list-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.book-list-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ── Color key ── */
.books-color-key {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.color-key-label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.color-key-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.2rem;
    font-size: 0.9rem;
}

/* ── Individual book page ── */
.book-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.book-header h1 {
    margin-top: 0.3rem;
    margin-bottom: 0.2rem;
}

.book-meta {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.book-word-count {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.book-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.book-status-label {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.book-status-select {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    width: auto;
}

.book-status-saved {
    font-size: 0.85rem;
    color: var(--primary);
    transition: opacity 0.3s;
}
