/*
Theme Name: ReadAlongBook Dashboard
Theme URI: https://readalongbook.com
Description: App-style reading theme for readalongbook.com (sidebar on desktop, bottom tab bar on mobile). Built to host the ReadAlong Book plugin. Translation-ready (text domain: readalongbook).
Version: 3.8.9
Requires at least: 6.3
Requires PHP: 7.4
Author: Hoang Huong
Text Domain: readalongbook
License: GPLv2 or later
*/

/* ==========================================================================
   0. Nunito (self-hosted variable font, SIL OFL – assets/fonts/OFL.txt)
   ========================================================================== */
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-vietnamese-wght-normal.woff2') format('woff2-variations'), url('assets/fonts/nunito-vietnamese-wght-normal.woff2') format('woff2');
	unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
	font-family: 'Nunito';
	font-style: italic;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-vietnamese-wght-italic.woff2') format('woff2-variations'), url('assets/fonts/nunito-vietnamese-wght-italic.woff2') format('woff2');
	unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2-variations'), url('assets/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
	font-family: 'Nunito';
	font-style: italic;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-latin-ext-wght-italic.woff2') format('woff2-variations'), url('assets/fonts/nunito-latin-ext-wght-italic.woff2') format('woff2');
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-latin-wght-normal.woff2') format('woff2-variations'), url('assets/fonts/nunito-latin-wght-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: 'Nunito';
	font-style: italic;
	font-display: swap;
	font-weight: 200 1000;
	src: url('assets/fonts/nunito-latin-wght-italic.woff2') format('woff2-variations'), url('assets/fonts/nunito-latin-wght-italic.woff2') format('woff2');
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ==========================================================================
   1. Tokens (colours sampled from the logo)
   ========================================================================== */
:root {
	--brand-dark: #142f4d;      /* logo background */
	--brand-darker: #0f243c;    /* top bar / sidebar edges */
	--brand-cyan: #2ec8bc;      /* "book" – use on dark backgrounds */
	--brand-cyan-ink: #0b7d74;  /* cyan readable on light backgrounds */
	--brand-yellow: #fbbe2f;    /* "along" */

	--bg-light-yellow: #fdf8eb; /* reading background */
	--bg-card: #fffdf7;
	--line: #eee3c8;

	--text-main: #2b2b2b;
	--text-muted: #6b6b6b;
	--white: #ffffff;

	--radius: 10px;
	--radius-lg: 16px;
	--sidebar-width: 248px;
	--sidebar-collapsed: 76px;
	--topbar-h: 64px;
	--tabbar-h: 62px;
	--shadow: 0 6px 18px rgba(20, 47, 77, 0.12);
	--font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
/* Never let the page slide sideways on phones (wide content in a post, long titles…).
   "clip" keeps the sticky header working; "hidden" is the fallback for old browsers. */
body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } body { overflow-x: clip; } }
.entry-content { overflow-wrap: break-word; }
.entry-content img, .entry-content video, .entry-content iframe, .entry-content svg, .entry-content table, .entry-content section, .entry-content figure { max-width: 100%; }
.entry-content img, .entry-content video { height: auto; }
.entry-content table { display: block; overflow-x: auto; }
.entry-content pre { overflow-x: auto; }
.reader-title, .reader-head .breadcrumbs, .entry-content h1, .entry-content h2, .entry-content h3 { overflow-wrap: anywhere; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-main);
	background: var(--bg-light-yellow);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand-cyan-ink); }
button { font: inherit; }

.ral-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 8px; left: 8px; z-index: 1000;
	padding: 10px 16px;
	background: var(--brand-yellow); color: var(--brand-dark);
	border-radius: var(--radius);
	font-weight: 700;
}
:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 2px; }

.c-yellow { color: var(--brand-yellow); }
.c-cyan { color: var(--brand-cyan); }

.icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px;
	border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: var(--white);
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }

.btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--brand-dark);
	color: var(--white);
	font-weight: 700;
	text-decoration: none;
}
.btn:hover { background: var(--brand-cyan-ink); }

/* ==========================================================================
   3. App layout – the document scrolls (better for mobile browsers,
      AdSense, lazy-loading and the plugin's fullscreen mode)
   ========================================================================== */
.app-wrapper {
	display: flex;
	min-height: 100vh;
	min-height: 100dvh;
}

.main-col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.main-content {
	flex: 1;
	background: var(--bg-light-yellow);
	outline: none;
}

/* ==========================================================================
   4. Sidebar
   ========================================================================== */
.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
	width: var(--sidebar-width);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: var(--brand-dark);
	color: var(--white);
	border-right: 1px solid rgba(255, 255, 255, 0.06);
	transition: width 0.2s ease;
	z-index: 30;
}

.sidebar-logo {
	padding: 18px 18px 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	min-height: var(--topbar-h);
	display: flex;
	align-items: center;
}
.sidebar-logo img.custom-logo { max-height: 48px; width: auto; }

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--white);
	min-width: 0;
}
.brand-mark { width: 46px; height: auto; flex-shrink: 0; }
.brand-word {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.3px;
	white-space: nowrap;
}
.brand-word b { font-weight: 800; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 0; }

.sidebar-menu,
.sidebar-menu .sub-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu .sub-menu a { padding-left: 54px; font-size: 14px; }
.sidebar-menu .sub-menu .ral-icon { display: none; }

.sidebar-menu a,
.sidebar-footer a,
.sidebar-toggle {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 12px 22px;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	font-weight: 700;
	border: 0;
	border-left: 4px solid transparent;
	background: none;
	cursor: pointer;
	text-align: left;
	white-space: nowrap;
	transition: background 0.2s, color 0.2s;
}
.sidebar-menu a:hover,
.sidebar-menu a.active,
.sidebar-toggle:hover {
	color: var(--white);
	background: rgba(255, 255, 255, 0.06);
	border-left-color: var(--brand-cyan);
}
.sidebar-menu a.active .ral-icon { color: var(--brand-cyan); }

.sidebar-footer {
	padding: 10px 0 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-footer a { color: var(--brand-yellow); }
.sidebar-toggle { font-weight: 600; color: rgba(255, 255, 255, 0.5); }

/* Collapsed (icon rail) */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .sidebar .menu-label,
.sidebar-collapsed .sidebar .brand-word,
.sidebar-collapsed .sidebar .sub-menu { display: none; }
.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 14px 8px; }
.sidebar-collapsed .sidebar-logo img.custom-logo { max-width: 52px; }
.sidebar-collapsed .sidebar-menu a,
.sidebar-collapsed .sidebar-footer a,
.sidebar-collapsed .sidebar-toggle { justify-content: center; padding: 14px 0; }
.sidebar-collapsed .sidebar-toggle .ral-icon { transform: scaleX(-1); }

/* ==========================================================================
   5. Top bar
   ========================================================================== */
.top-nav {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: var(--topbar-h);
	padding: 10px 32px;
	padding-top: max(10px, env(safe-area-inset-top));
	background: var(--brand-dark);
	color: var(--white);
}

.top-brand { display: none; }
.top-brand .brand-mark { width: 38px; }
.top-brand .brand-word { font-size: 18px; }

