/*
 * ByTheFireplace Audio. Dark covers layout on top of Bootstrap 5.3 (reboot and .btn only), Font Awesome 7 and
 * Raleway headings / Open Sans text. (/admin keeps GALLAXY on Bootstrap 3.)
 *
 * Layout: a header bar (menu button, logo, search; on the right, Plex-like: ByTheFireplace.com, LibriVox, catalogue,
 * cover size, your avatar with its menu), a left menu like Plex's (always shown from 992 px; the menu button narrows it
 * to icons, remembered per browser), a drawer on smaller screens, and categories across the top like Jellyfin's.
 * Cover size: --tile-w, set from the header's slider (remembered per browser, btfa-tile).
 */

:root {
	--bg: #141414;
	--bg2: #1f1f1f;
	--side-bg: #181818;
	--text: #e8e8e8;
	--dim: #9a9a9a;
	--accent: #e8762b;          /* fire orange */
	--tile-w: 168px;
	--gap: 10px;
	--edge: 3vw;
	--hdr: 56px;                /* header height */
	--side-w: 236px;            /* left menu, full */
	--rail: 64px;               /* left menu, icons only */
	--side-cur: var(--side-w);  /* the menu's current width (0 when it is a drawer) */
}
html.side-mini { --side-cur: var(--rail); }

