/* ─── Reader Overlay ─────────────────────────────────────────────────── */

#abr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: rgba(18, 18, 18, 0.98);
    color: inherit;
    font-family: inherit;
}

/* ─── Toolbar ────────────────────────────────────────────────────────── */

#abr-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* controls reflow to new rows instead of clipping (WCAG 1.4.10) */
    gap: 8px;
    padding: 10px 16px;
    padding-right: 56px; /* keep content clear of the pinned Close button */
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid rgba(127, 127, 127, 0.25);
    flex-shrink: 0;
}

/* Reader Close — pinned to the overlay's top-right, always reachable */
#abr-close {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 6;
    min-width: 44px;
    min-height: 44px; /* WCAG 2.5.8 */
    background: color-mix(in srgb, var(--abr-page-bg, #000) 70%, transparent);
    border-radius: 8px;
}

#abr-overlay { position: fixed; } /* (already fixed) — anchor for the close button */

.abr-title-text {
    flex: 1;
    min-width: 0; /* allow the title to shrink so it never forces overflow */
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.abr-chapter-info {
    font-size: 0.85rem;
    color: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.abr-icon-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px; /* WCAG 2.5.8 target size */
}

.abr-icon-btn:hover {
    background: rgba(127, 127, 127, 0.18);
}

/* display:flex above overrides the UA [hidden]{display:none}, so a hidden
   icon button (e.g. the braille/print toggle, shown only for braille books)
   would otherwise stay visible on every book. Restore hiding explicitly. */
.abr-icon-btn[hidden] { display: none; }

/* ─── Content iframe ─────────────────────────────────────────────────── */

#abr-content-area {
    flex: 1;
    overflow: hidden;
    display: flex;
}

#abr-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ─── Nav Bar ────────────────────────────────────────────────────────── */

#abr-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.55);
    border-top: 1px solid rgba(127, 127, 127, 0.25);
    flex-shrink: 0;
    gap: 12px;
}

.abr-nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(127, 127, 127, 0.12);
    border: 1px solid rgba(127, 127, 127, 0.28);
    color: inherit;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 44px;
    min-height: 44px; /* WCAG 2.5.8 target size */
    transition: background 0.15s;
}

.abr-nav-btn:hover:not([disabled]) {
    background: rgba(127, 127, 127, 0.25);
}

.abr-nav-btn[disabled],
.abr-nav-btn[aria-disabled="true"] {
    opacity: 0.35;
    cursor: not-allowed;
}

.abr-chapter-label {
    font-size: 0.9rem;
    color: inherit;
}

/* ─── Rotor ("Navigate by") ──────────────────────────────────────────── */
.abr-rotor {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 0.85rem;
    color: inherit;
}
.abr-rotor-label {
    color: inherit; /* full contrast — never dimmed (project rule) */
    white-space: nowrap;
}
.abr-rotor-select {
    color: inherit;
    background: rgba(127, 127, 127, 0.14);
    border: 1px solid rgba(127, 127, 127, 0.45);
    border-radius: 6px;
    padding: 4px 8px;
    min-height: 32px; /* WCAG 2.5.8 target size */
    font-size: 0.85rem;
    cursor: pointer;
}
.abr-rotor-select option {
    color: #1a1a1a;
    background: #fff;
}
#abr-overlay.abr-themed .abr-rotor-select {
    border-color: color-mix(in srgb, var(--abr-page-fg) 35%, transparent);
}