.top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.top-title-series {
	font-size: 12px;
	color: var(--brand-yellow);
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.top-title-text {
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-bar {
	display: flex;
	margin-left: auto;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	overflow: hidden;
}
.ral-reader .search-bar { margin-left: 0; }
.search-bar input {
	width: 260px;
	padding: 9px 16px;
	border: 0;
	outline: none;
	background: transparent;
	color: var(--white);
	font: inherit;
	font-size: 15px;
}
.search-bar input::placeholder { color: rgba(255, 255, 255, 0.55); }
.search-bar input::-webkit-search-cancel-button { filter: invert(1); }
.search-bar button {
	display: inline-flex; align-items: center;
	padding: 0 16px;
	border: 0;
	background: var(--brand-cyan);
	color: var(--brand-dark);
	cursor: pointer;
}
.search-toggle { display: none; }

.user-profile {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--white);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.user-avatar {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: var(--brand-yellow);
	color: var(--brand-dark);
	font-weight: 800;
}

/* ==========================================================================
   6. Home – hero (dark)
   ========================================================================== */
.hero-section {
	background: var(--brand-dark);
	color: var(--white);
	padding: 18px 32px 36px;
}
.section-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 20px;
}
.section-title-dark {
	font-size: 28px;
	font-weight: 800;
	margin: 0 0 4px;
	line-height: 1.25;
}
.section-subtitle {
	margin: 0;
	color: rgba(255, 255, 255, 0.65);
	font-size: 15px;
}
.row-arrows { display: flex; gap: 8px; }
.home-intro { max-width: 760px; margin: 0 0 22px; }
.home-intro h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; font-weight: 800; color: var(--white); }
.home-intro p { margin: 0; color: rgba(255, 255, 255, 0.75); font-size: 16px; line-height: 1.55; }
.home-about { margin: 40px auto 10px; padding: 26px 28px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--line); }
.home-about h2 { margin: 0 0 10px; color: var(--brand-dark); font-size: 22px; }
.home-about p { margin: 0 0 12px; line-height: 1.7; }
.home-about-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0 !important; }
.home-about-links .btn { text-decoration: none; font-weight: 800; }
@media (max-width: 860px) {
	.home-intro h1 { font-size: 22px; }
	.home-intro p { font-size: 14px; }
	.home-about { margin: 28px 12px 10px; padding: 20px; }
}

.popular-books-row {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 12px;
	scroll-padding-left: 0;
	scrollbar-width: thin;
	scrollbar-color: var(--brand-cyan) transparent;
}
.popular-books-row::-webkit-scrollbar { height: 6px; }
.popular-books-row::-webkit-scrollbar-thumb { background: var(--brand-cyan); border-radius: 3px; }

.hero-book-card {
	display: flex;
	flex: 0 0 320px;
	scroll-snap-align: start;
	background: rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-lg);
	overflow: hidden;
	color: var(--white);
	text-decoration: none;
	transition: transform 0.25s, background 0.25s;
}
.hero-book-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.11); }
.hero-book-cover {
	width: 120px;
	height: 180px;
	flex-shrink: 0;
	object-fit: cover;
	background: #24476b;
}
.hero-book-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 16px;
}
.hero-book-series {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--brand-cyan);
	margin-bottom: 4px;
}
.hero-book-title {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.hero-book-author { font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.hero-book-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.hero-book-read {
	display: inline-flex; align-items: center; gap: 2px;
	font-size: 11px;
	font-weight: 800;
	color: var(--brand-yellow);
}

/* ==========================================================================
   7. Light sections, rows, grids, cards
   ========================================================================== */
.levels-section { padding: 32px; }

.section-title-light {
	font-size: 24px;
	font-weight: 800;
	color: var(--brand-dark);
	margin: 0 0 4px;
}
.levels-section > .section-subtitle { color: var(--text-muted); margin-bottom: 24px; }

.level-row, .related { margin-bottom: 36px; }
.level-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}
.level-title {
	display: flex; align-items: center; gap: 8px;
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--brand-dark);
}
.level-title .count {
	font-size: 12px;
	font-weight: 700;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--line);
	color: var(--text-muted);
}
.level-desc { margin: -6px 0 14px; color: var(--text-muted); font-size: 14px; }
.view-more {
	display: inline-flex; align-items: center; gap: 2px;
	border: 0; background: none; cursor: pointer;
	font-size: 14px;
	font-weight: 800;
	color: var(--brand-cyan-ink);
	text-decoration: none;
	white-space: nowrap;
}

.book-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 22px 18px;
}

.book-card {
	display: flex;
	flex-direction: column;
	color: var(--text-main);
	text-decoration: none;
}
.book-cover-wrap { position: relative; margin-bottom: 10px; }
.book-cover {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	border-radius: var(--radius);
	background: #e7dcc0;
	box-shadow: var(--shadow);
	transition: transform 0.25s, box-shadow 0.25s;
}
.book-card:hover .book-cover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(20, 47, 77, 0.2); }
.cover-play {
	position: absolute;
	right: 8px; bottom: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px;
	border-radius: 50%;
	background: var(--brand-yellow);
	color: var(--brand-dark);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transform: scale(0.8);
	transition: opacity 0.2s, transform 0.2s;
}
.book-card:hover .cover-play,
.book-card:focus-visible .cover-play { opacity: 1; transform: none; }

.badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.6;
}
.badge-level { background: var(--brand-yellow); color: var(--brand-dark); }
.book-cover-wrap .badge { position: absolute; left: 8px; top: 8px; }

.book-title {
	margin: 0;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--brand-dark);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.book-writer { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }

/* Generated cover when a book has no featured image */
.cover-placeholder {
	display: flex;
	align-items: flex-end;
	padding: 14px;
	background: linear-gradient(150deg, var(--brand-cyan) 0%, #7ec48c 50%, var(--brand-yellow) 100%);
	color: var(--brand-dark);
	font-weight: 800;
	font-size: 15px;
	line-height: 1.25;
}
.hero-book-cover.cover-placeholder { font-size: 13px; }

/* Series cards */
.series-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}
.series-card {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 10px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	text-decoration: none;
	color: var(--text-main);
	transition: box-shadow 0.2s, transform 0.2s;
}
.series-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.series-cover {
	width: 64px; height: 96px;
	flex-shrink: 0;
	object-fit: cover;
	border-radius: 8px;
}
.series-cover.cover-placeholder { font-size: 10px; padding: 6px; }
.series-info h3 { margin: 0 0 2px; font-size: 16px; color: var(--brand-dark); line-height: 1.3; }
.series-info p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Horizontal rows on small screens (app feel) */
@media (max-width: 860px) {
	.book-grid-scroll {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 16px;
		gap: 14px;
		margin: 0 -16px;
		padding: 0 16px 8px;
		scrollbar-width: none;
	}
	.book-grid-scroll::-webkit-scrollbar { display: none; }
	.book-grid-scroll .book-card { flex: 0 0 38%; max-width: 170px; scroll-snap-align: start; }
}

/* ==========================================================================
   8. Archive / search / pages
   ========================================================================== */
.archive-head {
	background: var(--brand-dark);
	color: var(--white);
	padding: 18px 32px 30px;
}
.eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--brand-yellow);
}
.archive-title { margin: 2px 0 6px; font-size: 30px; font-weight: 800; line-height: 1.2; }
.archive-desc { max-width: 760px; color: rgba(255, 255, 255, 0.75); }
.archive-desc p { margin: 0 0 8px; }
.archive-count { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.6); }

.navigation.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.nav-links .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	color: var(--brand-dark);
	font-weight: 700;
	text-decoration: none;
}
.nav-links .page-numbers.current { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--white); }
.nav-links .page-numbers.dots { background: none; border: 0; }

.page-wrap { max-width: 880px; margin: 0 auto; padding: 32px; }
.page-title { font-size: 30px; font-weight: 800; color: var(--brand-dark); margin: 0 0 18px; line-height: 1.25; }