html, body { background: var(--bg); color: var(--text); }
body { font-family: 'Open Sans', Arial, sans-serif; font-size: 15px; line-height: 1.42857; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
a:hover, a:focus { color: #fff; text-decoration: none; }
h1, h2, .logo { font-family: 'Raleway', 'Open Sans', sans-serif; }
h1, h2 { color: inherit; }

/* ---------- header ---------- */
#header { position: sticky; top: 0; z-index: 50; height: var(--hdr); display: flex; align-items: center; gap: 6px;
	padding: 0 14px 0 8px; background: #101010; border-bottom: 1px solid #222; }
.hdr-btn { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%; background: none; color: #ddd; font-size: 20px; }
.hdr-btn:hover, .hdr-btn:focus { background: rgba(255,255,255,.08); color: #fff; outline: none; }
/* logo: a brick fireplace with a fire and books on the mantel, "by the Fireplace" (ByTheFireplace.com's own wording), AUDIO */
.logo { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; letter-spacing: .2px; color: #fff; white-space: nowrap; margin-right: 18px; }
.logo:hover { color: #fff; }
.logo-mark { width: 38px; height: 34px; margin-top: -2px; flex: 0 0 auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.logo b { font-family: 'Open Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff;
	background: var(--accent); border-radius: 4px; padding: 2px 6px 1px; margin-top: 2px; }
.hdr-search { position: relative; flex: 0 1 360px; }
.hdr-search input { width: 100%; background: #000; border: 1px solid #3a3a3a; color: #fff; padding: 7px 12px 7px 32px; border-radius: 18px; font-size: 14px; }
.hdr-search input:focus { outline: none; border-color: var(--accent); }
.hdr-search i { position: absolute; left: 12px; top: 11px; color: #888; font-size: 13px; pointer-events: none; }
#search-toggle { display: none; }

/* right-hand side: Plex-like icons */
.hdr-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hdr-btn { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
a.hdr-btn { color: #ddd; }
/* the way back to the books: the one coloured button in the header */
.hdr-btf { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; margin-right: 6px; border-radius: 18px;
	background: rgba(232,118,43,.14); border: 1px solid rgba(232,118,43,.55); color: #ffb27d; font-size: 14px; font-weight: 700; white-space: nowrap; }
.hdr-btf i { font-size: 16px; color: var(--accent); }
.hdr-btf:hover, .hdr-btf:focus { background: var(--accent); border-color: var(--accent); color: #fff; }
.hdr-btf:hover i, .hdr-btf:focus i { color: #fff; }
.hdr-menu { position: relative; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: 4px; padding: 0; border: 2px solid transparent;
	border-radius: 50%; background: hsl(var(--h, 20), 55%, 42%); color: #fff; font: 700 14px/1 'Open Sans', sans-serif; letter-spacing: .5px; }
.avatar.guest { background: #333; color: #bbb; font-size: 16px; }
.avatar:hover, .avatar:focus, .avatar[aria-expanded="true"] { border-color: #fff; outline: none; }
.avatar.big { width: 44px; height: 44px; margin: 0; font-size: 17px; flex: 0 0 auto; }

/* drop-downs from the header (cover size, the avatar's menu) */
.pop { position: absolute; z-index: 60; top: calc(100% + 10px); right: 0; min-width: 240px; padding: 8px 0; background: #232323; border: 1px solid #333;
	border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.6); }
.pop[hidden] { display: none; }
.pop label { display: block; padding: 6px 16px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #8a8a8a; }
.size-row { display: flex; align-items: center; gap: 10px; padding: 6px 16px 4px; color: #888; font-size: 12px; }
.size-row .slider { flex: 1 1 auto; height: 24px; }
.pop-link { display: block; margin: 2px 16px 6px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; }
.pop-link:hover { color: #fff; }
.pop.menu { min-width: 260px; }
.pop.menu a, .pop.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; border: 0; background: none; color: #ddd; font-size: 14px; text-align: left; }
.pop.menu a i, .pop.menu button i { width: 18px; color: #999; text-align: center; }
.pop.menu a:hover, .pop.menu button:hover, .pop.menu a:focus, .pop.menu button:focus { background: rgba(255,255,255,.07); color: #fff; outline: none; }
.pop.menu form { margin: 0; border-top: 1px solid #333; margin-top: 6px; padding-top: 6px; }
.pop .me { display: flex; align-items: center; gap: 12px; padding: 8px 18px 12px; margin-bottom: 6px; border-bottom: 1px solid #333; }
.pop .me span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pop .me b { color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.pop .me small { color: #888; font-size: 12px; }
.pop-note { margin: 4px 18px 8px; color: #999; font-size: 13px; line-height: 1.4; }

/* categories across the top (Jellyfin-like): one scrolling line under the header */
.catbar { position: sticky; top: var(--hdr); z-index: 30; display: flex; align-items: stretch; gap: 2px; padding: 0 var(--edge); overflow-x: auto;
	background: rgba(16,16,16,.94); border-bottom: 1px solid #222; scrollbar-width: none; -webkit-overflow-scrolling: touch; backdrop-filter: blur(6px); }
.catbar::-webkit-scrollbar { display: none; }
.catbar a { flex: 0 0 auto; padding: 11px 12px 9px; border-bottom: 3px solid transparent; color: #aaa; font-size: 14px; font-weight: 600; white-space: nowrap; }
.catbar a:hover { color: #fff; }
.catbar a.on { color: #fff; border-bottom-color: var(--accent); }
.cb-label { flex: 0 0 auto; align-self: center; margin: 0 2px 0 14px; padding: 2px 0 0 14px; border-left: 1px solid #333;
	font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #666; white-space: nowrap; }
body.book .catbar { display: none; }

/* ---------- left menu ---------- */
.side { position: fixed; z-index: 40; top: var(--hdr); bottom: 0; left: 0; width: var(--side-w); overflow-x: hidden; overflow-y: auto;
	background: var(--side-bg); border-right: 1px solid #222; padding: 8px 0 28px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side h3 { font-family: 'Open Sans', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
	color: #6d6d6d; margin: 18px 0 6px; padding: 0 21px; white-space: nowrap; }
.side a, .side .a { display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 18px; border: 0; border-left: 3px solid transparent;
	background: none; color: #bdbdbd; font-size: 14px; text-align: left; white-space: nowrap; }
.side i { flex: 0 0 22px; text-align: center; font-size: 16px; }
.side a span, .side .a span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side a small { color: #666; font-size: 12px; }
.side a:hover, .side button.a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.on { color: var(--accent); border-left-color: var(--accent); background: rgba(232,118,43,.09); }
.side .who .a { color: #fff; font-weight: 600; cursor: default; }
.side .signout { margin: 0; }
.side-shade { position: fixed; z-index: 39; top: var(--hdr); left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); }
#page { margin-left: var(--side-cur); min-width: 0; }

/* icons only */
html.side-mini .side { width: var(--rail); }
html.side-mini .side a, html.side-mini .side .a { justify-content: center; padding-left: 0; padding-right: 3px; }
html.side-mini .side a span, html.side-mini .side .a span, html.side-mini .side a small { display: none; }
html.side-mini .side h3 { height: 1px; margin: 12px 14px; padding: 0; background: #2c2c2c; }
html.side-mini .side h3 span { display: none; }

/* ---------- featured ---------- */
/* overflow: clip, not just hidden: the blurred background reaches past the edges, and a hidden overflow can still be
   scrolled sideways (focusing a control did), which slid the whole page under the left menu */
.hero { position: relative; overflow: hidden; overflow: clip; padding: 36px var(--edge) 46px; min-height: 320px;
	background: radial-gradient(circle at 25% 40%, hsl(var(--hue), 35%, 22%), var(--bg) 70%); }
.hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.35); transform: scale(1.1); }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--bg)); }
.hero-body { position: relative; z-index: 1; display: flex; gap: 36px; align-items: center; max-width: 1100px; }
.hero-cover { flex: 0 0 auto; width: 250px; aspect-ratio: 1; border-radius: 6px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text h1 { font-size: 44px; font-weight: 800; margin: 4px 0 8px; line-height: 1.1; }
.hero-text .eyebrow { text-transform: uppercase; letter-spacing: 2px; color: var(--accent); font-size: 12px; font-weight: 700; margin: 0; }
.hero-text .by { font-size: 18px; color: #ddd; margin: 0 0 4px; }
.hero-text .meta { color: var(--dim); margin: 0 0 20px; }
.btn-play { background: #fff; color: #000; font-weight: 700; font-size: 17px; padding: 10px 28px; border-radius: 4px; }
.btn-play:hover, .btn-play:focus { background: var(--accent); color: #fff; }

/* ---------- rows ---------- */
#rows { padding: 10px 0 30px; }
.row-block { margin: 0 0 26px; scroll-margin-top: calc(var(--hdr) + 54px); }   /* header + category bar */
.row-block h2 { display: flex; align-items: baseline; gap: 0; font-size: 20px; font-weight: 700; margin: 0 var(--edge) 10px; min-width: 0; }
.row-block h2 .rt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-block h2 small { flex: 0 0 auto; color: var(--dim); font-size: 13px; font-weight: 400; margin-left: 8px; }
.row-block h2 .see-all { margin-left: auto; padding-left: 12px; }
.row-block h2 .count, .grid-title .count { color: #555; font-size: 13px; font-weight: 400; margin-left: 6px; }
.see-all { font-family: 'Open Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--accent); margin-left: 10px; white-space: nowrap; }
.see-all:hover { color: #fff; }
.row-wrap { position: relative; }
.row-scroll { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--edge);
	padding: 6px var(--edge) 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row-scroll::-webkit-scrollbar { display: none; }

.tile { position: relative; flex: 0 0 var(--tile-w); width: var(--tile-w); aspect-ratio: 1; border-radius: 4px; overflow: hidden;
	background: var(--bg2); scroll-snap-align: start; transition: transform .2s ease, box-shadow .2s ease; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* a LibriVox series: how many titles, on the cover */
.tile .badge-n { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.78); color: #fff;
	font-size: 12px; font-weight: 700; line-height: 18px; }
.tile .badge-n i { color: var(--accent); margin-right: 2px; }
.tile:hover, .tile:focus-visible { transform: scale(1.06); z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.7); outline: none; }
.tile .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 8px 9px; background: linear-gradient(transparent, rgba(0,0,0,.92));
	opacity: 0; transition: opacity .2s ease; line-height: 1.25; }
.tile:hover .info, .tile:focus-visible .info { opacity: 1; }
.tile .info b { display: block; font-size: 13px; }
.tile .info small { display: block; font-size: 11px; color: #bbb; }
/* listening progress: a bar along the bottom and the percentage in the corner */
.tile .progress-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); }
.tile .pct { position: absolute; top: 6px; right: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.78); color: #fff;
	font-size: 12px; font-weight: 700; line-height: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* home rows: each cover with its details underneath (.lv-meta, as on the LibriVox pages), so no title laid over the cover */
.row-item { flex: 0 0 var(--tile-w); width: var(--tile-w); min-width: 0; scroll-snap-align: start; }
.row-item[hidden] { display: none; }
.row-item .tile { display: block; width: 100%; flex: none; scroll-snap-align: none; }
.row-item .tile .info { display: none; }

/* no picture: the title on a colour of its own */
.no-cover { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 14px; text-align: center;
	background: linear-gradient(150deg, hsl(var(--hue), 45%, 32%), hsl(calc(var(--hue) + 40), 45%, 16%)); font-family: 'Raleway', sans-serif; }
.no-cover b { font-size: 17px; font-weight: 800; line-height: 1.15; color: #fff; }
.no-cover small { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.75); }
.hero-cover .no-cover b, .hero-cover .no-cover { font-size: 26px; font-weight: 800; color: #fff; }

.row-arrow { position: absolute; top: 6px; bottom: 14px; width: var(--edge); min-width: 34px; z-index: 3; border: 0; color: #fff; font-size: 22px;
	background: rgba(20,20,20,.6); opacity: 0; transition: opacity .2s ease; }
.row-arrow.prev { left: 0; }
.row-arrow.next { right: 0; }
.row-wrap:hover .row-arrow { opacity: 1; }
.row-arrow[disabled] { visibility: hidden; }

/* ---------- one category or series: a grid (/browse/...) ---------- */
#grid-page { padding: 22px var(--edge) 30px; }
.grid-title { font-size: 28px; font-weight: 800; margin: 0 0 18px; }
.grid-title small { display: block; margin-top: 4px; color: var(--dim); font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); gap: 14px var(--gap); }
.grid .tile { width: auto; flex: none; }
.grid .tile[hidden] { display: none; }

/* ---------- LibriVox (/librivox) ---------- */
.lv-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.lv-filter select, .lv-q input { height: 38px; background: #000; color: #fff; border: 1px solid #3a3a3a; border-radius: 6px; padding: 0 10px; font-size: 14px; }
.lv-filter select:focus, .lv-q input:focus { outline: none; border-color: var(--accent); }
.lv-filter select { max-width: 210px; }
.lv-filter select option { color: #111; background: #fff; }
.lv-q { position: relative; flex: 1 1 260px; max-width: 420px; }
.lv-q input { width: 100%; padding-left: 32px; }
.lv-q i { position: absolute; left: 11px; top: 12px; color: #888; font-size: 13px; }
.lv-go { height: 38px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; }
.lv-go:hover { background: #ff8a3d; }
.lv-grid { gap: 22px var(--gap); }
.lv-item { min-width: 0; }
.lv-item .tile { display: block; }
.lv-item .tile img { position: absolute; inset: 0; }
.lv-meta { display: flex; flex-direction: column; gap: 1px; padding: 7px 2px 0; line-height: 1.3; }
.lv-meta .t { color: #fff; font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lv-meta .a { color: #c8c8c8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-meta .m, .lv-meta .r { color: var(--dim); font-size: 12px; }
.lv-meta .r i { color: var(--accent); }
.lv-meta .stars { color: #f0b429; font-size: 12px; }
.lv-meta .stars small { color: var(--dim); margin-left: 2px; }
.lv-meta .v { color: var(--accent); font-size: 12px; font-weight: 600; margin-top: 2px; }
.lv-meta .v:hover { color: #fff; }
/* the genre tree: where you are, then the next level down as buttons */
.lv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--dim); }
.lv-crumbs a { color: var(--accent); }
.lv-crumbs a:hover { color: #fff; }
.lv-crumbs span { color: #ddd; }
.lv-crumbs i { color: #555; font-size: 12px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 18px; background: rgba(255,255,255,.07);
	border: 1px solid rgba(255,255,255,.12); color: #ddd; font-size: 14px; line-height: 1.2; }
.chip:hover, .chip:focus { background: rgba(255,255,255,.14); color: #fff; }
.chip small { color: #888; font-size: 12px; }
.chip .more { color: #777; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on small, .chip.on .more { color: rgba(255,255,255,.8); }
.lv-groups .chip { padding: 12px 18px; border-radius: 10px; font-size: 16px; font-weight: 600; }
.lv-groups .chip i:first-child { color: var(--accent); font-size: 18px; }
.lv-back { margin: 0 0 6px; }
.lv-back a { color: var(--accent); font-size: 14px; }
.lv-error { background: rgba(255,80,60,.12); border: 1px solid rgba(255,80,60,.4); color: #ffb4a8; padding: 10px 14px; border-radius: 8px; }
.lv-pager { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 30px 0 10px; color: var(--dim); }
.lv-pager a { color: var(--accent); font-weight: 600; }
.np-series a { color: var(--accent); }
.np-series a:hover { color: #fff; }

.empty { margin: 30px var(--edge); color: var(--dim); }
.empty a { color: var(--accent); }

#footer { padding: 20px var(--edge) 40px; color: #666; font-size: 13px; }
#footer a { color: #888; }

/* ---------- phones and small tablets ---------- */
/* touch screens: no hover, so no title laid over the cover (the cover, or the title on its colour, already says it) */
@media (hover: none) {
	.row-arrow { display: none; }
	.tile .info { display: none; }
	.tile:hover { transform: none; }
}
/* tablets and small laptops: the ByTheFireplace.com button as an icon, so the search box keeps its room */
@media (max-width: 1199px) {
	.hdr-btf { width: 40px; padding: 0; justify-content: center; }
	.hdr-btf span { display: none; }
	.hdr-search { min-width: 150px; }
}
@media (max-width: 991px) {
	:root, html.side-mini { --side-cur: 0px; }
	.side, html.side-mini .side { width: min(280px, 85vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 4px 0 24px rgba(0,0,0,.5); }
	html.side-mini .side a, html.side-mini .side .a { justify-content: flex-start; padding: 9px 18px; }
	html.side-mini .side a span, html.side-mini .side .a span, html.side-mini .side a small, html.side-mini .side h3 span { display: initial; }
	html.side-mini .side h3 { height: auto; margin: 18px 0 6px; padding: 0 21px; background: none; }
	body.side-open .side { transform: none; }
}
@media (max-width: 767px) {
	:root { --tile-w: 120px; --gap: 8px; --edge: 14px; }
	#header { padding-right: 6px; gap: 2px; }
	.logo { font-size: 17px; margin-right: 0; gap: 6px; }
	.logo-mark { width: 32px; height: 29px; }
	.hdr-search { display: none; }
	#search-toggle { display: inline-flex; }
	.hdr-actions { gap: 0; }
	.hdr-wide { display: none !important; }
	.hdr-btn { width: 38px; height: 38px; font-size: 17px; }
	.hdr-btf { width: 38px; height: 34px; padding: 0; justify-content: center; margin-right: 2px; }
	.hdr-btf span { display: none; }
	.avatar { width: 32px; height: 32px; font-size: 12px; }
	.pop { position: fixed; top: calc(var(--hdr) + 4px); right: 8px; left: auto; max-width: calc(100vw - 16px); }
	body.search-open .hdr-search { display: block; position: absolute; left: 54px; right: 50px; top: 9px; z-index: 2; }
	body.search-open .logo, body.search-open .hdr-actions > :not(#search-toggle) { visibility: hidden; }
	.catbar a { padding: 10px 10px 8px; font-size: 13px; }
	.cb-label { margin-left: 8px; padding-left: 10px; }
	.row-block h2 small { font-size: 12px; }
	.see-all { font-size: 12px; }
	.hero { padding: 20px var(--edge) 34px; min-height: 0; }
	.hero-body { flex-direction: column; align-items: flex-start; gap: 18px; }
	.hero-cover { width: 160px; }
	.hero-text h1 { font-size: 28px; }
	.hero-text .by { font-size: 15px; }
	.row-block h2 { font-size: 17px; }
	.tile .info b { font-size: 12px; }
	.grid-title { font-size: 22px; }
	.grid { gap: 10px var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-w), 44vw), 1fr)); }
	/* LibriVox under each cover: title (two lines), author, length; downloads, language and stars only on larger screens */
	.lv-grid { gap: 16px var(--gap); }
	.lv-meta { padding-top: 5px; }
	.lv-meta .t { font-size: 13px; line-height: 1.25; }
	.lv-meta .a { font-size: 12px; }
	.lv-meta .m { font-size: 11px; }
	.lv-meta .dl, .lv-meta .lg, .lv-meta .stars { display: none; }
	.lv-meta .v { font-size: 11px; }
	.lv-filter select { max-width: none; flex: 1 1 40%; }
	.lv-q { flex-basis: 100%; max-width: none; }
}
@media (max-width: 420px) {
	/* the smallest phones: the fireplace and AUDIO */
	.logo-name { display: none; }
}
/* when searching, the featured book steps aside */
body.searching .hero { display: none; }

/* ---------- player (book page) ----------
 * Fits the screen without scrolling: one centred column on phones and tablets (the cover shrinks to make room),
 * cover and controls side by side from 992 px.
 */
body.book #footer { display: none; }
.np { position: relative; overflow: hidden; overflow: clip; min-height: calc(100vh - var(--hdr)); min-height: calc(100dvh - var(--hdr));
	background: radial-gradient(circle at 50% 25%, hsl(var(--hue), 35%, 22%), var(--bg) 75%); }
.np-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(50px) brightness(.32); transform: scale(1.15); }
.np-body { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
	display: flex; flex-direction: column; align-items: center; text-align: center;
	--np-rest: 440px; }   /* height of everything but the cover (measured); the cover gets what is left of the screen */
.np-body.np-guest { --np-rest: 472px; }   /* plus the "sign in to keep your place" line */
.np-main { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* the book */
.np-body { --np-vol: 46px; }                       /* the volume row (measured); 0 where it is hidden */
body.no-volume .np-body { --np-vol: 0px; }
.np-cover { width: clamp(120px, calc(100dvh - var(--hdr) - var(--np-rest) - var(--np-vol)), min(80vw, 400px)); aspect-ratio: 1; border-radius: 10px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(0,0,0,.65); background: var(--bg2); }
.np-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-cover .no-cover b { font-size: 28px; }
.np-cover .no-cover small { font-size: 16px; }
.np-title { font-family: 'Raleway', sans-serif; font-weight: 800; font-size: clamp(24px, 7vw, 38px); line-height: 1.1; margin: 16px 0 4px; color: #fff; }
.np-author { font-size: clamp(16px, 4.4vw, 19px); color: #e6e6e6; margin: 0; }
.np-narrator { color: var(--dim); font-size: .85em; }
.np-series { color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .5px; margin: 3px 0 0; }

/* where we are */
.np-now { margin: 12px 0 0; font-size: 16px; color: #fff; min-height: 22px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-section { color: var(--accent); font-weight: 700; margin-right: 6px; }
.np-section:empty { display: none; }
.np-resume { color: var(--dim); font-size: 13px; margin: 0; }

/* two sliders: this chapter (big), the whole book (smaller) */
.np-scrub { width: 100%; margin-top: 4px; }
.np-scrub-book { margin-top: 2px; }
.np-times { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: -2px; }
.np-times > :first-child { text-align: left; }
.np-times > :last-child { text-align: right; }
.np-what { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8a8a8a; padding: 0 8px; }
.np-what b { color: #ccc; font-weight: 700; letter-spacing: 0; }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --fill: 0%; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--fill), rgba(255,255,255,.22) var(--fill)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); }
.slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; }
#bscrub { height: 24px; }
#bscrub::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, #d8d8d8 var(--fill), rgba(255,255,255,.16) var(--fill)); }
#bscrub::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; }
#bscrub::-moz-range-track { height: 4px; }
#bscrub::-moz-range-progress { height: 4px; background: #d8d8d8; }
#bscrub::-moz-range-thumb { width: 14px; height: 14px; }

/* the controls */
.np-buttons { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 4.5vw, 28px); margin: 10px 0 4px; }
.np-buttons button { position: relative; flex: 0 0 auto; background: none; border: 0; color: #eee; border-radius: 50%; padding: 0;
	display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.np-buttons button:active { transform: scale(.94); }
.np-buttons button:hover { color: #fff; }
.b-chap { width: 40px; height: 52px; font-size: 22px; color: #aaa !important; }
.b-skip { width: 52px; height: 52px; }
.b-skip svg { width: 46px; height: 46px; display: block; }
.b-skip text { font-family: 'Open Sans', Arial, sans-serif; font-size: 12.5px; font-weight: 800; fill: currentColor; }
.b-play { width: 80px; height: 80px; font-size: 36px; background: #fff !important; color: #000 !important; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.b-play .fa-play { margin-left: 7px; }
.b-play:hover { background: var(--accent) !important; color: #fff !important; }
body.buffering .b-play { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* volume: speaker (mute) button, slider, percentage */
.np-volume { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 340px; height: 32px; margin: 0 auto 2px; }
.np-volume[hidden] { display: none; }
.b-vol { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: #bbb; font-size: 18px; }
.b-vol:hover, .b-vol:focus { color: #fff; background: rgba(255,255,255,.08); outline: none; }
#vol { flex: 1 1 auto; height: 24px; }
#vol::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, #d8d8d8 var(--fill), rgba(255,255,255,.16) var(--fill)); }
#vol::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; }
#vol::-moz-range-track { height: 4px; }
#vol::-moz-range-progress { height: 4px; background: #d8d8d8; }
#vol::-moz-range-thumb { width: 14px; height: 14px; }
.np-vol-val { flex: 0 0 40px; text-align: right; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* chapter, speed, sleep: labelled buttons; the transparent select on top opens the phone's picker */
.np-pills { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; width: 100%; margin-top: 10px; }
.pill { position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 7px 12px; margin: 0;
	background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; text-align: left; font-weight: 400; cursor: pointer; }
.pill:hover, .pill:focus-within { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.pill > i { font-size: 20px; color: var(--accent); flex: 0 0 auto; }
.pill span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pill small { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
.pill b { font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
/* the list a desktop browser drops down: otherwise it inherits the page's light grey text on its white background */
.pill select option, .pill select optgroup { color: #111; background: #fff; }
body.sleeping .pill #sleep-val { color: var(--accent); }

.np-note { color: var(--dim); font-size: 13px; margin: 12px 0 0; }
.np-note a { color: var(--accent); }
.np-error { color: #ff8a80; margin-top: 10px; }

@media (max-width: 380px) {
	.np-body { padding-left: 14px; padding-right: 14px; }
	.np-pills { grid-template-columns: 1fr 1fr; }
	.np-pills .pill:first-child { grid-column: 1 / -1; }
	.np-body { --np-rest: 492px; }
	.np-body.np-guest { --np-rest: 524px; }
	.b-chap { width: 34px; }
	.b-skip { width: 46px; height: 46px; }
	.b-skip svg { width: 42px; height: 42px; }
	.b-play { width: 72px; height: 72px; font-size: 32px; }
}
@media (min-width: 480px) {
	.b-chap { width: 48px; }
	.b-skip { width: 58px; height: 58px; }
	.b-skip svg { width: 50px; height: 50px; }
	.b-play { width: 88px; height: 88px; font-size: 38px; }
	.np-body { --np-rest: 462px; }
	.np-body.np-guest { --np-rest: 494px; }
}

/* wide screens: cover on the left, everything else on the right, all within the screen's height */
@media (min-width: 992px) {
	.np-body { display: grid; grid-template-columns: auto minmax(320px, 460px); align-items: center; justify-content: center;
		gap: clamp(32px, 4vw, 72px); max-width: none; min-height: calc(100vh - var(--hdr)); min-height: calc(100dvh - var(--hdr)); padding: 24px 40px; }
	.np-cover { width: clamp(220px, min(calc(100dvh - var(--hdr) - 64px), calc(100vw - var(--side-cur) - 460px - 4vw - 90px)), 560px); }
	.np-title { margin-top: 0; }
}