/* ─── Settings modal (tabbed) ────────────────────────────────────────── */
.abr-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
}
.abr-modal[hidden] { display: none; }
.abr-modal-card {
    width: min(560px, 100%);
    height: min(620px, 90vh); /* fixed — body scrolls, no per-tab resize */
    display: flex;
    flex-direction: column;
    background: var(--abr-page-bg, #1a1a1a);
    color: var(--abr-page-fg, #fff);
    border: 2px solid color-mix(in srgb, var(--abr-page-fg, #fff) 30%, transparent);
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.abr-tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--abr-page-fg, #fff) 22%, transparent);
}
.abr-tab {
    background: transparent;
    color: inherit;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 8px 14px;
    min-height: 40px; /* WCAG 2.5.8 */
    font-size: 0.95rem;
    cursor: pointer;
}
.abr-tab[aria-selected="true"] {
    background: color-mix(in srgb, var(--abr-page-fg, #fff) 14%, transparent);
    border-color: color-mix(in srgb, var(--abr-page-fg, #fff) 25%, transparent);
    font-weight: 700;
}
.abr-modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1 1 auto; /* fill the fixed card height; scroll internally */
}
.abr-tabpanel[hidden] { display: none; }
.abr-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid color-mix(in srgb, var(--abr-page-fg, #fff) 22%, transparent);
    display: flex;
    justify-content: flex-end;
}

/* Color-theme preview swatches */
.abr-swatch-row { flex-wrap: wrap; gap: 8px; }
.abr-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 84px;
    min-height: 64px;
    padding: 8px;
    border: 2px solid color-mix(in srgb, var(--abr-page-fg, #fff) 30%, transparent);
    border-radius: 8px;
    cursor: pointer;
}
.abr-swatch[aria-checked="true"] {
    /* Selection ring as box-shadow + border, NOT outline — the focus ring
       (outline, #00a4dc) would replace an outline-based ring, hiding which
       swatch is selected while keyboard-navigating the group (WCAG H4). */
    box-shadow: 0 0 0 3px #ffd700;
    border-color: #ffd700;
}
.abr-swatch-sample { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.abr-swatch-name { font-size: 0.75rem; }

/* Bottom-bar audio cluster (skip-back · play · stop · skip-ahead) */
.abr-audio-cluster {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── TTS button states ──────────────────────────────────────────────── */

@keyframes abr-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(0, 164, 220, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(0, 164, 220, 0);    }
    100% { box-shadow: 0 0 0 0   rgba(0, 164, 220, 0);    }
}

#abr-tts-toggle.abr-tts-active {
    background: rgba(0, 164, 220, 0.18);
    color: #00a4dc;
    animation: abr-pulse 1.6s ease-out infinite;
}

#abr-tts-toggle.abr-tts-active:hover {
    background: rgba(0, 164, 220, 0.30);
}

#abr-tts-toggle.abr-tts-paused {
    background: rgba(0, 164, 220, 0.09);
    color: rgba(0, 164, 220, 0.65);
}

/* Panel header (close button) shared by the settings modal and book map */
.abr-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px 8px;
    box-sizing: border-box;
}

.abr-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.abr-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px; /* WCAG 2.5.8 */
    padding: 4px;
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, currentColor 8%, transparent);
    color: inherit;
    cursor: pointer;
}

.abr-settings-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.abr-settings-label {
    font-size: 0.82rem;
    color: inherit;
    white-space: nowrap;
    user-select: none;
}

.abr-speed-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(127, 127, 127, 0.3);
    color: inherit;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.abr-speed-select:focus {
    outline: 3px solid #00a4dc;
    outline-offset: 2px;
}

.abr-voice-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(127, 127, 127, 0.3);
    color: inherit;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.85rem;
    max-width: 220px;
    cursor: pointer;
}

.abr-voice-select:focus {
    outline: 3px solid #00a4dc;
    outline-offset: 2px;
}

.abr-voice-select option,
.abr-speed-select option {
    background: #1a1a1a;
    color: #ffffff;
}

/* ─── Read Button (injected into item detail page) ───────────────────── */

.abr-read-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.abr-btn-icon {
    font-size: 1.1rem;
}

/* Loading spinner while spine is fetching — WCAG: decorative, aria-hidden */
@keyframes abr-spin {
    to { transform: rotate(360deg); }
}

.abr-btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: abr-spin 0.7s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ─── Focus Rings — WCAG 2.4.11 Focus Appearance ────────────────────── */
/* Uses :focus (not :focus-visible) so TV programmatic focus triggers it */

#abr-overlay button:focus,
#abr-overlay iframe:focus,
.abr-read-button:focus {
    outline: 3px solid #00a4dc;
    outline-offset: 2px;
}

/* show-focus class: Jellyfin TV mode focus indicator */
#abr-overlay .show-focus:focus,
.abr-read-button.show-focus:focus {
    outline: 3px solid #00a4dc;
    outline-offset: 2px;
}

/* Suppress default browser outline for mouse users only if :focus-visible is supported */
@supports selector(:focus-visible) {
    #abr-overlay button:focus:not(:focus-visible),
    .abr-read-button:focus:not(:focus-visible) {
        outline: none;
    }
}

/* ─── Reading View (Phase 1) ─────────────────────────────────────────── */

#abr-content-area {
    position: relative; /* anchors ribbon, ruler, escape hatch */
}

/* Progress ribbon — the bookmark ribbon along the page edge */
:root {
    --abr-ribbon: #c89b5a;       /* lamplight amber — a ribbon, not a media control */
    --abr-ribbon-track: rgba(127, 127, 127, 0.18);
}

#abr-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 100%;
    padding: 0;
    border: none;
    border-left: 1px solid rgba(127, 127, 127, 0.2);
    background: var(--abr-ribbon-track);
    cursor: default;
}

#abr-ribbon-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--abr-ribbon);
    /* the ribbon's tail — a notched bookmark end */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 7px), 0 100%);
}