.empty-note, .admin-hint { color: var(--text-muted); }
.hero-section .empty-note { color: rgba(255, 255, 255, 0.6); }
.admin-hint {
	padding: 10px 14px;
	border: 1px dashed var(--brand-cyan-ink);
	border-radius: var(--radius);
	font-size: 14px;
}
.empty-state.center { text-align: center; }
.big-404 { font-size: 88px; font-weight: 800; color: var(--brand-yellow); margin: 0; line-height: 1; }
.empty-state .search-form { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.empty-state .search-field { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; min-width: 0; }
.empty-state .search-submit { padding: 10px 18px; border: 0; border-radius: 999px; background: var(--brand-cyan-ink); color: #fff; font-weight: 700; cursor: pointer; }

/* ==========================================================================
   9. Reader (single post)
   ========================================================================== */
.reader { padding: 24px 32px 40px; }
.reader-head { max-width: 1100px; margin: 0 auto 18px; }
.reader-title { margin: 0 0 10px; font-size: 30px; font-weight: 800; color: var(--brand-dark); line-height: 1.25; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	color: var(--brand-dark);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}
.chip:hover { border-color: var(--brand-cyan-ink); }
.chip-level { background: var(--brand-yellow); border-color: var(--brand-yellow); }
.chip-series { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--white); }

/* The book (plugin shortcode) uses the full width; normal text stays readable. */
.reader-content { max-width: 1100px; margin: 0 auto; }
.entry-content { font-size: 18px; line-height: 1.8; }
.reader-content > p,
.reader-content > h2,
.reader-content > h3,
.reader-content > h4,
.reader-content > ul,
.reader-content > ol,
.reader-content > blockquote,
.reader-content > .wp-block-table { max-width: 760px; margin-left: auto; margin-right: auto; }
.entry-content h2, .entry-content h3 { color: var(--brand-dark); line-height: 1.3; }
.entry-content blockquote {
	margin: 1.4em auto;
	padding: 4px 18px;
	border-left: 4px solid var(--brand-yellow);
	color: var(--text-muted);
}
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content td, .entry-content th { border: 1px solid var(--line); padding: 8px 10px; }

.chapter-nav {
	max-width: 1100px;
	margin: 28px auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.chapter-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	color: var(--brand-dark);
	text-decoration: none;
	font-weight: 800;
	line-height: 1.3;
	transition: box-shadow 0.2s;
}
.chapter-link:hover { box-shadow: var(--shadow); }
.chapter-link small { display: block; font-weight: 700; font-size: 12px; color: var(--text-muted); }
.chapter-link.next { justify-content: flex-end; text-align: right; grid-column: 2; }
.chapter-link.next { background: var(--brand-dark); color: var(--white); border-color: var(--brand-dark); }
.chapter-link.next small { color: var(--brand-yellow); }

.chapter-list {
	max-width: 1100px;
	margin: 0 auto 32px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 4px 18px;
}
.chapter-list summary {
	display: flex; align-items: center; gap: 8px;
	padding: 12px 0;
	font-weight: 800;
	color: var(--brand-dark);
	cursor: pointer;
}
.chapter-list ol { margin: 0 0 14px; padding-left: 26px; columns: 2 260px; column-gap: 28px; }
.chapter-list li { padding: 3px 0; break-inside: avoid; }
.chapter-list a { color: var(--text-main); text-decoration: none; }
.chapter-list a:hover { color: var(--brand-cyan-ink); }
.chapter-list li.current a { font-weight: 800; color: var(--brand-cyan-ink); }

.related { max-width: 1100px; margin: 0 auto 36px; }

/* ==========================================================================
   10. Widget areas (AdSense etc.)
   ========================================================================== */
.widget-area { padding: 0 32px; }
.reader .widget-area,
.levels-section .widget-area { padding: 0; }
.ad-slot { max-width: 1100px; margin: 18px auto; text-align: center; min-height: 1px; }
.ral-widget + .ral-widget { margin-top: 16px; }
.ral-widget-title { font-size: 16px; color: var(--brand-dark); }

/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer {
	padding: 22px 32px;
	padding-bottom: max(22px, env(safe-area-inset-bottom));
	background: var(--brand-darker);
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	text-align: center;
}
.footer-menu {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 22px;
}
.footer-menu a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 600; }
.footer-menu a:hover { color: var(--brand-yellow); }
.copyright { margin: 0; }

/* ==========================================================================
   12. Mobile tab bar
   ========================================================================== */
.tab-bar { display: none; }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.top-nav { padding-left: 20px; padding-right: 20px; }
	.hero-section, .levels-section, .archive-head, .reader { padding-left: 20px; padding-right: 20px; }
	.search-bar input { width: 200px; }
}

@media (max-width: 860px) {
	body { font-size: 15px; }

	.sidebar { display: none; }

	.top-nav { min-height: 56px; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); flex-wrap: wrap; }
	.top-brand { display: block; flex: 1; min-width: 0; }
	.user-name { display: none; }
	.user-avatar { width: 34px; height: 34px; }
	.search-toggle { display: inline-flex; }

	.search-bar { display: none; order: 10; width: 100%; margin: 4px 0 2px; }
	.search-open .search-bar { display: flex; }
	.search-bar input { flex: 1; width: auto; }

	.hero-section, .levels-section, .archive-head { padding-left: 16px; padding-right: 16px; }
	.hero-section { padding-top: 8px; padding-bottom: 24px; }
	.section-title-dark { font-size: 22px; }
	.section-subtitle { font-size: 14px; }
	.row-arrows { display: none; }
	.hero-book-card { flex-basis: 84%; }
	.hero-book-cover { width: 100px; height: 150px; }

	.levels-section { padding-top: 22px; }
	.section-title-light { font-size: 20px; }
	.level-title { font-size: 18px; }
	.book-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px 12px; }
	.book-title { font-size: 14px; }
	.cover-play { opacity: 1; transform: none; width: 30px; height: 30px; }

	.archive-title, .page-title { font-size: 24px; }
	.page-wrap { padding: 22px 16px; }

	/* Reader: give the book the whole width */
	.reader { padding: 14px 0 28px; }
	.reader-head, .chapter-nav, .chapter-list, .related, .reader .ad-slot { margin-left: 12px; margin-right: 12px; }
	.reader-title { font-size: 22px; }
	.reader-content > p,
	.reader-content > h2,
	.reader-content > h3,
	.reader-content > h4,
	.reader-content > ul,
	.reader-content > ol,
	.reader-content > blockquote { padding: 0 16px; }
	.entry-content { font-size: 17px; padding: 0 12px; }
	.reader-content.entry-content { padding: 0; } /* the read-along book stays full width; its text has its own 16px */
	.chapter-nav { grid-template-columns: 1fr; }
	.chapter-link.next { grid-column: 1; }

	/* Bottom tab bar */
	body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
	.tab-bar {
		display: block;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 45;
		background: var(--brand-dark);
		border-top: 1px solid rgba(255, 255, 255, 0.08);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.tab-menu {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		height: var(--tabbar-h);
	}
	.tab-menu li { flex: 1; min-width: 0; }
	.tab-menu li:nth-child(n+6) { display: none; }
	.tab-menu a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		height: 100%;
		color: rgba(255, 255, 255, 0.6);
		text-decoration: none;
		font-size: 11px;
		font-weight: 700;
	}
	.tab-menu .menu-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.tab-menu a.active { color: var(--brand-yellow); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   15. v3.1 – admin bar, new releases, badges, breadcrumbs
   ========================================================================== */
.admin-bar .top-nav { top: 32px; }
.admin-bar .sidebar { top: 32px; height: calc(100vh - 32px); height: calc(100dvh - 32px); }
@media (max-width: 782px) { .admin-bar .top-nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .top-nav { top: 0; } }

.hero-block { margin-bottom: 30px; }
.new-books-row {
	display: flex;
	gap: 18px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 12px;
	scrollbar-width: thin;
	scrollbar-color: var(--brand-cyan) transparent;
}
.new-books-row::-webkit-scrollbar { height: 6px; }
.new-books-row::-webkit-scrollbar-thumb { background: var(--brand-cyan); border-radius: 3px; }
.new-books-row .book-card { flex: 0 0 150px; scroll-snap-align: start; }
.book-card.is-dark .book-title { color: var(--white); }
.book-card.is-dark .book-writer { color: rgba(255, 255, 255, 0.6); }
.book-card.is-dark .book-cover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }

.book-cover-wrap .badge-new { left: auto; right: 8px; top: 8px; background: var(--brand-cyan); color: var(--brand-dark); text-transform: uppercase; letter-spacing: 0.5px; }
.book-cover-wrap .badge-lock {
	left: auto; right: 8px; top: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; padding: 0;
	background: var(--brand-dark); color: var(--brand-yellow);
}
.book-cover-wrap .badge-new + .badge-lock { top: 38px; }
.badge-lock-inline { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-yellow); color: var(--brand-dark); }

