/* Lore — page-specific layouts. */

/* ---- Hero (logged-out front page) ---- */
.lore-hero {
	background: linear-gradient(160deg, var(--ember) 0%, #c8461f 60%, #a83a1a 100%);
	color: #fff; padding: var(--space-12) var(--space-4) var(--space-10);
	text-align: center; position: relative; overflow: hidden;
}
.lore-hero::after {
	content: ''; position: absolute; inset: 0; opacity: .12; pointer-events: none;
	background-image: radial-gradient(circle at 20% 20%, #fff 0, transparent 40%), radial-gradient(circle at 80% 70%, #fff 0, transparent 35%);
}
.lore-hero__inner { position: relative; max-width: 620px; margin: 0 auto; }
.lore-hero h1 { font-family: var(--lore-font-serif); font-size: clamp(1.9rem, 6vw, 3rem); margin-bottom: var(--space-3); }
.lore-hero p { font-size: 1.05rem; opacity: .92; margin-bottom: var(--space-6); }
.lore-hero__actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.lore-hero .lore-btn--primary { background: #fff; color: var(--ember-dark); }
.lore-hero .lore-btn--ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.lore-hero__stats { display: flex; gap: var(--space-6); justify-content: center; margin-top: var(--space-8); flex-wrap: wrap; }
.lore-hero__stats div { text-align: center; }
.lore-hero__stats strong { display: block; font-size: 1.4rem; }
.lore-hero__stats span { font-size: .75rem; opacity: .85; }

.lore-continue-strip { padding-top: var(--space-4); padding-bottom: var(--space-4); margin-top: var(--space-4); }
.lore-continue-strip__track {
	display: flex; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2);
	scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.lore-continue-strip__empty { padding: var(--space-3) 0; }
.lore-continue-card { display: flex; gap: var(--space-3); align-items: center; background: var(--paper-alt); border-radius: var(--radius-lg); padding: var(--space-3); flex: none; width: 260px; scroll-snap-align: start; text-decoration: none; color: var(--ink); }
.lore-continue-card img { width: 56px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.lore-continue-card__body { flex: 1; min-width: 0; }
/* R4 responsive audit (item 5): this is a <span> — `display: block` is
   required for `overflow: hidden` + `text-overflow: ellipsis` to actually
   clip an inline element; without it the box has no real width constraint
   and a long title just runs past .lore-continue-card__body (measured 51px
   over live). Same fix as .lore-reader-topbar__story (reader.css). */
.lore-continue-card__title { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lore-continue-card__part { display: block; font-size: .75rem; color: var(--ember-text); font-weight: 600; margin-bottom: 4px; }
@media (max-width: 560px) { .lore-continue-card { width: 240px; } }

/* ---- Story detail (single-lore_story) ---- */
.lore-story-head { padding-top: var(--space-6); padding-bottom: var(--space-6); }
@media (min-width: 760px) { .lore-story-head { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-8); } }
.lore-story-head__cover { width: 200px; max-width: 60vw; margin: 0 auto var(--space-4); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 2/3; }
@media (min-width: 760px) { .lore-story-head__cover { width: 100%; max-width: none; margin-bottom: 0; } }
.lore-story-head__cover img { width: 100%; height: 100%; object-fit: cover; }
.lore-story-head__title { font-family: var(--lore-font-serif); font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: var(--space-2); }
/* CLS fix (perf regression audit): the metric-matched fallback face in
   fonts.css makes the fallback-vs-webfont render at the SAME size, but it
   can't guarantee an identical line-WRAP decision for every specific
   string (per-glyph widths still differ a little even after size-adjust
   averages out to the same mean) — and this byline text sits right on a
   wrap boundary at common widths. A wrap flip (1 line <-> 2 lines) during
   the swap is what was actually moving everything below it (desc, tags,
   the ad slot) — reserving the taller (2-line) height up front means that
   flip, if it still happens, never changes this element's own box size. */
.lore-story-head__byline { font-size: .95rem; margin-bottom: var(--space-3); min-height: 3em; }
.lore-story-head__byline a { color: var(--ember-text); font-weight: 600; }
.lore-story-head__badges { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.lore-story-head__stats { display: flex; gap: var(--space-5); margin-bottom: var(--space-4); color: var(--ink-soft); font-size: .875rem; flex-wrap: wrap; }
.lore-story-head__stats span { display: inline-flex; align-items: center; gap: 5px; }
/* Round 2 phase 2: "Full Story Price N Coins" meta chip (Wattpad-style paid-story indicator). */
.lore-story-head__paid { color: var(--ember-text); font-weight: 700; }
.lore-story-head__desc { max-width: 640px; margin-bottom: var(--space-4); color: var(--ink-soft); line-height: 1.6; }
.lore-story-head__desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lore-story-head__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-5); }
.lore-story-head__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-2); }

.lore-toc { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.lore-toc__list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.lore-toc__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--line); }
.lore-toc__row:last-child { border-bottom: 0; }
.lore-toc__row:hover { background: var(--paper-alt); }
.lore-toc__num { width: 28px; height: 28px; border-radius: 50%; background: var(--paper-alt); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--ink-faint); flex: none; }
.lore-toc__title { flex: 1; font-weight: 600; }
.lore-toc__meta { font-size: .75rem; color: var(--ink-faint); }
/* Round 2 phase 2: locked-part price chip in the read-only Table of Contents. */
.lore-toc__paid { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; font-weight: 700; color: var(--ember-text); flex: none; }
.lore-toc__paid .lore-icon { width: 14px; height: 14px; }