/* Reading ruler — tinted band over the current reading line */
#abr-ruler {
    position: fixed;
    left: 0;
    right: 14px; /* stop at the ribbon */
    height: 48px;
    background: color-mix(in srgb, var(--abr-ribbon) 18%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--abr-ribbon) 45%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--abr-ribbon) 45%, transparent);
    pointer-events: none;
    z-index: 3;
}

#abr-ruler[hidden] { display: none; }

/* Immersive mode — chrome slides away, the page remains.
   visibility goes hidden AFTER the fade so hidden controls leave the
   focus order entirely (keyboard/remote users can never land on them) */
#abr-toolbar, #abr-nav {
    transition: transform 0.25s ease-out, opacity 0.25s ease-out, visibility 0s linear 0s;
}

#abr-overlay.abr-immersive #abr-toolbar {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out, visibility 0s linear 0.25s;
    pointer-events: none;
    position: absolute;
    width: 100%;
}

#abr-overlay.abr-immersive #abr-nav {
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out, visibility 0s linear 0.25s;
    pointer-events: none;
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* The obvious way back — faded but always findable, loud on focus */
#abr-show-controls {
    position: absolute;
    top: 10px;
    right: 24px;
    z-index: 4;
    min-width: 44px;
    min-height: 44px;
    /* Solid surface + strong border: holds 3:1 (WCAG 1.4.11) over any page,
       quiet at rest via reduced inner contrast rather than transparency */
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

#abr-show-controls:hover,
#abr-show-controls:focus {
    border-color: #ffffff;
    color: #ffffff;
}

#abr-show-controls[hidden] { display: none; }

.abr-nav-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

/* Reduced motion: kill every reader animation/transition — the same blanket
   rule as the in-app .abr-reduce setting, so the OS preference and the
   in-app toggle behave identically (it previously only covered 3 elements,
   leaving the immersive slide, spinner, and button transitions animating). */
@media (prefers-reduced-motion: reduce) {
    #abr-overlay *,
    #abr-overlay {
        transition: none !important;
        animation: none !important;
    }
}

/* ─── Theme-derived chrome (Phase 2) ─────────────────────────────────── */
/* The bars take their surface from the active page theme: a sepia page
   gets sepia-tinted chrome, never a gray app frame around a warm page. */

#abr-overlay.abr-themed {
    background: color-mix(in srgb, var(--abr-page-bg) 88%, black);
    color: var(--abr-page-fg);
}

#abr-overlay.abr-themed #abr-toolbar,
#abr-overlay.abr-themed #abr-nav {
    background: color-mix(in srgb, var(--abr-page-bg) 94%, black);
    border-color: color-mix(in srgb, var(--abr-page-fg) 22%, transparent);
    color: var(--abr-page-fg);
}

#abr-overlay.abr-themed #abr-frame {
    background: var(--abr-page-bg);
}

.abr-col-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.abr-col-row[hidden] { display: none; }

.abr-col-label {
    min-width: 9.5em;
    font-size: 0.85rem;

    user-select: none;
}

.abr-col-step {
    min-width: 40px;
    min-height: 40px; /* WCAG 2.5.8 */
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 8%, transparent);
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.abr-col-value {
    min-width: 4.5em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.abr-col-choice {
    min-height: 40px; /* WCAG 2.5.8 */
    padding: 6px 14px;
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 8%, transparent);
    color: inherit;
    cursor: pointer;
    font-size: 0.88rem;
}

.abr-col-choice[aria-checked="true"],
.abr-col-choice[aria-pressed="true"] {
    background: color-mix(in srgb, var(--abr-ribbon) 25%, transparent);
    border-color: var(--abr-ribbon);
}

.abr-col-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.abr-col-color input[type="color"] {
    width: 44px;
    height: 40px; /* WCAG 2.5.8 */
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

#abr-contrast-readout {
    font-size: 0.85rem;
}

#abr-contrast-readout.abr-contrast-warn {

    font-weight: 600;

}

#abr-overlay.abr-immersive #abr-close { display: none; }

/* ─── Book Map (Phase 3) ─────────────────────────────────────────────── */

/* #abr-bookmap now uses the shared .abr-modal / .abr-modal-card styling
   (centered card, themed via --abr-page-bg) — same as the Settings modal. */