.breadcrumbs { font-size: 13px; margin-bottom: 8px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li { color: var(--text-muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--text-muted); }
.breadcrumbs a { color: var(--brand-cyan-ink); text-decoration: none; font-weight: 700; }
.breadcrumbs li[aria-current] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.archive-head .breadcrumbs li, .archive-head .breadcrumbs li + li::before { color: rgba(255, 255, 255, 0.55); }
.archive-head .breadcrumbs a { color: var(--brand-cyan); }

.chip-lock { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-yellow); }

/* ==========================================================================
   16. About this book, FAQ, paywall
   ========================================================================== */
.about-book {
	max-width: 1100px;
	margin: 24px auto 32px;
	padding: 22px 24px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
}
.about-title { margin: 0 0 8px; font-size: 22px; color: var(--brand-dark); }
.about-summary { margin: 0 0 10px; font-size: 17px; }
.about-moral { margin: 0 0 14px; padding: 8px 14px; border-left: 4px solid var(--brand-yellow); background: #fff7df; border-radius: 0 8px 8px 0; }
.about-sub { margin: 20px 0 8px; font-size: 16px; color: var(--brand-dark); }
.facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px 20px;
	margin: 0;
}
.facts div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.facts dt { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; color: var(--brand-dark); }
.word-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips li { padding: 4px 12px; border-radius: 8px; background: #e6f7f5; color: var(--brand-cyan-ink); font-weight: 700; font-size: 14px; }

.faq details {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--white);
	margin-bottom: 8px;
	padding: 0 14px;
}
.faq summary { padding: 12px 0; font-weight: 800; color: var(--brand-dark); cursor: pointer; }
.faq details p { margin: 0 0 12px; }

.paywall {
	display: flex;
	gap: 28px;
	align-items: center;
	padding: 28px;
	border-radius: var(--radius-lg);
	background: var(--brand-dark);
	color: var(--white);
	max-width: 1100px;
	margin: 0 auto;
}
.paywall-cover { width: 180px; flex-shrink: 0; }
.paywall-cover .book-cover { filter: saturate(0.85); }
.paywall-icon { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; background: var(--brand-yellow); color: var(--brand-dark); }
.paywall h2 { margin: 12px 0 6px; font-size: 26px; color: var(--white) !important; }
.paywall p { margin: 0 0 18px; color: rgba(255, 255, 255, 0.8); font-size: 17px; }
.paywall-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   17. Buttons, forms, notices
   ========================================================================== */
.btn { border: 0; cursor: pointer; font-size: 15px; line-height: 1.4; text-align: center; }
.btn-primary { background: var(--brand-dark); color: var(--white); }
.btn-yellow { background: var(--brand-yellow); color: var(--brand-dark); }
.btn-yellow:hover { background: #ffd060; color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand-dark); }
.btn-ghost:hover { color: var(--white); }
.btn-ghost-light { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
.btn-block { display: block; width: 100%; }

.ral-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 14px; font-weight: 800; color: var(--brand-dark); }
.field input, .field select, .field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid #e2d6b8;
	border-radius: var(--radius);
	background: var(--white);
	font: inherit;
	color: var(--text-main);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand-cyan-ink); box-shadow: 0 0 0 3px rgba(46, 200, 188, 0.25); }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 46px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 6px; }