/* ---- Reader header (part) partially shared with pages.css for TOC dropdown etc. handled in reader.css ---- */

/* ---- Taxonomy / browse / search ---- */
.lore-page-head { padding-top: var(--space-6); padding-bottom: var(--space-2); }
.lore-page-head h1 { font-family: var(--lore-font-serif); }
.lore-genre-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); padding-top: var(--space-4); padding-bottom: var(--space-4); }
@media (min-width: 600px) { .lore-genre-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .lore-genre-tiles { grid-template-columns: repeat(4, 1fr); } }
.lore-genre-tile {
	border-radius: var(--radius-lg); padding: var(--space-5) var(--space-4); color: #fff; font-weight: 700;
	min-height: 90px; display: flex; align-items: flex-end; background: var(--ink-soft);
}

/* ---- Profile ---- */
/* R4 boxed-layout audit: this had no max-width/auto-margin at all and rendered
   full-bleed edge-to-edge at every width — the one surface that fully escaped
   the container system. Folded into the shared .lore-container rule (base.css);
   only its own vertical padding + background stay here. */
.lore-profile-head { text-align: center; padding-top: var(--space-6); padding-bottom: var(--space-6); background: var(--paper-alt); }
.lore-profile-head__banner { height: 140px; background: linear-gradient(135deg, var(--ember), var(--teal)); border-radius: var(--radius-lg); margin-bottom: -56px; }
.lore-profile-head__name { font-weight: 800; font-size: 1.3rem; margin-top: var(--space-3); }
.lore-profile-head__username { color: var(--ink-faint); margin-bottom: var(--space-3); }
.lore-profile-head__bio { max-width: 480px; margin: 0 auto var(--space-4); color: var(--ink-soft); font-size: .9rem; }
.lore-profile-head__stats { display: flex; gap: var(--space-6); justify-content: center; margin-bottom: var(--space-4); }
.lore-profile-head__stats strong { display: block; }
.lore-profile-head__stats span { font-size: .75rem; color: var(--ink-faint); }
.lore-profile-head__actions { display: flex; gap: var(--space-3); justify-content: center; }

/* ---- Library ---- */
.lore-library-item { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); align-items: center; }
.lore-library-item img { width: 52px; height: 78px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.lore-library-item__body { flex: 1; min-width: 0; }
/* display:block — see the R4 comment on .lore-continue-card__title above;
   same <span>-without-block-display bug. */
.lore-library-item__title { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lore-library-item__pct { font-size: .75rem; color: var(--ink-faint); margin-top: 4px; }
.lore-library-item__meta { display: flex; align-items: center; gap: 10px; font-size: .75rem; flex-wrap: wrap; }
/* R4 responsive audit: the byline ("by Author Name") is a plain-text span
   matched by this same selector — white-space:nowrap on IT specifically was
   forcing a multi-word phrase to stay on one line, which at 320px is wider
   than the row has room for and overflowed its own parent by ~10px (real,
   reproducible on every library row at that width, not the icon+count
   spans next to it, which are single unbreakable tokens either way and are
   unaffected by dropping this). */
.lore-library-item__meta > span { display: inline-flex; align-items: center; gap: 3px; }
.lore-library-item__meta .lore-icon { width: 12px; height: 12px; vertical-align: -1px; }

/* ---- Notifications ---- */
.lore-notif-list { max-width: 640px; margin: 0 auto; }
.lore-notif { display: flex; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--line); align-items: flex-start; }
.lore-notif.is-unread { background: var(--ember-light); }
.lore-notif__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--paper-alt); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ember); }
.lore-notif__body { flex: 1; font-size: .875rem; }
.lore-notif__time { font-size: .75rem; color: var(--ink-faint); }