#abr-map-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.abr-map-item {
    text-align: left;
    min-height: 40px; /* WCAG 2.5.8 */
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.95rem;
}

.abr-map-item:hover:not([disabled]) {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.abr-map-item[disabled] {
    opacity: 0.35;
    cursor: default;
}

/* Selection popover: Highlight / Add note over the selected text */
#abr-sel-pop {
    position: fixed;
    z-index: 2147483647;
    display: flex;
    gap: 6px;
    align-items: flex-start;
    padding: 6px;
    border-radius: 8px;
    background: var(--abr-page-bg, #1a1a1a);
    color: var(--abr-page-fg, #fff);
    border: 2px solid color-mix(in srgb, var(--abr-page-fg, #fff) 30%, transparent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.abr-note-input {
    min-width: 220px;
    min-height: 40px; /* WCAG 2.5.8 */
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
}

/* Annotations tab: controls row above the list */
.abr-ann-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.abr-ann-note {
    display: block;
    opacity: 0.8;
    font-size: 0.88em;
    margin-top: 2px;
    white-space: pre-wrap;
}

.abr-ann-edit {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    padding: 6px 0;
}

/* Bookmarks tab: jump button + delete button per row */
.abr-bm-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.abr-bm-row .abr-map-item {
    flex: 1;
    min-width: 0;
}

.abr-bm-del {
    flex: none;
}

.abr-goto-input {
    min-height: 40px; /* WCAG 2.5.8 */
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 6%, transparent);
    color: inherit;
    font-size: 1rem;
    width: 10em;
}

.abr-goto-input:focus {
    outline: 3px solid #00a4dc;
    outline-offset: 2px;
}

/* ─── Search results ─────────────────────────────────────────────────── */

#abr-search-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.abr-search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    padding: 8px 12px;
    min-height: 44px; /* WCAG 2.5.8 */
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    width: 100%;
}

.abr-search-item:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.abr-search-loc {
    font-size: 0.8rem;
    font-weight: 600;
}

.abr-search-snip {
    font-size: 0.9rem;
    line-height: 1.4;
}

.abr-search-snip mark {
    background: var(--abr-ribbon);
    color: #1a1a1a;
    padding: 0 2px;
    border-radius: 2px;
}

.abr-map-note {
    margin: 0 0 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-left: 3px solid var(--abr-ribbon);
}

#abr-overlay.abr-immersive #abr-bookmap { display: none; }

/* ─── Footnote popover ───────────────────────────────────────────────── */

#abr-footnote {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    max-width: min(640px, calc(100% - 48px));
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 10px;
    border: 2px solid color-mix(in srgb, var(--abr-page-fg, #fff) 50%, transparent);
    background: var(--abr-page-bg, #1a1a1a);
    color: var(--abr-page-fg, #fff);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.abr-footnote-text {
    font-size: 1rem;
    line-height: 1.5;
    max-height: 30vh;
    overflow-y: auto;
}

/* In-app reduced-motion setting: no chrome transitions or animations at all */
#abr-overlay.abr-reduce *,
#abr-overlay.abr-reduce {
    transition: none !important;
    animation: none !important;
}

/* ─── Responsive — reflow down to 320px (WCAG 1.4.10) ────────────────── */

@media (max-width: 480px) {
    /* Toolbar: title takes its own top row; controls wrap below it */
    #abr-toolbar {
        gap: 6px;
        padding: 8px 10px;
    }
    .abr-title-text {
        flex-basis: 100%;
        order: -1;
        font-size: 0.95rem;
    }
    .abr-chapter-info {
        flex-basis: 100%;
        order: -1;
        font-size: 0.8rem;
        white-space: normal;
    }

    /* Nav: collapse Previous/Next words to chevrons, tighten padding */
    #abr-nav {
        gap: 8px;
        padding: 8px 10px;
    }
    .abr-nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .abr-nav-btn {
        padding: 10px 12px;
    }
    .abr-nav-mid {
        flex: 1;
        min-width: 0;
    }
    #abr-page-info {
        white-space: normal;
        text-align: center;
    }

    /* Narrower labels so steppers/choices keep room */
    .abr-col-label {
        min-width: 7em;
    }

    /* Panels: cap height a little lower so the page stays visible */
    #abr-bookmap {
        max-height: 42vh;
    }
}

@media (max-width: 360px) {
    .abr-col-label {
        flex-basis: 100%;
        min-width: 0;
    }
    .abr-goto-input, .abr-voice-select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
}