.pass-toggle.is-on { color: var(--brand-cyan-ink); }
.pass-toggle > span { display: inline-flex; }
.pass-toggle .pass-hide, .pass-toggle.is-on .pass-show { display: none; }
.pass-toggle.is-on .pass-hide { display: inline-flex; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-notice { padding: 12px 14px; border-radius: var(--radius); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.form-notice.is-error { background: #fdecea; color: #a12622; border: 1px solid #f5c2bd; }
.form-notice.is-success { background: #e6f7f5; color: #0a6b63; border: 1px solid #b4e6e0; }
.notice-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--line); }
.notice-box p { margin: 0; }
.notice-box.is-ok { background: #e6f7f5; border-color: #b4e6e0; color: #0a6b63; font-weight: 700; justify-content: center; flex-wrap: wrap; }

.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 18px; color: var(--brand-dark); }

/* ==========================================================================
   18. Auth (login / password)
   ========================================================================== */
.auth-wrap { display: flex; justify-content: center; padding: 48px 16px; }
.auth-card {
	width: 100%;
	max-width: 440px;
	background: var(--white);
	border-radius: 20px;
	box-shadow: 0 18px 50px rgba(20, 47, 77, 0.14);
	padding: 32px 28px;
}
.auth-brand { display: flex; justify-content: center; margin-bottom: 6px; }
.auth-title { margin: 0; text-align: center; font-size: 26px; color: var(--brand-dark); }
.auth-sub { text-align: center; color: var(--text-muted); margin: 6px 0 20px; }
.auth-foot { text-align: center; margin: 20px 0 0; font-size: 15px; }
.auth-foot a { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* ==========================================================================
   19. Account, contact, legal, pricing, library
   ========================================================================== */
.page-wrap.account { max-width: 1100px; }
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.account-head .page-title { margin: 0; }
.account-head p { margin: 0; }
.user-avatar.big { width: 64px; height: 64px; font-size: 28px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.membership-card.is-active { border-color: var(--brand-yellow); box-shadow: inset 0 4px 0 var(--brand-yellow); }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--line); font-weight: 800; font-size: 14px; margin: 0 0 6px; }
.status.ok { background: #e6f7f5; color: #0a6b63; }
.status.bad { background: #fdecea; color: #a12622; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--brand-dark); }
.account-foot { margin-top: 24px; font-size: 14px; }
.account-foot a { color: var(--text-muted); }

.page-wrap:has(.contact-grid) { max-width: 1100px; }
.contact-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.contact-side { display: flex; flex-direction: column; gap: 14px; }
.contact-side p { margin: 0 0 6px; }

.legal .entry-content { font-size: 17px; }
.legal .entry-content h2 { margin-top: 1.8em; scroll-margin-top: 90px; }
.toc { margin: 16px 0 24px; }
.toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2 220px; }
.toc a { text-decoration: none; }
.legal-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }

.pricing-hero { background: var(--brand-dark); color: var(--white); text-align: center; padding: 30px 20px 40px; }
.pricing-hero .eyebrow { margin-bottom: 4px; }
.pricing-intro { max-width: 620px; margin: 0 auto; color: rgba(255, 255, 255, 0.8); font-size: 17px; }
.pricing-hero .notice-box { max-width: 620px; margin: 16px auto 0; }
.plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 18px;
	max-width: 1100px;
	margin: -10px auto 0;
	align-items: stretch;
}
.plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 24px 20px;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
}
.plan.is-featured { border: 3px solid var(--brand-yellow); transform: translateY(-6px); }
.plan-flag { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 3px 14px; border-radius: 999px; background: var(--brand-yellow); color: var(--brand-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.plan h2 { margin: 0; font-size: 20px; color: var(--brand-dark); }
.price { margin: 8px 0 2px; font-size: 34px; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.price small { font-size: 14px; font-weight: 700; color: var(--text-muted); }
.plan-note { margin: 0; font-size: 14px; color: var(--brand-cyan-ink); font-weight: 700; }
.checks { list-style: none; margin: 16px 0 20px; padding: 0; flex: 1; }
.checks li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 15px; }
.checks .ral-icon { color: var(--brand-cyan-ink); margin-top: 3px; }
.pay-methods { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; margin: 26px auto; max-width: 760px; }
.pricing-faq { max-width: 760px; margin: 0 auto; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 34px; }
.tile {
	display: flex; flex-direction: column; gap: 6px;
	padding: 18px;
	border-radius: var(--radius-lg);
	background: var(--brand-dark);
	color: var(--white);
	text-decoration: none;
	transition: transform 0.2s;
}
.tile:hover { transform: translateY(-3px); }
.tile .ral-icon { color: var(--brand-yellow); }
.tile strong { font-size: 20px; }
.tile span { font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.levels-section .series-grid, .levels-section > .chips { margin-bottom: 34px; }
.levels-section > .section-title-light { margin-bottom: 14px; }

.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 0 0 8px; }
.legal-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.legal-links a:hover { color: var(--brand-yellow); }

.app-page { max-width: 1100px; }

@media (max-width: 860px) {
	.new-books-row .book-card { flex-basis: 34%; max-width: 150px; }
	.paywall { flex-direction: column; text-align: center; padding: 22px 18px; margin: 0 12px; }
	.paywall-cover { width: 130px; }
	.paywall-actions { justify-content: center; }
	.about-book { margin-left: 12px; margin-right: 12px; padding: 18px 16px; }
	.contact-grid { grid-template-columns: 1fr; }
	.field-2 { grid-template-columns: 1fr; }
	.auth-wrap { padding: 20px 12px; }
	.auth-card { padding: 24px 18px; box-shadow: 0 8px 24px rgba(20, 47, 77, 0.1); }
	.plan.is-featured { transform: none; }
	.plans { margin-top: 0; }
}

/* ==========================================================================
   20. v3.2 – menu separator, reader actions, share sheet, toast
   ========================================================================== */
.menu-sep { margin: 12px 22px 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); }
.sidebar-collapsed .menu-sep { margin: 8px 14px; padding-top: 0; }
.sidebar-collapsed .menu-sep .menu-label { display: none; }
.tab-menu .menu-sep { display: none; }

.book-actions {
	max-width: 1100px;
	margin: 18px auto 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.act {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	border: 2px solid var(--line);
	background: var(--bg-card);
	color: var(--brand-dark);
	font-weight: 800;
	font-size: 15px;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.act:hover { border-color: var(--brand-cyan-ink); }
.act:disabled { opacity: 0.6; }
.act-done { margin-right: auto; background: var(--brand-dark); border-color: var(--brand-dark); color: var(--white); }
.act-done .act-on, .act-done.is-on .act-off { display: none; }
.act-done.is-on .act-on { display: inline; }
.act-done.is-on { background: #e6f7f5; border-color: #9fdcd5; color: #0a6b63; }
.act-done small { font-weight: 700; opacity: 0.75; margin-left: 4px; }
.act-done .act-check, .act-done .act-lock { display: inline-flex; }
.act-done:not(.is-locked) .act-lock, .act-done.is-locked .act-check { display: none; }
.act-done.is-locked { background: #e9e4d6; border-color: #e9e4d6; color: #8a8270; cursor: not-allowed; }
.act-done.is-locked:hover { border-color: #d8d0bc; }
.act.is-shake { animation: ral-shake 0.4s; }
@keyframes ral-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.act-fav.is-on { color: #d6336c; border-color: #f3b4c9; background: #fff0f5; }
.act-fav.is-on .ral-icon { fill: currentColor; }
.act-login-hint { max-width: 1100px; margin: 10px auto 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.top-share { margin-left: auto; }
.ral-reader .search-bar { margin-left: 0; }

.ral-toast {
	position: fixed;
	left: 50%;
	bottom: calc(24px + env(safe-area-inset-bottom));
	z-index: 100;
	transform: translate(-50%, 20px);
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--brand-dark);
	color: var(--white);
	font-weight: 700;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	max-width: calc(100vw - 32px);
	text-align: center;
}
.ral-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .ral-toast { bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); } }

.share-sheet {
	width: min(520px, calc(100vw - 24px));
	border: 0;
	border-radius: 20px;
	padding: 22px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	color: var(--text-main);
}
.share-sheet::backdrop { background: rgba(15, 36, 60, 0.6); }
.share-sheet h2 { margin: 0 0 12px; color: var(--brand-dark); font-size: 22px; }
.share-close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.share-close { background: var(--bg-light-yellow); color: var(--brand-dark); }
.share-preview { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 14px; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.share-btn {
	display: flex; align-items: center; gap: 8px;
	padding: 10px;
	border-radius: 12px;
	background: var(--bg-light-yellow);
	color: var(--brand-dark);
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
}
.share-btn:hover { background: var(--line); }
.share-dot { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; background: var(--brand-dark); flex-shrink: 0; }
.share-facebook .share-dot { background: #1877f2; }
.share-x .share-dot { background: #111; }
.share-whatsapp .share-dot { background: #25d366; }
.share-telegram .share-dot { background: #27a7e7; }
.share-pinterest .share-dot { background: #e60023; }
.share-copy { display: flex; gap: 8px; margin-bottom: 10px; }
.share-copy input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid #e2d6b8; border-radius: var(--radius); font: inherit; font-size: 14px; background: var(--white); }
.share-copy .btn { white-space: nowrap; }

.book-cover-wrap .badge-done {
	position: absolute;
	left: 8px; top: auto; bottom: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 26px; padding: 0;
	background: var(--brand-cyan); color: var(--brand-dark);
}

/* ==========================================================================
   21. Author pages
   ========================================================================== */
.writer-hero { display: flex; align-items: center; gap: 26px; }
.writer-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 4px solid var(--brand-yellow); background: #24476b; }
.writer-initial { display: inline-flex; align-items: center; justify-content: center; font-size: 56px; font-weight: 800; color: var(--brand-yellow); }
.writer-photo.small { width: 72px; height: 72px; border-width: 3px; font-size: 28px; }
.writer-meta { margin: 0 0 6px; color: rgba(255, 255, 255, 0.75); font-weight: 700; }
.writer-known { margin: 0 0 6px; color: rgba(255, 255, 255, 0.85); }
.writer-bio { margin-bottom: 34px; font-size: 17px; max-width: 900px; }
.writer-bio .level-title { margin-bottom: 8px; }
.writer-mini {
	max-width: 1100px;
	margin: 0 auto 32px;
	display: flex; gap: 16px; align-items: flex-start;
	padding: 18px 20px;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
}
.writer-mini .about-sub { margin: 0 0 4px; }
.writer-mini p { margin: 0 0 6px; }
.writer-mini .writer-photo { background: var(--brand-dark); }
.writer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 34px; }
.writer-card {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 18px 12px;
	text-align: center;
	background: var(--bg-card);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	color: var(--brand-dark);
	text-decoration: none;
	transition: box-shadow 0.2s, transform 0.2s;
}
.writer-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.writer-card .writer-photo { background: var(--brand-dark); }

/* ==========================================================================
   22. My learning
   ========================================================================== */
.page-wrap.learning { max-width: 1100px; }
.learning-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow-ink { color: var(--brand-cyan-ink); }
.learning-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.goal-card { display: flex; gap: 20px; align-items: center; }
.goal-ring { position: relative; flex-shrink: 0; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--brand-cyan-ink); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.6s; }
.ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring-num strong { font-size: 34px; color: var(--brand-dark); }
.ring-num span { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.goal-body h2 { margin: 0 0 4px; font-size: 20px; color: var(--brand-dark); }
.goal-body p { margin: 0 0 12px; }
.goal-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-form input { width: 76px; padding: 9px 10px; border: 1.5px solid #e2d6b8; border-radius: var(--radius); font: inherit; font-weight: 800; text-align: center; }
.goal-form .btn { padding: 9px 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
	display: flex; flex-direction: column; gap: 2px;
	padding: 16px;
	border-radius: var(--radius-lg);
	background: var(--bg-card);
	border: 1px solid var(--line);
}
.stat strong { font-size: 26px; color: var(--brand-dark); line-height: 1.2; }
.stat span { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.stat .stat-ico { color: var(--brand-cyan-ink); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
.ral-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ral-chart .axis { stroke: #e6dcc4; stroke-width: 1; }
.ral-chart .bar path { fill: #8fd9d1; }
.ral-chart .bar.is-current path { fill: var(--brand-cyan-ink); }
.ral-chart .bar:hover path, .ral-chart .bar:focus path { fill: var(--brand-dark); }
.ral-chart .hit { fill: transparent; }
.ral-chart .bar:focus { outline: none; }
.ral-chart .bar:focus .hit { fill: rgba(46, 200, 188, 0.08); }
.ral-chart .lbl { font-size: 12px; fill: var(--text-muted); text-anchor: middle; font-weight: 700; }
.ral-chart .val { font-size: 13px; fill: var(--brand-dark); text-anchor: middle; font-weight: 800; }

.learning-block { margin-bottom: 34px; }
.learning-block > .level-title { margin-bottom: 14px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-tile {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 16px 10px;
	text-align: center;
	border-radius: var(--radius-lg);
	background: #f3eedf;
	color: #8b8574;
}
.badge-tile .badge-ico { display: inline-flex; width: 46px; height: 46px; border-radius: 50%; align-items: center; justify-content: center; background: #e6dfcb; }
.badge-tile strong { font-size: 15px; }
.badge-tile small { font-size: 12px; line-height: 1.3; }
.badge-tile.is-earned { background: var(--brand-dark); color: var(--white); }
.badge-tile.is-earned .badge-ico { background: var(--brand-yellow); color: var(--brand-dark); }
.badge-tile.is-earned small { color: rgba(255, 255, 255, 0.65); }

.history-month { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 16px; color: var(--brand-dark); }
.history-month .count, .learning-block .count { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--text-muted); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.history a { font-weight: 700; color: var(--brand-dark); text-decoration: none; }

.share-card { margin-bottom: 24px; }
.share-card .share-preview { max-width: 520px; margin: 16px 0 12px; }
.share-card .share-copy { max-width: 620px; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mini-stats div { display: flex; flex-direction: column; padding: 10px; border-radius: var(--radius); background: var(--bg-light-yellow); text-align: center; }
.mini-stats strong { font-size: 22px; color: var(--brand-dark); }
.mini-stats span { font-size: 12px; color: var(--text-muted); font-weight: 700; }

.achv-public { max-width: 900px; }
.achv-image { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); margin-bottom: 18px; box-shadow: var(--shadow); }
.achv-public .stat-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.achv-public .badge-grid { margin-bottom: 24px; }
.achv-cta { text-align: center; }
.achv-cta h2 { justify-content: center; }

@media (max-width: 860px) {
	.book-actions { margin: 14px 12px 0; }
	.act { padding: 10px 14px; }
	.act-done { flex: 1 1 100%; justify-content: center; margin-right: 0; }
	.act-fav, .act-share, .act-report { flex: 1 1 0; justify-content: center; padding: 10px 8px; font-size: 14px; }
	.act-report .act-long { display: none; }
	.act-report .act-short { display: inline; }
	.ral-toast { border-radius: 16px; }
	.act-login-hint { margin: 10px 12px 0; }
	.share-grid { grid-template-columns: repeat(2, 1fr); }
	.writer-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
	.writer-photo { width: 110px; height: 110px; }
	.writer-mini { margin-left: 12px; margin-right: 12px; }
	.learning-top, .chart-grid { grid-template-columns: 1fr; }
	.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
	.badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.badge-tile { padding: 12px 6px; }
	.badge-tile small { display: none; }
	.share-card .share-copy { flex-wrap: wrap; }
	.share-card .share-copy input { flex: 1 1 100%; }
	.share-card .share-copy .btn { flex: 1; }
	.goal-card { flex-direction: column; text-align: center; }
	.goal-form { justify-content: center; }
	.achv-public .stat-grid { grid-template-columns: repeat(3, 1fr); }
	.stat strong { font-size: 22px; }
	.top-share { margin-left: 0; }
}

/* ==========================================================================
   23. v3.3 – vocabulary stats (ReadAlong Book plugin)
   ========================================================================== */
.vocab-card { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.vocab-main { flex: 1; min-width: 0; }
.vocab-count { margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.vocab-count strong { font-size: 34px; line-height: 1; color: var(--brand-dark); }
.vocab-count span { font-weight: 700; color: var(--text-muted); }
.vocab-bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 6px; max-width: 520px; }
.vocab-bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand-cyan-ink); transition: width 0.6s; }
.vocab-card p.muted { margin: 0; }
.vocab-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.vocab-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

.menu-badge {
	margin-left: auto;
	padding: 1px 8px;
	border-radius: 999px;
	background: rgba(46, 200, 188, 0.18);
	color: var(--brand-cyan);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.6;
}
.sidebar-collapsed .menu-badge, .tab-menu .menu-badge { display: none; }

@media (max-width: 860px) {
	.vocab-card { flex-direction: column; align-items: stretch; gap: 14px; }
}

/* ==========================================================================
   24. v3.4 – sign up, Google button
   ========================================================================== */
.btn-google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 11px 16px;
	border: 1.5px solid #dadce0;
	border-radius: 999px;
	background: var(--white);
	color: #3c4043;
	font-weight: 800;
	font-size: 15px;
	text-decoration: none;
	transition: background 0.2s, box-shadow 0.2s;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); color: #3c4043; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check-block { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
.check-block input { margin-top: 3px; flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--brand-cyan-ink); }
.plan-note-muted { color: var(--text-muted); }
.consent-card { margin-bottom: 18px; border-color: var(--brand-yellow); box-shadow: inset 0 4px 0 var(--brand-yellow); }
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.user-avatar { overflow: hidden; }
.google-linked { margin-top: 10px; }

/* ==========================================================================
   25. v3.5 – Report errors
   ========================================================================== */
.act-report { color: var(--text-muted); }
.act-short { display: none; }
.act { white-space: nowrap; }
.act-report:hover { color: var(--brand-dark); }
.report-sheet { width: min(560px, calc(100vw - 24px)); }
.report-sheet .ral-form { gap: 12px; }
.report-sheet .field textarea { resize: vertical; min-height: 96px; }
.cf-turnstile { min-height: 65px; }

/* ==========================================================================
   26. v3.6 – sign-up popup
   ========================================================================== */
.join-sheet { width: min(440px, calc(100vw - 24px)); text-align: center; padding: 28px 24px 22px; }
.join-icon { display: inline-flex; width: 60px; height: 60px; border-radius: 50%; align-items: center; justify-content: center; background: var(--brand-yellow); color: var(--brand-dark); margin-bottom: 10px; }
.join-sheet h2 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; }
.join-text { margin: 0 0 14px; color: var(--text-muted); }
.join-perks { list-style: none; margin: 0 0 18px; padding: 12px 14px; text-align: left; background: var(--bg-light-yellow); border-radius: var(--radius); }
.join-perks li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.join-perks .ral-icon { color: var(--brand-cyan-ink); margin-top: 2px; }
.join-sheet .btn-google { margin-bottom: 10px; }
.join-email { display: block; }
.join-foot { margin: 14px 0 4px; font-size: 15px; }
.join-foot a { font-weight: 800; }
.join-legal { margin: 0; }

/* ==========================================================================
   13b. Library filters, onboarding, install banner (3.7)
   ========================================================================== */
.lib-filters { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 18px; }
.lib-search { display: flex; align-items: center; gap: 10px; position: relative; }
.lib-search > .ral-icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.lib-search input { flex: 1; min-width: 0; padding: 12px 14px 12px 42px; border: 1.5px solid #e2d6b8; border-radius: 999px; font: inherit; background: var(--white); }
.lib-search input:focus { outline: none; border-color: var(--brand-cyan-ink); box-shadow: 0 0 0 3px rgba(46, 200, 188, 0.25); }
.lib-toggle { display: none; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 16px; }
.lib-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; align-items: end; }
.lib-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-buttons .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
@media (min-width: 861px) { .lib-buttons .btn-primary { display: none; } }
.lib-active { margin: 0 0 18px; }
.chip-remove { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-dark); color: var(--white); border-color: var(--brand-dark); }
.chip-remove:hover { background: var(--brand-cyan-ink); color: var(--white); }
.lib-results { margin-bottom: 34px; }
.lib-results .level-header { align-items: baseline; }
.lib-results .section-title-light { margin: 0; }
.lib-results .empty-state { text-align: center; padding: 28px; }
@media (max-width: 860px) {
	.lib-toggle { display: inline-flex; }
	.lib-fields { display: none; grid-template-columns: 1fr 1fr; }
	.lib-filters.is-open .lib-fields { display: grid; }
	.lib-buttons { grid-column: 1 / -1; }
	.lib-buttons .btn { flex: 1; text-align: center; }
}

.onboard-sheet { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.onboard-sheet h2 { margin-top: 2px; }
.onboard-q { border: 0; padding: 0; margin: 18px 0 0; }
.onboard-q legend { font-weight: 800; color: var(--brand-dark); margin-bottom: 10px; padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); transition: border-color 0.15s, background 0.15s; }
.choice strong { color: var(--brand-dark); }
.choice small { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.choice:hover > span { border-color: #9fdcd5; }
.choice input:checked + span { border-color: var(--brand-cyan-ink); background: #e6f7f5; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46, 200, 188, 0.35); }
.onboard-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.onboard-actions .btn { border: 0; cursor: pointer; font: inherit; font-weight: 800; padding: 12px 24px; }
.btn-link { background: none; border: 0; padding: 6px; font: inherit; font-weight: 700; color: var(--text-muted); cursor: pointer; text-decoration: underline; }
.btn-link:hover { color: var(--brand-dark); }

.install-banner {
	position: fixed;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: 60;
	display: flex;
	align-items: center;
	gap: 12px;
	width: min(520px, calc(100vw - 20px));
	padding: 12px 12px 12px 14px;
	border-radius: 18px;
	background: var(--brand-dark);
	color: var(--white);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
	transform: translate(-50%, 24px);
	opacity: 0;
	transition: opacity 0.25s, transform 0.25s;
}
.install-banner.is-show { opacity: 1; transform: translate(-50%, 0); }
.install-banner[hidden], .install-banner [hidden] { display: none !important; }
.install-banner img { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; }
.install-text strong { font-size: 15px; }
.install-text span { color: rgba(255, 255, 255, 0.8); }
.ios-share { display: inline-flex; vertical-align: -3px; padding: 0 2px; color: var(--brand-cyan); }
.install-go { border: 0; cursor: pointer; font: inherit; font-weight: 800; padding: 9px 18px; flex-shrink: 0; }
.install-close { background: transparent; color: rgba(255, 255, 255, 0.75); flex-shrink: 0; }
.install-close:hover { color: var(--white); background: rgba(255, 255, 255, 0.1); }
@media (max-width: 860px) { .install-banner { bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); } }
.rab-fs-open .install-banner { display: none; }
.install-banner { cursor: default; }
.ios-guide { max-height: calc(100vh - 24px); overflow-y: auto; }
.ios-guide h2 { padding-right: 40px; font-size: 20px; line-height: 1.3; }
.ios-guide > .muted { margin: 0 0 14px; }
.ios-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: ios; }
.ios-steps.is-dim { opacity: 0.55; }
.ios-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--bg-light-yellow); counter-increment: ios; position: relative; }
.ios-steps li::before { content: counter(ios); position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-dark); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ios-steps li > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ios-steps strong { color: var(--brand-dark); }
.ios-steps small { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.ios-steps small[hidden], .ios-steps strong[hidden] { display: none; }
.ios-ico { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: var(--white); color: #0a7aff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ios-ico-add { font-weight: 800; font-size: 14px; }
.ios-inline { display: inline-flex; vertical-align: -5px; color: #0a7aff; }
.ios-warn { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin-bottom: 14px; border-radius: 14px; background: #fff0e6; border: 1.5px solid #f6c39f; }
.ios-warn strong { color: #b4430f; }
.ios-warn span { font-size: 14px; line-height: 1.45; }
.ios-warn .btn { align-self: flex-start; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.ios-arrow { display: flex; justify-content: center; margin-top: 12px; color: var(--brand-cyan-ink); animation: ral-bob 1.2s ease-in-out infinite; }
.ios-arrow[hidden] { display: none; }
@keyframes ral-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (max-width: 600px) { .ios-guide { margin-bottom: 12px; } }
.install-card .btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.install-card[hidden] { display: none; }
.privacy-choices[hidden] { display: none; }
.privacy-choices { display: contents; }

.act.is-pulse { animation: ral-pulse 1.2s ease-in-out 4; }
@keyframes ral-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 190, 47, 0.7); } 50% { box-shadow: 0 0 0 10px rgba(251, 190, 47, 0); } }
@media (prefers-reduced-motion: reduce) { .act.is-pulse { animation: none; outline: 3px solid var(--brand-yellow); } }

.vocab-due { margin: 0 0 4px; font-weight: 700; color: var(--brand-dark); text-align: center; }
.vocab-due strong { font-size: 22px; color: #c2410c; }
.vocab-due.is-clear { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--brand-cyan-ink); }
.menu-badge-due { background: #e4572e; color: var(--white); }
.pdf-card {
	max-width: 1100px;
	margin: 18px auto 0;
	display: flex;
	align-items: flex-start;
	gap: 18px;
	padding: 20px 22px;
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, #fff4d6 0%, #fdf8eb 60%, #e6f7f5 100%);
	border: 1.5px dashed #e8c66a;
}
.pdf-badge { position: relative; flex-shrink: 0; width: 52px; height: 62px; color: var(--brand-dark); }
.pdf-badge svg { width: 48px; height: 58px; display: block; }
.pdf-badge b { position: absolute; left: -6px; bottom: 10px; padding: 2px 6px; border-radius: 6px; background: #e4572e; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.3; }
.pdf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pdf-title { margin: 0; color: var(--brand-dark); font-size: 18px; font-weight: 800; line-height: 1.3; }
.pdf-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 12px 24px; text-decoration: none; box-shadow: 0 6px 16px rgba(251, 190, 47, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.pdf-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(251, 190, 47, 0.45); }
.pdf-note { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.45; }
@media (max-width: 860px) { .pdf-card { margin: 14px 12px 0; padding: 16px; gap: 14px; } }
@media (max-width: 600px) { .pdf-btn { width: 100%; justify-content: center; } .pdf-body { align-items: stretch; } }
.recommended-row { background: #fff4d6; border-radius: var(--radius-lg); padding: 16px 16px 6px; }

/* ==========================================================================
   13c. Chapter books (3.8)
   ========================================================================== */
.book-cover-wrap .badge-chapters {
	left: auto; right: 8px; top: auto; bottom: 8px;
	display: inline-flex; align-items: center; gap: 3px;
	background: rgba(20, 47, 77, 0.88); color: var(--white);
}
.series-new { color: var(--brand-cyan-ink); font-weight: 800; }
.series-info .progress { margin-top: 8px; }

.progress { height: 8px; border-radius: 999px; background: #eadfc4; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-cyan); transition: width 0.4s; }

.chapter-of { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 6px 12px; border-radius: 999px; background: var(--brand-dark); color: var(--white); font-size: 13px; font-weight: 800; text-decoration: none; max-width: 100%; }
.chapter-of span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-of:hover { background: var(--brand-cyan-ink); color: var(--white); }
.chapter-progress { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 0 0 12px; }
.chapter-progress .progress { flex: 1; }
.chapter-progress small { color: var(--text-muted); font-size: 12px; font-weight: 700; white-space: nowrap; }

.book-hero { max-width: 1100px; margin: 0 auto 24px; display: flex; gap: 28px; align-items: flex-start; }
.book-hero-cover { flex: 0 0 220px; }
.book-hero-cover .book-cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; box-shadow: 0 14px 30px rgba(20, 47, 77, 0.25); display: flex; }
.book-hero-info { flex: 1; min-width: 0; }
.book-hero-kicker { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; color: var(--brand-cyan-ink); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.book-hero-summary { margin: 12px 0 16px; font-size: 16px; line-height: 1.6; color: var(--text-main); max-width: 640px; }
.book-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; max-width: none; padding: 0; }
.book-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 13px 26px; text-decoration: none; box-shadow: 0 6px 16px rgba(251, 190, 47, 0.35); }
.chip-status { background: #fff4d6; border-color: #f0d68d; }
.chip-status.is-complete { background: #e6f7f5; border-color: #a9e2dc; color: var(--brand-cyan-ink); }

.book-chapters { max-width: 1100px; margin: 0 auto 28px; }
.chapter-rows { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; gap: 8px; }
.chapter-row a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line); color: var(--text-main); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.chapter-row a:hover { border-color: var(--brand-cyan); transform: translateX(2px); }
.ch-no { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff4d6; color: var(--brand-dark); font-weight: 800; font-size: 14px; }
.ch-title { flex: 1; min-width: 0; font-weight: 700; color: var(--brand-dark); }
.ch-min { flex-shrink: 0; color: var(--text-muted); font-size: 13px; }
.ch-state { flex-shrink: 0; display: inline-flex; color: var(--text-muted); }
.chapter-row.is-done .ch-no { background: var(--brand-cyan); }
.chapter-row.is-done .ch-state { color: var(--brand-cyan-ink); }
.chapter-row.is-locked .ch-title { color: var(--text-muted); }
.chapter-row.is-locked .ch-state { color: #b58500; }
.chapter-row.is-current a { border-color: var(--brand-dark); box-shadow: inset 4px 0 0 var(--brand-dark); }
.chapter-list .chapter-rows { margin: 0 0 14px; }
.reader-head .chapter-list { margin: 16px 0 0; }
@media (max-width: 860px) { .reader-head .chapter-list { margin-left: 0; margin-right: 0; } }

/* Story notes written in the post (e.g. "What happens in Chapter 1?") use the full reader width. */
.reader-content > section[style*="max-width"] { max-width: none !important; margin: 0 !important; }
@media (max-width: 860px) { .reader-content > section[style*="max-width"] { margin: 0 12px !important; } }

/* Back to top */
.to-top {
	position: fixed; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 44;
	width: 46px; height: 46px; border: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--brand-dark); color: var(--white); cursor: pointer;
	box-shadow: 0 8px 20px rgba(20, 47, 77, 0.3);
	opacity: 0; visibility: hidden; transform: translateY(12px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s, background 0.15s;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand-cyan-ink); }
.to-top:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 2px; }
@media (max-width: 860px) { .to-top { right: 14px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); width: 42px; height: 42px; } }
.rab-fs-open .to-top, body.has-install-banner .to-top { display: none; }
.book-description { max-width: 1100px; margin: 0 auto 24px; }

.chapter-next { max-width: 1100px; margin: 16px auto 0; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-lg); background: #e6f7f5; border: 1.5px solid #a9e2dc; }
.chapter-next[hidden] { display: none; }
.chapter-next-ico { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-cyan); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; }
.chapter-next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chapter-next-text strong { color: var(--brand-dark); }
.chapter-next-text span { color: var(--text-muted); font-size: 14px; }
.chapter-next .btn { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-weight: 800; text-decoration: none; }

.book-done-sheet { text-align: center; }
.book-done-sheet h2[hidden], .book-done-sheet p[hidden] { display: none; }
.book-done-cover { position: relative; width: 120px; margin: 6px auto 12px; }
.book-done-cover .book-cover { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; box-shadow: 0 10px 24px rgba(20, 47, 77, 0.25); }
.book-done-badge { position: absolute; right: -14px; bottom: -10px; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-yellow); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); animation: ral-pop 0.6s ease-out; }
@keyframes ral-pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.book-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.book-done-actions .btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }

.stat-grid-2 { margin: 14px 0 6px; }
.progress-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.progress-item { display: flex; gap: 14px; padding: 12px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--line); }
.progress-cover { flex-shrink: 0; width: 70px; }
.progress-cover .book-cover { width: 70px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; display: block; }
.progress-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.progress-body .progress { width: 100%; }
.progress-title { font-weight: 800; color: var(--brand-dark); text-decoration: none; }
.btn-small { padding: 8px 14px; font-size: 13px; font-weight: 800; text-decoration: none; }

@media (max-width: 700px) {
	.book-hero { flex-direction: column; align-items: center; text-align: center; padding: 0 12px; }
	.book-hero-cover { flex-basis: auto; width: 170px; }
	.book-hero .chips, .book-hero-actions { justify-content: center; }
	.book-hero .breadcrumbs ol { justify-content: center; }
	.book-hero-kicker { justify-content: center; }
	.book-hero .chapter-progress { margin: 0 auto 12px; }
	.book-chapters { padding: 0 12px; }
	.chapter-next { margin: 14px 12px 0; flex-wrap: wrap; }
	.chapter-next .btn { width: 100%; justify-content: center; }
	.ch-min { display: none; }
}


/* Vertical scrollbars (page + sidebar) in the brand cyan, like the book rows */
html { scrollbar-color: var(--brand-cyan) var(--brand-dark); }
.sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--brand-cyan) transparent; }
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--brand-dark); }
html::-webkit-scrollbar-thumb { background: var(--brand-cyan); border-radius: 5px; border: 2px solid var(--brand-dark); }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--brand-cyan); border-radius: 3px; }

/* What's new bell */
.notif { position: relative; flex-shrink: 0; }
.notif-btn { position: relative; }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--brand-dark); }
.notif-dot[hidden] { display: none; }
.notif.is-unread .notif-bell { display: inline-flex; transform-origin: 50% 10%; animation: ral-ring 4s ease-in-out 1s infinite; }
@keyframes ral-ring {
	0%, 18%, 100% { transform: rotate(0); }
	2% { transform: rotate(16deg); } 5% { transform: rotate(-14deg); } 8% { transform: rotate(10deg); }
	11% { transform: rotate(-8deg); } 14% { transform: rotate(4deg); } 16% { transform: rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) { .notif.is-unread .notif-bell { animation: none; } }
.notif-panel {
	position: absolute; right: -8px; top: calc(100% + 10px); z-index: 50;
	width: 340px; max-width: calc(100vw - 24px);
	background: var(--white); color: var(--text-main);
	border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25); overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-panel::before { content: ""; position: absolute; top: -6px; right: 22px; width: 14px; height: 14px; background: var(--white); transform: rotate(45deg); }
.notif-head { position: relative; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); color: var(--brand-dark); font-size: 16px; }
.notif-list { list-style: none; margin: 0; padding: 6px; }
.notif-list a { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; color: var(--text-main); text-decoration: none; }
.notif-list a:hover, .notif-list a:focus-visible { background: #fff4d6; }
.notif-list li.is-new a { background: #f0fbfa; }
.notif-list li.is-new a:hover { background: #fff4d6; }
.notif-thumb { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #e6f7f5; color: var(--brand-cyan-ink); display: flex; align-items: center; justify-content: center; }
.notif-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-text strong { color: var(--brand-dark); font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-text small { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-type { align-self: flex-start; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.02em; background: #e6f7f5; color: var(--brand-cyan-ink); }
.notif-type-chapter { background: #fff4d6; color: #9a6700; }
.notif-type-chapter_book { background: #e8eefc; color: #2f4fb3; }
.notif-all { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px; border-top: 1px solid var(--line); color: var(--brand-cyan-ink); font-weight: 800; font-size: 14px; text-decoration: none; }
.notif-all:hover { background: #f8f4e8; }
@media (max-width: 860px) {
	.notif { position: static; }
	.notif-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px); width: auto; max-width: none; }
	.notif-panel::before { display: none; }
}

/* ==========================================================================
   14. WordPress core classes
   ========================================================================== */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--text-muted); text-align: center; }
.sticky, .bypostauthor, .gallery-caption { /* required by theme check */ }

/* Email activation (3.8.9) */
.verify-sent { text-align: center; }
.verify-sent .verify-icon { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.verify-sent h2 { margin: 0 0 8px; font-size: 22px; }
.verify-sent p { margin: 0 0 10px; }
.verify-sent strong { word-break: break-all; }
.resend-form { text-align: left; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.resend-form .field span { font-size: 14px; }
.form-notice + .resend-form { border-top: 0; padding-top: 0; margin: 0 0 22px; }

/* Google-only sign-up (3.8.9) */
.auth-note { font-size: 14px; text-align: center; margin: 14px 0 0; }
.auth-more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.auth-more > summary { cursor: pointer; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-muted); list-style: none; }
.auth-more > summary::-webkit-details-marker { display: none; }
.auth-more > summary::after { content: " ▾"; }
.auth-more[open] > summary::after { content: " ▴"; }
.auth-more[open] > summary { margin-bottom: 14px; }