/* ---- Inbox ---- */
/* R4: folded into the shared .lore-container rule (base.css) for max-width/
   centering/gutter — this page previously had no horizontal gutter at all. */
.lore-inbox { display: block; }
@media (min-width: 820px) { .lore-inbox { display: grid; grid-template-columns: 320px 1fr; min-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-top: var(--space-4); margin-bottom: var(--space-4); } }
.lore-inbox__threads { border-right: 1px solid var(--line); overflow-y: auto; }
.lore-thread-row { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); cursor: pointer; }
.lore-thread-row:hover, .lore-thread-row.is-active { background: var(--paper-alt); }
.lore-thread-row img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.lore-thread-row__body { flex: 1; min-width: 0; }
.lore-thread-row__name { font-weight: 700; font-size: .875rem; }
.lore-thread-row__preview { display: block; font-size: .8rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lore-conversation { display: flex; flex-direction: column; height: 100%; min-height: 60vh; }
.lore-conversation__messages { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.lore-bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: .875rem; background: var(--paper-alt); }
.lore-bubble.is-mine { align-self: flex-end; background: var(--ember); color: #fff; }
.lore-conversation__composer { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--line); }
.lore-conversation__composer textarea { flex: 1; min-height: 44px; max-height: 120px; }

/* ---- Settings ---- */
/* R4: Wattpad's settings panel measures 976px (qa/r4/wattpad_layout_banners.md
   §A.3) — a narrower "panel" tier than the 1200px page container, same as the
   reader's 580px prose column. 960px is the round number in the same 40px-
   step system as the container change (1240->1200). Was 620px, far narrower
   than the reference and cramped on tablet/desktop forms. */
.lore-settings { max-width: 960px; margin: 0 auto; padding: var(--space-4); }
.lore-settings__section { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.lore-settings__section h2 { font-size: 1.05rem; }
.lore-avatar-upload { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }

/* ---- Write dashboard ---- */
.lore-write-head { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-6); padding-bottom: var(--space-4); flex-wrap: wrap; gap: var(--space-3); }
.lore-story-manage-list { display: flex; flex-direction: column; gap: var(--space-3); }
.lore-story-manage-card { display: flex; gap: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3); }
.lore-story-manage-card img { width: 64px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.lore-story-manage-card__body { flex: 1; min-width: 0; }
.lore-story-manage-card__title { font-weight: 700; margin-bottom: 4px; }
.lore-story-manage-card__meta { font-size: .75rem; color: var(--ink-faint); display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: 6px; }
.lore-status-pill { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--paper-alt); }
.lore-status-pill--published { background: rgba(27,153,139,.14); color: var(--teal-dark); }
.lore-status-pill--draft { background: var(--ember-light); color: var(--ember-dark); }

/* Story edit / part list */
.lore-cover-upload { width: 160px; aspect-ratio: 2/3; border-radius: var(--radius-lg); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-faint); cursor: pointer; overflow: hidden; position: relative; background: var(--paper-alt); }
.lore-cover-upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lore-tags-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px; }
.lore-tags-input input { border: 0; flex: 1; min-width: 120px; padding: 6px; font-size: .9rem; }
.lore-parts-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-3); }
.lore-part-row { display: flex; align-items: center; gap: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); background: var(--white); }
.lore-part-row__title { flex: 1; font-weight: 600; font-size: .9rem; }
.lore-part-row__meta { font-size: .75rem; color: var(--ink-faint); }

/* Part editor */
.lore-editor-wrap { max-width: 760px; margin: 0 auto; padding: var(--space-4); }
.lore-editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; position: sticky; top: calc(var(--header-h) + 8px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px; z-index: var(--z-sticky); margin-bottom: var(--space-3); }
.lore-editor-toolbar button { width: 44px; height: 44px; border-radius: var(--radius-sm); background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lore-editor-toolbar button:hover { background: var(--paper-alt); }
.lore-editor-toolbar button.is-active { background: var(--ember-light); color: var(--ember-dark); }
.lore-editor-toolbar .lore-icon { width: 18px; height: 18px; }
.lore-editor-title { width: 100%; border: 0; font-size: 1.4rem; font-weight: 700; font-family: var(--lore-font-serif); padding: var(--space-2) 0; margin-bottom: var(--space-2); background: transparent; }
/* Accessibility fix: this used to be `.lore-editor-title:focus { outline:
   none; }` with nothing replacing it — a real WCAG 2.4.7 violation (no
   focus indicator at all on the story title field). Removed so the
   sitewide `:focus-visible { outline: 2px solid var(--teal) }` (base.css)
   applies here like everywhere else on the site, instead of overriding it
   to nothing. */
.lore-editor-content {
	min-height: 320px; font-family: var(--lore-font-serif); font-size: 1.1rem; line-height: 1.7;
	border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4);
}
.lore-editor-content:focus { outline: none; border-color: var(--teal); }
.lore-editor-content p { margin: 0 0 1em; }
.lore-editor-footer { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-4); flex-wrap: wrap; gap: var(--space-3); }
.lore-editor-footer__status { font-size: .8rem; color: var(--ink-faint); }
.lore-editor-actions { display: flex; gap: var(--space-2); }

