/* Acknowledgement cards remain indivisible when the book paginates. */
.glossary-page .acknowledgement-source {
    display: flex; align-items: center; gap: 12px; min-height: 70px;
    margin: 0 0 10px; padding: 12px 14px; border: 1px solid #cbdedb;
    border-radius: 12px; background: linear-gradient(110deg, #f0fdfa, #fff 65%);
    color: #134e4a; text-decoration: none; break-inside: avoid;
    transition: border-color .18s, background .18s;
}
.glossary-page .acknowledgement-source:hover { border-color: #0f766e; background: #ecfdf5; }
.glossary-page .acknowledgement-source:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
.acknowledgement-number { flex: 0 0 28px; color: #0f766e; font-size: 18px; font-weight: 700; }
.acknowledgement-detail { display: grid; gap: 3px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.acknowledgement-detail strong { color: #0b1b3f; font-size: 15px; line-height: 1.4; }
.acknowledgement-url { color: #475569; font-size: 12px; line-height: 1.4; }
.acknowledgement-source > i { flex: 0 0 14px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .glossary-page .acknowledgement-source { transition: none; } }

/* Glossary book — scoped to the glossary page; the site header and footer keep their layout.
   Each .glossary-section sets --tone (inline) and every accent derives from it. */
.glossary-page {
    --ink: #0b1b3f;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e4e9f1;
    --surface: #f3f6fb;
    --primary: #1d4ed8;
    --primary-2: #0ea5e9;
    --tone: var(--primary);
    --tone-soft: color-mix(in srgb, var(--tone) 9%, #fff);
    --tone-line: color-mix(in srgb, var(--tone) 22%, #fff);
    --radius: 16px;
    background:
        linear-gradient(180deg, #ffffff55 0%, #ffffff22 65%, #ffffff44 100%),
        url('/images/glossary-book/weather-seasons-background.png') center bottom / cover no-repeat;
    padding: 36px 0 104px;
    /* The centred back cover pushes the spread's empty half past the viewport edge. */
    overflow-x: hidden;
    overflow-x: clip;
}
.glossary-page [hidden] { display: none !important; }
.glossary-section, .book-leaf-inner, .book-search-results button, .book-contents nav button {
    --tone-soft: color-mix(in srgb, var(--tone) 9%, #fff);
    --tone-line: color-mix(in srgb, var(--tone) 22%, #fff);
}

/* ── Command bar: search + chapter picker + suggestion button ─────────────── */
.glossary-commandbar {
    position: relative;
    z-index: 20;
    display: flex;
    gap: 8px;
    max-width: 1100px;
    margin: 0 auto 32px;
    padding: 8px;
    background: #ffffffe6;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 1px 2px #0b1b3f0a, 0 18px 40px -20px #0b1b3f40;
}
.gcb-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.gcb-search > i {
    position: absolute; left: 18px;
    color: var(--muted); font-size: 16px; pointer-events: none;
}
.gcb-search input {
    width: 100%; height: 52px;
    padding: 0 150px 0 48px;
    border: 1.5px solid transparent; border-radius: 14px;
    background: var(--surface);
    color: var(--ink); font-size: 16px;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.gcb-search input::placeholder { color: #8a97ab; }
.gcb-search input:placeholder-shown { padding-right: 16px; text-overflow: ellipsis; }
.gcb-search input:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px #1d4ed81f; }
.gcb-search input::-webkit-search-cancel-button { cursor: pointer; }
#searchResult {
    position: absolute; right: 12px;
    padding: 5px 12px; border-radius: 999px;
    background: #1d4ed814; color: var(--primary);
    font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
#searchResult:empty { display: none; }

.book-search-results {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    max-height: min(420px, 60vh); overflow: auto; overscroll-behavior: contain;
    display: grid; gap: 2px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 30px 60px -20px #0b1b3f55;
    scrollbar-width: thin;
}
.book-search-results button {
    display: grid; gap: 4px; justify-items: start;
    padding: 10px 12px; border: 0; border-radius: 10px;
    background: transparent; text-align: left; cursor: pointer;
}
.book-search-results button:hover, .book-search-results button:focus-visible { background: var(--tone-soft); }
.result-chapter {
    padding: 2px 10px; border-radius: 999px;
    background: var(--tone-soft); color: var(--tone);
    font-size: 12px; font-weight: 600;
}
.result-term { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.4; }
.result-text {
    color: var(--ink-2); font-size: 14px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.book-toolbar { display: flex; gap: 8px; }
.book-select { position: relative; display: flex; align-items: center; }
.book-select > i { position: absolute; left: 16px; color: var(--muted); pointer-events: none; font-size: 14px; }
.book-select .book-select-caret { left: auto; right: 16px; font-size: 11px; }
.book-select select {
    appearance: none;
    width: 290px; max-width: 100%; height: 52px;
    padding: 0 40px 0 42px;
    border: 1.5px solid transparent; border-radius: 14px;
    background: var(--surface); color: var(--ink);
    font-size: 15px; font-weight: 500; text-overflow: ellipsis; cursor: pointer;
}
.book-select select:hover { background: #eaf0f8; }
.book-chapter-picker {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
    width: 290px; max-width: 100%; height: 52px; padding: 0 40px 0 42px;
    border: 0; border-radius: 14px; background: var(--surface); color: var(--ink);
    text-align: left; font-size: 15px; font-weight: 500; cursor: pointer;
}
.book-chapter-picker > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-range { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.book-chapter-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
    width: min(430px, calc(100vw - 40px)); max-height: min(480px, 60vh); overflow-y: auto; overscroll-behavior: contain;
    padding: 6px; border: 1px solid var(--line); border-radius: 14px;
    background: #fff; box-shadow: 0 20px 45px #0b1b3f33;
}
.book-chapter-menu button {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px;
    width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px;
    background: transparent; color: var(--ink); text-align: left; font-size: 15px; cursor: pointer;
}
.book-chapter-menu button:hover, .book-chapter-menu button[aria-current="true"] { background: #eaf0f8; }
.book-chapter-picker:focus-visible, .book-chapter-menu button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.book-chapter-picker:disabled { cursor: default; opacity: .65; }
@media (max-width: 767px) {
    .book-chapter-picker { width: 100%; height: 48px; font-size: 14px; gap: 8px; }
    .book-chapter-menu { right: auto; left: 0; }
}

/* ── Reader bar ─────────────────────────────────────────────────────── */
.book-navigation {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    width: fit-content; margin: 32px auto 0; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 16px 36px -18px #0b1b3f40;
}
.book-nav-btn {
    display: grid; place-items: center;
    width: 48px; height: 48px; border: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff; font-size: 16px; cursor: pointer;
    box-shadow: 0 6px 16px -6px #1d4ed8aa;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.book-nav-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -8px #1d4ed8cc; }
.book-nav-btn:disabled { background: var(--surface); color: #a3afc0; box-shadow: none; cursor: default; }
.book-meter { display: grid; gap: 8px; min-width: 190px; padding: 0 6px; text-align: center; }
#bookStatus { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.book-progress { display: block; height: 4px; border-radius: 999px; background: #e6ecf5; overflow: hidden; }
.book-progress > span {
    display: block; height: 100%; width: 0; border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transition: width .5s ease;
}
.book-hint { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.book-hint i { margin-right: 6px; opacity: .7; }
.book-hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
    .book-hint-mouse { display: none; }
    .book-hint-touch { display: inline; }
}

/* ── Chapter chrome (shared by the book and the list view) ──────────── */
.glossary-page .glossary-section {
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 1px 2px #0b1b3f0a, 0 20px 40px -28px #0b1b3f40;
}
.glossary-page .section-card-header {
    display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px;
    padding: 24px 28px 20px;
    background: radial-gradient(420px 160px at 100% 0%, var(--tone-soft), transparent 70%), #fff;
    border-bottom: 1px solid var(--line);
}
.glossary-page .section-icon {
    width: 52px; height: 52px; border-radius: 16px;
    background: var(--tone-soft); color: var(--tone);
    border: 1px solid var(--tone-line);
    box-shadow: none; font-size: 20px;
}
.glossary-page .section-card-header h2 {
    grid-column: 2;
    font-family: "Poppins", sans-serif; font-weight: 600;
    font-size: 1.35rem; line-height: 1.35; color: var(--ink); letter-spacing: -.01em;
}
.glossary-page .section-card-header h2 small { display: block; margin-top: 2px; color: var(--muted); }

.glossary-page .sub-heading {
    display: flex; align-items: center; gap: 10px;
    margin: 32px 0 12px; padding: 0;
    background: none; border: 0; border-radius: 0;
    color: var(--ink); font-size: 1rem; font-weight: 600;
}
.glossary-page .sub-heading::before {
    content: ''; width: 18px; height: 3px; border-radius: 3px; background: var(--tone); flex-shrink: 0;
}
.glossary-page .sub-heading:first-child { margin-top: 0; }

.glossary-page .glossary-table th {
    background: transparent; color: var(--muted);
    font-size: 12px; font-weight: 600; letter-spacing: .08em;
    padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.glossary-page .glossary-table td { padding: 13px 14px; border-bottom: 1px solid #eef1f6; color: var(--ink-2); }
.glossary-page .glossary-table tbody tr:hover td { background: var(--tone-soft); }
.glossary-page .glossary-table .term-col { color: var(--ink); font-weight: 600; }
.glossary-page .tod-table td:not(:first-child) {
    background: transparent; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: .95rem; color: var(--ink);
}

/* Justify running text (definitions and guide paragraphs); terms, headings and labels stay left.
   Hyphenation keeps narrow book columns from opening wide gaps between words. */
.glossary-page .glossary-table td:not(:first-child),
.glossary-page .book-contents p,
.glossary-page .book-cover-tagline {
    text-align: justify; text-justify: inter-word;
    -webkit-hyphens: auto; hyphens: auto;
}

.glossary-page tr.zone-nw { --z: #a855f7; } .glossary-page tr.zone-nc { --z: #6366f1; } .glossary-page tr.zone-ne { --z: #22c55e; }
.glossary-page tr.zone-sc { --z: #eab308; } .glossary-page tr.zone-sw { --z: #f59e0b; } .glossary-page tr.zone-se { --z: #f43f5e; }
@media (min-width: 641px) {
    .glossary-page .glossary-table tr[class^="zone-"] td { background: transparent; }
    .glossary-page .glossary-table tr[class^="zone-"]:hover td { background: var(--tone-soft); }
    .glossary-page tr[class^="zone-"] td:first-child { position: relative; padding-left: 32px; color: var(--ink); }
    #glossaryBook.is-book tr[class^="zone-"] td:first-child { padding-left: 32px; }
    .glossary-page tr[class^="zone-"] td:first-child::before {
        content: ''; position: absolute; left: 10px; top: 20px;
        width: 10px; height: 10px; border-radius: 50%; background: var(--z);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--z) 20%, #fff);
    }
}
.glossary-page .glossary-map { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }

.glossary-page .season-card {
    --s: #2563eb;
    flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 6px;
    padding: 16px 18px; border-radius: 16px;
    background: color-mix(in srgb, var(--s) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--s) 20%, #fff);
}
.glossary-page .season-card.winter { --s: #2563eb; }
.glossary-page .season-card.premonsoon { --s: #d97706; }
.glossary-page .season-card.sw-monsoon { --s: #059669; }
.glossary-page .season-card.ne-monsoon { --s: #ea580c; }
.glossary-page .season-card .season-icon {
    display: grid; place-items: center; flex-shrink: 0;
    width: 44px; height: 44px; margin: 0; border-radius: 14px;
    background: var(--s); color: #fff; font-size: 18px;
    box-shadow: 0 8px 16px -8px var(--s);
}
.glossary-page .season-card .season-name { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; }
.glossary-page .season-card .season-period {
    margin-left: 58px; background: #fff; color: var(--s);
    border: 1px solid color-mix(in srgb, var(--s) 25%, #fff);
}

.glossary-page .rain-pill {
    --r: #94a3b8;
    display: inline-flex; align-items: baseline; gap: 10px;
    padding: 0; border-radius: 0; background: none;
    color: var(--ink); font-weight: 600;
}
.glossary-page .rain-pill::before {
    content: ''; flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
    background: var(--r); box-shadow: 0 0 0 4px color-mix(in srgb, var(--r) 20%, #fff);
}
.glossary-page .rain-vlight { --r: #38bdf8; }
.glossary-page .rain-light { --r: #22c55e; }
.glossary-page .rain-mod { --r: #eab308; }
.glossary-page .rain-heavy { --r: #f97316; }
.glossary-page .rain-vheavy { --r: #ef4444; }
.glossary-page .rain-extreme { --r: #b91c1c; }
.glossary-page .rain-excep { --r: #9333ea; }

.glossary-page .search-match,
#glossaryBook.is-book .search-match { background: #fff6d6 !important; box-shadow: inset 3px 0 0 var(--tone); outline: 0; }
.glossary-page .search-match td { background: transparent !important; }

/* ── The book ───────────────────────────────────────────────────────── */
#glossaryBook.is-book {
    position: relative; margin: 0 auto;
    width: var(--book-frame-width, auto) !important;
    min-height: var(--book-page-height, 684px) !important;
    filter: drop-shadow(0 34px 38px #0b1b3f2e) drop-shadow(0 6px 10px #0b1b3f14);
}
#glossaryBook .stf__parent { margin: auto; }
#glossaryBook.is-book .stf__wrapper {
    height: var(--book-page-height, 684px);
    padding-bottom: 0 !important;
}
/* The browser scrolls vertically; horizontal drags reach PageFlip and turn the page. */
#glossaryBook.is-book { touch-action: pan-y pinch-zoom; }
/* The closed front/back cover occupies one half of the spread, so centre it (see render()). */
#glossaryBook.is-book { transition: transform .85s cubic-bezier(.45, 0, .2, 1); }
#glossaryBook.is-book.is-closed-front { transform: translateX(-25%); }
#glossaryBook.is-book.is-closed-back { transform: translateX(25%); }
#glossaryBook .stf__block { isolation: isolate; }
/* Share PageFlip's stacking context: resting leaves are at 1, the revealed leaf
   at 3, and the clipped turning leaf at 5. Only overlapping paper covers the wire. */
#glossaryBook.is-book .stf__block::after {
    content: '';
    position: absolute;
    z-index: 4;
    top: 18px;
    bottom: 18px;
    left: 50%;
    width: 48px;
    transform: translateX(-50%);
    background:
        url('/images/glossary-book/spiral-binding.svg') center top / 48px 32px repeat-y,
        linear-gradient(90deg, transparent 35%, #33415526 48%, #0f172a40 50%, #33415526 52%, transparent 65%);
    pointer-events: none;
    visibility: hidden;
}
#glossaryBook.is-book.is-spiral-open .stf__block::after { visibility: visible; }
#glossaryBook.is-book.is-portrait .stf__block::after {
    left: 0;
    width: 32px;
    transform: none;
    background-size: 32px 32px, auto;
}
#glossaryBook.is-book.is-portrait .book-leaf:not(.book-cover) .book-leaf-inner { margin-left: 18px; }
#glossaryBook.is-book .book-leaf {
    height: 100%; min-width: 0; margin: 0;
    border: 1px solid var(--line); border-radius: 0; box-shadow: none;
    background: #fff; color: var(--ink-2);
    overflow: hidden;
}
/* Soft gutter shading toward the spine. */
#glossaryBook.is-book .book-leaf.--left { border-radius: 14px 0 0 14px; background: linear-gradient(270deg, #0b1b3f14, #0b1b3f00 36px), #fff; }
#glossaryBook.is-book .book-leaf.--right { border-radius: 0 14px 14px 0; background: linear-gradient(90deg, #0b1b3f14, #0b1b3f00 36px), #fff; }
#glossaryBook.is-book .book-leaf-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#glossaryBook.is-book .section-card-header { flex-shrink: 0; background: radial-gradient(360px 150px at 100% 0%, var(--tone-soft), transparent 75%); padding: 30px 30px 20px; }
#glossaryBook.is-book .section-card-header h2 { font-size: 22px; }
#glossaryBook.is-book .section-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 19px; }
#glossaryBook.is-book .section-body {
    flex: 1; min-height: 0; overflow: hidden;
    padding: 20px 30px 40px;
    scrollbar-width: thin; scrollbar-color: var(--tone-line) transparent;

    touch-action: pan-y;
}
#glossaryBook.is-book .glossary-table { font-size: 15px; line-height: 1.6; }
#glossaryBook.is-book .glossary-table td { padding: 12px 10px; overflow-wrap: anywhere; }
#glossaryBook.is-book .glossary-table th { padding: 8px 10px; }
#glossaryBook.is-book .seasons-grid { grid-template-columns: 1fr; }

/* Lightning figures remain compact, including inside the measured book leaves. */
.lightning-figure { margin: 16px 0; }
.lightning-points { padding-left: 22px; margin: 12px 0 18px; font-size: 15px; line-height: 1.6; }
.lightning-points li { margin-bottom: 8px; font-size: inherit; line-height: inherit; }
.lightning-section .section-body > p:not(.sub-heading):not(.lightning-image-note) { font-size: .95rem; line-height: 1.6; }
#glossaryBook.is-book .lightning-section .section-body > p:not(.sub-heading):not(.lightning-image-note) { font-size: 15px; }
.lightning-figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 10px; background: #101b35; }
.lightning-figure figcaption, .lightning-image-note { margin: 7px 0 0; color: #64748b; font-size: 12px; line-height: 1.5; }
.lightning-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.lightning-gallery .lightning-figure { margin: 0; }
.lightning-gallery figcaption { font-weight: 600; color: #263654; }
#glossaryBook.is-book .lightning-figure > img { max-height: 270px; }
#glossaryBook.is-book .lightning-gallery img { max-height: 135px; }
#glossaryBook.is-book .lightning-table .term-col { min-width: 0; width: 36%; }
#glossaryBook.is-book .symbols-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.book-page-number {
    flex-shrink: 0; margin-top: auto;
    padding: 10px 30px 14px;
    color: #94a3b8; font-size: 12px; font-weight: 500; letter-spacing: .04em;
}
#glossaryBook .book-leaf.--left .book-page-number { text-align: right; }
#glossaryBook .book-leaf.--right .book-page-number { text-align: right; }

/* Cover */
#glossaryBook.is-book .book-leaf.book-cover {
    border: 0; color: #fff;
    background:
        linear-gradient(180deg, #06122ef2 0%, #06122e8c 38%, #06122e1a 58%, #06122ecc 100%),
        url('/images/glossary-book/weather-cover.webp') center / cover;
}
#glossaryBook.is-book .book-cover.--right { border-radius: 4px 16px 16px 4px; box-shadow: inset 18px 0 22px -14px #000c, inset 3px 0 0 #ffffff1f; }
#glossaryBook.is-book .book-cover.--left { border-radius: 16px 4px 4px 16px; box-shadow: inset -18px 0 22px -14px #000c; }
#glossaryBook.is-book .book-cover .book-leaf-inner { padding: 44px 40px 40px; justify-content: flex-start; align-items: stretch; }
#glossaryBook.is-book .book-cover .book-page-number { display: none; }
.book-cover-label {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: #ffffff1f; border: 1px solid #ffffff33; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #dbeafe; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}
#glossaryBook .book-cover h2 {
    margin: 40px 0 0;
    font: 700 clamp(40px, 4.2vw, 58px) / 1.08 "Poppins", sans-serif;
    letter-spacing: -.02em; color: #fff;
}
.book-cover-tagline { max-width: 340px; margin: 18px 0 0; color: #cbd8ee; font-size: 16px; line-height: 1.65; }
.book-cover-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; container-type: inline-size; }
.book-cover-meta {
    flex: 1 1 200px;
    color: #fff3d6;
    font-family: Georgia, "Nirmala UI", "Times New Roman", serif;
    font-size: clamp(11px, 3.6cqw, 20px);
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    text-shadow: 0 2px 6px #0008;
}
.book-cover-meta span + span { padding-left: 20px; border-left: 1px solid #ffffff40; }
.book-cover-meta strong { color: #fff; font-weight: 700; }
.book-cover button {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 12px;
    min-height: 52px; padding: 0 12px 0 24px;
    border: 0; border-radius: 999px;
    background: #fff; color: var(--ink);
    font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 14px 30px -10px #000a;
    transition: transform .2s, box-shadow .2s;
}
.book-cover button i {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 13px;
    transition: transform .2s;
}
.book-cover button:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px #000c; }
.book-cover button:hover i { transform: translateX(3px); }

/* Contents page */
#glossaryBook.is-book .book-contents { overflow: hidden; }
#glossaryBook.is-book .book-contents .book-leaf-inner { padding: 34px 30px 0; }
.book-contents h2 { margin: 0; font: 600 28px / 1.3 "Poppins", sans-serif; color: var(--ink); letter-spacing: -.01em; }
.book-contents p { margin: 8px 0 18px; font-size: 14px; color: var(--muted); }
#glossaryBook.is-book .book-contents nav {
    flex: 1; min-height: 0; overflow: hidden; margin: 0 -10px; padding: 0 10px 24px;

}
.book-contents nav { display: grid; gap: 2px; align-content: start; grid-auto-rows: max-content; }
.book-contents nav button {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
    min-height: 46px; padding: 6px 10px; border: 0; border-radius: 12px;
    background: transparent; color: var(--ink); text-align: left; font-size: 15px; font-weight: 500; cursor: pointer;
    transition: background .15s;
}
.book-contents nav button:hover { background: var(--tone-soft); }
.toc-num {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--tone-soft); color: var(--tone); font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.toc-page { color: #94a3b8; font-size: 12px; font-variant-numeric: tabular-nums; }
.toc-title { overflow-wrap: anywhere; }
.book-contents nav button:hover .toc-page { color: var(--tone); }

#glossaryBook:focus-visible, .glossary-page button:focus-visible, .glossary-page select:focus-visible {
    outline: 3px solid #1d4ed880; outline-offset: 3px;
}

/* ── List view (also the print layout) ──────────────────────────────── */
.book-source { max-width: 1100px; margin: 0 auto; }
.book-source [hidden] { display: none !important; }
.book-source .book-page-number { display: none; }


@media (max-width: 767px) {
    .glossary-page { padding: 20px 0 72px; }
    .glossary-commandbar { flex-direction: column; margin-bottom: 20px; padding: 6px; border-radius: 18px; }
    .gcb-search input { height: 48px; padding-right: 120px; font-size: 15px; }
    .book-select { flex: 1; min-width: 0; }
    .book-select select { width: 100%; height: 48px; font-size: 14px; }
    .glossary-page .section-card-header { padding: 18px 18px 16px; column-gap: 12px; }
    #glossaryBook.is-book .section-card-header { padding: 22px 18px 16px; }
    #glossaryBook.is-book .section-card-header h2 { font-size: 19px; }
    #glossaryBook.is-book .section-icon { width: 42px; height: 42px; font-size: 17px; }
    #glossaryBook.is-book .section-body { padding: 16px 16px 36px; }
    #glossaryBook.is-book .glossary-table { font-size: 15px; }
    #glossaryBook.is-book .book-cover .book-leaf-inner { padding: 30px 24px 28px; }
    #glossaryBook .book-cover h2 { margin-top: 28px; font-size: 38px; }
    #glossaryBook.is-book .book-contents .book-leaf-inner { padding: 26px 18px 0; }
    .book-page-number { padding: 8px 18px 12px; }
    .book-navigation { width: 100%; justify-content: space-between; margin-top: 22px; }
    .book-meter { flex: 1; min-width: 0; }
}

@media (max-width: 640px) {
    /* Refines the table → card conversion in the page's inline styles. */
    .glossary-page table.glossary-table tr { border: 1px solid var(--line); border-radius: 14px; }
    .glossary-page table.glossary-table td:first-child { color: var(--ink); border-bottom-color: var(--line) !important; }
    .glossary-page .season-card .season-period { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #glossaryBook.is-book, .book-progress > span, .book-nav-btn, .book-cover button, .book-cover button i { transition: none; }
}

@media print {
    .glossary-commandbar, .book-navigation, .book-hint, #glossaryBook { display: none !important; }
    .glossary-page { background: none; }
    .book-source[hidden] { display: block !important; }
    .book-source .glossary-section { break-inside: avoid; box-shadow: none; }
    .book-source .section-body { overflow: visible; }
}

/* Tint the original warning silhouettes without changing their recognizable shapes. */
.warning-color-filters { position: absolute; overflow: hidden; pointer-events: none; }
.symbols-grid .symbol-card { background: #f0f7ff; border-color: #c9def8; border-radius: 16px; }
.symbols-grid .symbol-card img { filter: url(#warning-blue); mix-blend-mode: multiply; }
.symbols-grid .symbol-card:nth-child(2), .symbols-grid .symbol-card:nth-child(10) { background: #ecfeff; border-color: #a5e1ef; }
.symbols-grid .symbol-card:nth-child(2) img, .symbols-grid .symbol-card:nth-child(10) img { filter: url(#warning-ice); }
.symbols-grid .symbol-card:nth-child(3), .symbols-grid .symbol-card:nth-child(11) { background: #fffbeb; border-color: #f8dda3; }
.symbols-grid .symbol-card:nth-child(3) img, .symbols-grid .symbol-card:nth-child(11) img { filter: url(#warning-gold); }
.symbols-grid .symbol-card:nth-child(4) { background: #fff7ed; border-color: #eacba8; }
.symbols-grid .symbol-card:nth-child(4) img { filter: url(#warning-sand); }
.symbols-grid .symbol-card:nth-child(5), .symbols-grid .symbol-card:nth-child(12) { background: #ecfdf5; border-color: #a8e5d7; }
.symbols-grid .symbol-card:nth-child(5) img, .symbols-grid .symbol-card:nth-child(12) img { filter: url(#warning-teal); }
.symbols-grid .symbol-card:nth-child(6), .symbols-grid .symbol-card:nth-child(9) { background: #f5f3ff; border-color: #ddd1f8; }
.symbols-grid .symbol-card:nth-child(6) img, .symbols-grid .symbol-card:nth-child(9) img { filter: url(#warning-violet); }
.symbols-grid .symbol-card:nth-child(7), .symbols-grid .symbol-card:nth-child(8) { background: #fff1f2; border-color: #f5bdca; }
.symbols-grid .symbol-card:nth-child(7) img, .symbols-grid .symbol-card:nth-child(8) img { filter: url(#warning-rose); }
.symbols-grid .symbol-card .sno { color: #526777; }

.book-measuring { position: absolute !important; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
#glossaryBook.book-measuring .book-leaf { display: block; height: var(--book-page-height, 684px); }
#glossaryBook.is-book .glossary-map img { max-height: 350px; width: 100%; object-fit: contain; }

/* Keep the page mark in the header, clear of glossary entries. */
#glossaryBook.is-book .book-leaf-inner { position: relative; z-index: 2; }
/* Default scenery also covers contents and reference pages without weather terms.
   The finished leaf's inline image overrides this with its most common term theme. */
#glossaryBook.is-book .book-leaf {
    --chapter-image: url('/images/glossary-book/weather-chapters.webp');
}
#glossaryBook.is-book .book-contents,
#glossaryBook.is-book [data-chapter="seasons"],
#glossaryBook.is-book [data-chapter="phenomena"] {
    --chapter-image: url('/images/glossary-book/weather-chapters.webp');
}
#glossaryBook.is-book [data-chapter="rainfall"],
#glossaryBook.is-book [data-chapter="monsoon"] {
    --chapter-image: url('/images/weather-alert/rain.jpg');
}
#glossaryBook.is-book [data-chapter="temperature"] {
    --chapter-image: url('/images/weather-alert/heat.jpg');
}
#glossaryBook.is-book [data-chapter="winds"] {
    --chapter-image: url('/images/weather-alert/wind.jpg');
}
#glossaryBook.is-book [data-chapter="drought"] {
    --chapter-image: url('/images/glossary-book/drought-agriculture.png');
}
#glossaryBook.is-book [data-chapter="drought"][data-drought-background="2"] {
    --chapter-image: url('/images/glossary-book/drought-water-resources.png');
}
#glossaryBook.is-book [data-chapter="drought"][data-drought-background="3"] {
    --chapter-image: url('/images/glossary-book/drought-irrigation.png');
}
#glossaryBook.is-book [data-chapter="drought"][data-drought-background="4"] {
    --chapter-image: url('/images/glossary-book/drought-orchard.png');
}
#glossaryBook.is-book [data-chapter="cyclone"] {
    --chapter-image: url('/images/glossary-book/cyclone-eye.png');
}
#glossaryBook.is-book [data-chapter="cyclone"][data-cyclone-background="2"] {
    --chapter-image: url('/images/glossary-book/cyclone-coast.png');
}
#glossaryBook.is-book [data-chapter="cyclone"][data-cyclone-background="3"] {
    --chapter-image: url('/images/glossary-book/cyclone-rain.png');
}
#glossaryBook.is-book [data-chapter="cyclone"][data-cyclone-background="4"] {
    --chapter-image: url('/images/glossary-book/cyclone-surge.png');
}
#glossaryBook.is-book [data-chapter="sky"] {
    --chapter-image: url('/images/glossary-book/weather-chapters.webp');
    --chapter-position: right top;
}
#glossaryBook.is-book [data-chapter="timeofday"] {
    --chapter-image: url('/images/weather-alert/heat.jpg');
    --chapter-position: right top;
}
#glossaryBook.is-book .book-leaf:not(.book-cover)::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--chapter-image, none);
    background-size: cover;
    background-position: var(--chapter-position, center);
    opacity: .14;
    -webkit-mask-image: linear-gradient(#0003, #0006 45%, #000 90%);
    mask-image: linear-gradient(#0003, #0006 45%, #000 90%);
    pointer-events: none;
}
/* A quiet page watermark follows each leaf as it turns. */
#glossaryBook.is-book .book-leaf:not(.book-cover)::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: url('/images/bmsk-logo-full.svg') center / min(58%, 280px) auto no-repeat;
    opacity: .055;
    pointer-events: none;
}
#glossaryBook.is-book .book-page-logo {
    position: absolute; top: 22px; right: 20px;
    width: 36px; height: 36px; object-fit: contain;
}
#glossaryBook.is-book .section-card-header { padding-right: 72px; }
#glossaryBook.is-book .book-contents h2 { padding-right: 46px; }
#glossaryBook.is-book .book-cover-logo {
    position: absolute; top: 30px; right: 28px;
    width: 88px; height: 88px; object-fit: contain;
    padding: 6px; border-radius: 50%; background: #fff;
}
#glossaryBook.is-book .book-cover-label { max-width: calc(100% - 88px); }
@media (max-width: 767px) {
    #glossaryBook.is-book .book-page-logo { top: 18px; right: 14px; width: 32px; height: 32px; }
    #glossaryBook.is-book .section-card-header { padding-right: 60px; }
    #glossaryBook.is-book .book-cover-logo { top: 24px; right: 18px; width: 68px; height: 68px; }
    #glossaryBook.is-book .book-cover-label { max-width: calc(100% - 64px); }
}

.book-reading-guide {
    flex-shrink: 0; margin: 20px 0 12px; padding: 18px;
    border: 1px solid #dbe6f4; border-radius: 14px;
    background: #f3f7fc; color: var(--ink-2);
}
.book-reading-guide h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--ink); }
.book-reading-guide h3 i { margin-right: 6px; color: var(--primary); }
.book-contents .book-reading-guide p { margin: 0; font-size: 13px; line-height: 1.65; }
.book-contents .book-reading-guide p + p { margin-top: 10px; }

/* Keep the six-zone reference table together on a desktop book leaf. */
@media (min-width: 641px) {
    #glossaryBook.is-book .book-zones .glossary-table { font-size: 14px; line-height: 1.5; }
    #glossaryBook.is-book .book-zones .glossary-table td { padding: 8px 10px; }
    #glossaryBook.is-book .book-zones .glossary-table th { padding: 6px 10px; }
    #glossaryBook.is-book .book-zones tr[class^="zone-"] td:first-child::before { top: 14px; }
}

/* All five forecast definitions fit together at desktop book widths. */
@media (min-width: 641px) {
    #glossaryBook.is-book .book-forecast .glossary-table { font-size: 14px; line-height: 1.5; table-layout: fixed; }
    #glossaryBook.is-book .book-forecast .glossary-table th:first-child { width: 32% !important; }
    #glossaryBook.is-book .book-forecast .glossary-table .term-col { width: 32%; min-width: 0; }
    #glossaryBook.is-book .book-forecast .glossary-table td { padding: 8px 10px; }
    #glossaryBook.is-book .book-forecast .glossary-table th { padding: 6px 10px; }
}

/* Three complete rows of warning symbols per leaf, including 05 and 06. */
#glossaryBook.is-book .symbols-grid { gap: 12px; }
#glossaryBook.is-book .symbol-card {
    height: 150px; box-sizing: border-box; padding: 10px 12px;
    display: flex; flex-direction: column; align-items: center;
}
#glossaryBook.is-book .symbol-card .sno { margin-bottom: 6px; line-height: 16px; }
#glossaryBook.is-book .symbol-card img { width: 56px; height: 56px; flex-shrink: 0; margin-bottom: 6px; }
#glossaryBook.is-book .symbol-card .symbol-name { font-size: 14px; line-height: 1.35; }

/* Reserve exactly three rows; card height follows the available page space. */
#glossaryBook.is-book .book-symbols .section-body { display: flex; flex-direction: column; padding-bottom: 20px; }
#glossaryBook.is-book .book-symbols .symbols-grid {
    flex: 1; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
}
#glossaryBook.is-book .book-symbols .symbol-card { height: auto; min-height: 0; justify-content: center; }

/* Keep all eight rainfall intensity categories together at desktop book widths. */
@media (min-width: 641px) {
    #glossaryBook.is-book .rain-intensity-table { font-size: 14px; line-height: 1.45; table-layout: fixed; }
    #glossaryBook.is-book .rain-intensity-table th:first-child { width: 38% !important; }
    #glossaryBook.is-book .rain-intensity-table td { padding: 6px 10px; }
    #glossaryBook.is-book .rain-intensity-table th { padding: 6px 10px; }
}

/* Frost through Visibility share one complete reference page. */
@media (min-width: 768px) {
    #glossaryBook.is-book .book-phenomena-summary .glossary-table { font-size: 14px; line-height: 1.45; table-layout: fixed; }
    #glossaryBook.is-book .book-phenomena-summary .glossary-table th:first-child { width: 28% !important; }
    #glossaryBook.is-book .book-phenomena-summary .glossary-table .term-col { width: 28%; min-width: 0; }
    #glossaryBook.is-book .book-phenomena-summary .glossary-table td { padding: 8px 10px; }
    #glossaryBook.is-book .book-phenomena-summary .glossary-table th { padding: 6px 10px; }
}

/* ── Suggest button + dialog ────────────────────────────────────────── */
.suggest-open {
    display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px;
    border: 0; border-radius: 14px; white-space: nowrap; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #2563eb); color: #fff;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 6px 16px -8px #1d4ed8aa;
    transition: transform .2s, box-shadow .2s;
}
.suggest-open:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px #1d4ed8cc; }
.suggest-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.suggest-dialog {
    width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
    padding: 0; border: 0; border-radius: 20px; overflow: auto;
    background: #fff; color: var(--ink);
    box-shadow: 0 30px 70px -20px #0b1b3f66;
}
.suggest-dialog::backdrop { background: #0b1b3f8c; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.suggest-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start;
    padding: 22px 22px 16px; border-bottom: 1px solid var(--line);
}
.suggest-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--ink); }
.suggest-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.suggest-icon {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); font-size: 18px;
}
.suggest-close {
    display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.suggest-close:hover { background: #e6ecf5; }
.suggest-body { display: grid; gap: 14px; padding: 18px 22px; }
.suggest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.suggest-field { display: grid; gap: 6px; margin: 0; }
.suggest-field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.suggest-field b { color: #dc2626; font-weight: 600; }
.suggest-field input, .suggest-field select, .suggest-field textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); font-size: 15px; font-family: inherit;
}
.suggest-field textarea { resize: vertical; min-height: 110px; }
.suggest-field input:focus, .suggest-field select:focus, .suggest-field textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #1d4ed826;
}
.suggest-count { justify-self: end; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.suggest-count.is-over { color: #dc2626; }
.suggest-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.suggest-message {
    margin: 0; padding: 10px 12px; border-radius: 10px;
    background: #fef2f2; color: #b91c1c; font-size: 14px;
}
.suggest-message.is-success { background: #ecfdf5; color: #047857; }
.suggest-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px 20px; border-top: 1px solid var(--line);
}
.suggest-cancel, .suggest-submit {
    height: 44px; padding: 0 18px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.suggest-cancel { background: var(--surface); color: var(--ink-2); }
.suggest-submit { display: flex; align-items: center; gap: 8px; background: var(--primary); color: #fff; }
.suggest-submit:disabled { opacity: .65; cursor: progress; }
@media (max-width: 767px) {
    .suggest-open { height: 48px; padding: 0 14px; }
    .suggest-open-text { display: none; }
    .suggest-row { grid-template-columns: 1fr; }
    .suggest-head, .suggest-body, .suggest-foot { padding-left: 16px; padding-right: 16px; }
}
@media print { .suggest-dialog { display: none !important; } }

/* Side tools keep the reading area clear, including on small screens. */
.glossary-page > .container { position: relative; padding-left: 80px; }
.glossary-page .glossary-commandbar {
    position: absolute; left: 12px; top: 0; z-index: 30;
    flex-direction: column; gap: 8px; width: 56px;
    margin: 0; padding: 6px; border-radius: 16px;
}
.glossary-commandbar .book-toolbar { flex-direction: column; gap: 8px; }
.glossary-commandbar .book-tool {
    display: grid; place-items: center; width: 44px; height: 44px;
    padding: 0; border: 0; border-radius: 12px;
    background: var(--tool-surface, var(--surface)); color: var(--tool-color, var(--primary)); font-size: 18px;
    text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.glossary-commandbar .book-tool:hover,
.glossary-commandbar .book-tool[aria-expanded="true"] { background: var(--tool-color, var(--primary)); color: #fff; }
.glossary-commandbar .book-tool:focus-visible { outline: 3px solid var(--tool-color, var(--primary)); outline-offset: 2px; }
.book-search-tool { position: relative; }
.book-search-panel {
    position: absolute; top: 0; left: 58px; width: min(440px, calc(100vw - 100px));
    padding: 12px; border: 1px solid var(--line); border-radius: 16px;
    background: #fff; box-shadow: 0 20px 45px #0b1b3f33;
}
.book-search-panel .gcb-search input { padding-right: 16px; }
.book-search-panel #searchResult { position: static; display: block; margin-top: 10px; white-space: normal; }
.book-search-panel #searchResult:empty { display: none; }
.book-search-panel .book-search-results {
    position: static; margin-top: 10px; max-height: min(420px, 50vh);
    box-shadow: none; border: 0; padding: 0;
}
.glossary-commandbar .book-chapter-menu { top: 0; left: 58px; right: auto; width: min(430px, calc(100vw - 100px)); }
@media (max-width: 767px) {
    .glossary-page > .container { padding-left: 12px; padding-right: 12px; }
    .glossary-page .glossary-commandbar {
        position: sticky; top: 12px; left: auto; width: fit-content;
        flex-direction: row; margin: 0 auto 16px; padding: 6px;
    }
    .glossary-commandbar .book-toolbar { flex-direction: row; }
    .glossary-commandbar .book-search-tool,
    .glossary-commandbar .book-select { position: static; }
    .book-search-panel, .glossary-commandbar .book-chapter-menu {
        top: calc(100% + 8px); left: 50%; right: auto;
        transform: translateX(-50%); width: min(440px, calc(100vw - 32px));
    }
    .glossary-commandbar .book-chapter-menu { max-height: 50vh; }
    .book-search-panel .book-search-results { max-height: 40vh; }
}
@media print { .glossary-commandbar { display: none !important; } .glossary-page > .container { padding-left: 12px; } }
.glossary-commandbar .book-select { width: 44px; flex: none; }
.glossary-commandbar .book-chapter-picker { max-width: none; grid-template-columns: 1fr; gap: 0; text-align: center; }
@media (min-width: 1200px) {
    .glossary-page .glossary-commandbar { left: max(12px, calc((100% - 1100px) / 2 - 34px)); }
}

.glossary-commandbar #bookHome { --tool-color: #1d4ed8; --tool-surface: #eff6ff; }
.glossary-commandbar #bookSearchOpen { --tool-color: #047857; --tool-surface: #ecfdf5; }
.glossary-commandbar .book-chapter-picker { --tool-color: #7c3aed; --tool-surface: #f5f3ff; }
.glossary-commandbar #suggestOpen { --tool-color: #b45309; --tool-surface: #fffbeb; }