/* ---- Auth pages ---- */
.lore-auth-wrap { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4); }
.lore-auth-card { width: 100%; max-width: 400px; }
.lore-auth-card__logo { text-align: center; color: var(--ember); margin-bottom: var(--space-4); }
.lore-auth-card__logo .lore-logo { height: 34px; margin: 0 auto; }
.lore-auth-card h1 { text-align: center; font-size: 1.3rem; margin-bottom: var(--space-2); }
.lore-auth-card__sub { text-align: center; color: var(--ink-faint); font-size: .875rem; margin-bottom: var(--space-6); }
.lore-auth-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: var(--space-5); }
.lore-auth-steps span { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.lore-auth-steps span.is-active, .lore-auth-steps span.is-done { background: var(--ember); }
.lore-auth-card__footer { text-align: center; font-size: .875rem; margin-top: var(--space-5); color: var(--ink-faint); }

/* ---- 404 / offline ---- */
/* R5 (qa/r5/LORE_LAYOUT_DEFECTS.md D9): on the shared boxed-container
   allow-list now (base.css) — its own rule keeps only the vertical padding,
   longhand, so it doesn't clobber the shared rule's padding-left/right. */
.lore-status-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding-top: var(--space-6); padding-bottom: var(--space-6); }
.lore-status-page__glyph { color: var(--ember); margin-bottom: var(--space-4); }
.lore-status-page__glyph .lore-logo { height: 40px; margin: 0 auto; }
.lore-status-page h1 { font-family: var(--lore-font-serif); }

/* ---- Static content page (about/terms/privacy/guidelines) ---- */
.lore-content-page { max-width: 720px; margin: 0 auto; padding: var(--space-8) var(--space-4); line-height: 1.7; }
.lore-content-page h1 { font-family: var(--lore-font-serif); margin-bottom: var(--space-4); }
.lore-content-page h2 { margin-top: var(--space-6); }

/* ---- Reader settings popover (structure only, theme colours in reader.css) ---- */
.lore-popover {
	position: absolute; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg); padding: var(--space-4); z-index: var(--z-popover); width: 280px;
}
.lore-popover[hidden] { display: none; }
.lore-popover__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.lore-popover__label { font-size: .8rem; font-weight: 600; color: var(--ink-faint); }
.lore-seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.lore-seg button { flex: 1; background: none; border: 0; padding: 6px 10px; font-size: .8rem; cursor: pointer; }
.lore-seg button.is-active { background: var(--ember); color: #fff; }

/* iOS add-to-home hint banner */
.lore-ios-hint { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--tabbar-h) + 10px); background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); font-size: .82rem; display: flex; align-items: center; gap: var(--space-3); z-index: var(--z-hint); }
.lore-ios-hint button { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; }

/* ---- Search: filter panel — desktop sidebar / mobile bottom sheet ---- */
.lore-search-layout { display: block; }
.lore-search-filters-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: var(--space-3) 0; }
.lore-search-count { padding: 0 0 var(--space-2); color: var(--ink-faint); font-size: .85rem; min-height: 1.2em; }
.lore-search-main { min-width: 0; }
/* QA task 9 (layout shift): results are fetched by search.js, so the results
   area is empty at first paint and the footer sits right under the tabs — when
   the cards land the footer is shoved down the page (measured CLS 0.105 on
   mobile, the site's worst). Reserve a screenful while a query is pending so
   nothing below it moves. Scoped to "a query was actually submitted" so the
   no-query empty state is unaffected. */
[data-lore-search]:not([data-q=""]) .lore-search-main { min-height: 70vh; }
/* .lore-grid normally centers itself with its own max-width/padding — inside
   the sidebar layout's right-hand column it should just fill that column. */
.lore-search-main .lore-grid,
.lore-search-main .lore-story-manage-list,
.lore-search-main .lore-filterbar { max-width: none; margin: 0; padding: 0; }

/* Mobile (default): the filter panel is a bottom sheet, closed until the
   "Filters" trigger opens it (.is-open) — same visual language as
   template-parts/bottom-sheet.php, but not tied to that generic .lore-sheet
   class so it can flip to a static sidebar column on desktop below without
   touching every other .lore-sheet on the site. [hidden] (native attribute,
   set by search.js) means "not applicable to the current tab" — Profiles/
   Tags results have no filters — and always wins over .is-open. */
.lore-search-filters-overlay {
	position: fixed; inset: 0; background: rgba(29,29,31,.4); z-index: var(--z-overlay);
}
.lore-search-filters-overlay[hidden] { display: none; }
.lore-search-filters[hidden] { display: none; }
.lore-search-filters:not([hidden]) {
	display: none; /* mobile default: closed until .is-open */
	position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
	background: var(--white); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
	max-height: 82vh; flex-direction: column;
	padding-bottom: env(safe-area-inset-bottom, 0);
}
.lore-search-filters:not([hidden]).is-open { display: flex; }
.lore-search-filters__grabber { width: 40px; height: 4px; background: var(--line); border-radius: 2px; margin: 10px auto; flex: none; }
.lore-search-filters__head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); flex: none; }
.lore-search-filters__head button { min-width: 44px; min-height: 44px; }
.lore-search-filters__body { overflow-y: auto; padding: var(--space-4); flex: 1; display: flex; flex-direction: column; gap: var(--space-4); -webkit-overflow-scrolling: touch; }
.lore-search-filters__group legend { font-size: .8rem; font-weight: 700; color: var(--ink-faint); margin-bottom: 6px; padding: 0; }
.lore-search-filters__group { border: 0; padding: 0; margin: 0; }
.lore-search-filters__genres { display: flex; flex-wrap: wrap; gap: 8px; }
.lore-search-filters__genres label {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
	border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: .85rem; cursor: pointer;
}
.lore-search-filters__genres input { width: 18px; height: 18px; }
.lore-search-filters select, .lore-search-filters input[type="text"] { width: 100%; min-height: 44px; }
.lore-search-filters__footer { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); flex: none; padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0)); }
.lore-search-filters__footer .lore-btn { width: 100%; min-height: 44px; }

@media (min-width: 900px) {
	.lore-search-filters-toggle { display: none; }
	.lore-search-filters-overlay { display: none !important; }
	.lore-search-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-6); align-items: start; }
	.lore-search-filters:not([hidden]) {
		display: flex; /* always visible on desktop when applicable to the tab, no open/close */
		position: sticky; left: auto; right: auto; bottom: auto; top: calc(var(--header-h, 60px) + var(--space-4));
		border-radius: var(--radius-lg); box-shadow: none; border: 1px solid var(--line);
		max-height: calc(100vh - var(--header-h, 60px) - var(--space-8));
	}
	.lore-search-filters__grabber { display: none; }
	.lore-search-filters__footer { display: none; }
}

/* ==== Browse: "Lore Picks" curated block (Wattpad-parity, round 3) ====
   Job 2 — appended 2026-09-23 by the theme-owner agent, own comment block,
   file-ownership rule: append-only at end of pages.css. Reuses existing
   design tokens (base.css :root) only; no new colours introduced. */
.lore-picks { margin-bottom: var(--space-8); }
.lore-picks__heading { font-family: var(--lore-font-serif); font-size: var(--fs-h2); margin: var(--space-2) 0 var(--space-3); }
.lore-picks__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 600px) { .lore-picks__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .lore-picks__grid { grid-template-columns: repeat(5, 1fr); } }
.lore-picks__item {
	display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--space-2);
	min-height: 88px; background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius-lg);
	padding: var(--space-4); text-decoration: none; color: var(--ink);
	transition: background .15s ease, transform .15s ease;
}
.lore-picks__item:hover, .lore-picks__item:focus-visible { background: var(--ember-light); transform: translateY(-1px); }
.lore-picks__item .lore-icon { width: 22px; height: 22px; color: var(--ember-text); flex: none; }
.lore-picks__item span { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.lore-picks__langs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.lore-picks__lang-link {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4);
	border-radius: var(--radius-pill); background: var(--paper-alt); border: 1px solid var(--line);
	color: var(--ink); text-decoration: none; font-weight: 600; font-size: .85rem;
	/* R5: same Indic-descender line-height risk as .lore-btn — this doesn't
	   use that class (checked directly), so fixed independently here. */
	line-height: 1.6;
}
.lore-picks__lang-link:hover, .lore-picks__lang-link:focus-visible { background: var(--teal); color: #fff; border-color: var(--teal); }
