/* Books that feel like this — direction B "Night Window" (design/PATTERNS.md) */

:root {
  --night: #17162e;
  --night-2: #1f1e3a;
  --ink: #ebe7f3;
  --muted: #8f8ba9;
  --amber: #f2b263;
  --amber-ink: #1a1230;
  --line: rgba(235, 231, 243, 0.09);
  --scene-wall: #1c1b35;
  --scene-floor: #2b2140;
  --tile-bg: #22213f;
  --backdrop: rgba(10, 9, 24, 0.78);
  --panel: #1b1a35;
  --gap: 4px;
  --gutter: 16px;
}
:root[data-theme="light"] {
  --night: #efe3ee;
  --night-2: #e6d7ea;
  --ink: #2a2140;
  --muted: #6f6688;
  --amber: #c9742f;
  --amber-ink: #fff4e6;
  --line: rgba(42, 33, 64, 0.12);
  --tile-bg: #e2d4e6;
  --backdrop: rgba(42, 33, 64, 0.55);
  --panel: #f6eef5;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] body {
  background: linear-gradient(180deg, #f6dce6 0%, #efe3ee 420px, #d9cdee 100%) fixed;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- the scene */
.sky {
  height: 168px;
  background: linear-gradient(180deg, var(--scene-wall) 0 78.5%, var(--scene-floor) 78.5% 100%);
  overflow: hidden;
}
.sky { position: relative; }
.scene { height: 100%; }
.scene canvas {                       /* drawn by scene.js, blown up with crisp pixels */
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
:root[data-theme="light"] .sky {
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.2);
}

/* ---------- the bar (sticks; slides off and back with the scroll — app.js slidingBar)
   .barSlot holds the bar's place in the page; .barTrack is the invisible lane the sticky bar
   rides in, laid over the content below, so it must not catch taps. */
.barSlot { position: relative; z-index: 5; }
.barTrack { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.barTrack > * { pointer-events: auto; }
.head {
  position: sticky;
  top: 0;
  background: var(--night);
  transition: box-shadow .25s;
}
.head.float { box-shadow: 0 1px 0 var(--line); }
/* lightning: the room's flash spills onto the bar, brightest at the top edge (--flash 0–1, scene.js) */
.head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(180, 200, 255, calc(var(--flash, 0) * .2)), rgba(180, 200, 255, calc(var(--flash, 0) * .06)));
}
.metaSlot { z-index: 2; }   /* the post viewer's bar slides like the top bar: with the text column on desktop, the whole post on phones */
.sw.labBtn {
  position: absolute; top: 16px; right: var(--gutter); z-index: 6;
  padding: 4px 0;
  color: #8f8ba9;                      /* sits on the scene, which stays dark in both themes */
}
.sw.labBtn[hidden] { display: none; }   /* production: no lab (app.js shows it on staging links) */
.sw.labBtn:not([hidden]) { right: calc(var(--gutter) + 30px); }   /* staging: just left of the feedback bubble */
.sw.fbBtn {                            /* opens the feedback form (roadmap widget.js); always pink, whatever the accent */
  position: absolute; top: 15px; right: var(--gutter); z-index: 6;
  padding: 3px; margin-right: -3px; background: none; border: 0; cursor: pointer;
  color: #ee719e; line-height: 0;
}
.sw.fbBtn svg { width: 18px; height: 18px; fill: currentColor; }
.sw.fbBtn:hover { color: #f59bbb; }
.sw.back {                             /* back to the portfolio (lab "back link") */
  position: absolute; z-index: 6;
  color: var(--amber);
  /* after: on the bare wall between the string lights and the shelf, at the screen's left edge */
  top: 24px; left: var(--gutter);
  padding: 4px 0;
}
:root[data-back="over shelf"] .sw.back {   /* over shelf: lined up with the shelf's left edge wherever the room lands (--shelf-left from scene.js) */
  left: max(var(--gutter), var(--shelf-left, var(--gutter)));
}
:root[data-back="before"] .sw.back {   /* before: the tall shelf, so the link sits on a dark card at the screen's edge */
  top: 10px; left: var(--gutter);
  padding: 5px 8px;
  background: rgba(23, 22, 46, .85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.sw.back:hover { color: var(--ink); }
.tools::before {
  /* the lamp's glow leaking onto the page */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 140px;   /* starts at the room's edge: reaching up into the room drew a hard-edged box over it */
  background: radial-gradient(60% 100% at 82% 0%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%);
  pointer-events: none;
}
/* Lab "on top: search" — the bar sits above the room: the flash and the lamp glow come from below */
:root[data-layout="search"] .head::after { background: linear-gradient(to top, rgba(180, 200, 255, calc(var(--flash, 0) * .2)), rgba(180, 200, 255, calc(var(--flash, 0) * .06))); }
:root[data-layout="search"] .sky { margin-bottom: 16px; }
:root[data-layout="search"] .tools::before { inset: auto 0 0 0; background: radial-gradient(60% 100% at 82% 100%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%); }.sw, .search input, .search .ph {
  font-family: "Silkscreen", monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-decoration: none;
  position: relative;
}
.sw { color: var(--muted); }

/* ---------- search + pills */
.tools {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px var(--gutter) 16px;
  position: relative;
}
/* The search box keeps the old site-name look (pixel font, amber, a hairline under it) but says
   "type here": a pixel magnifier in front and a blinking block cursor after the words. The words
   are a fake placeholder (.ph) so the cursor can sit right after them; the real placeholder is a
   space, which keeps :placeholder-shown working. Lab "search hint" turns either part off. */
.search { flex: 0 0 260px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); cursor: text; }
.search:focus-within { border-bottom-color: var(--amber); }
.search .mag { flex: none; width: 12px; height: 12px; fill: var(--amber); }
.search .field { position: relative; flex: 1; min-width: 0; display: flex; }
.search input {
  width: 100%;
  color: var(--amber);
  background: none;
  border: 0;
  padding: 6px 0;
  border-radius: 0;
  -webkit-appearance: none;
}
.search input::placeholder { color: transparent; }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }   /* our own ✕ instead */
.search .clear { flex: none; display: grid; place-items: center; padding: 8px; margin: -8px -8px -8px 0; color: var(--amber); background: none; border: 0; cursor: pointer; }
.search .clear[hidden] { display: none; }
.search .clear svg { width: 9px; height: 9px; fill: currentColor; }
.search .ph {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  color: var(--amber); white-space: nowrap; pointer-events: none;
}
.search .ph::after {
  content: ""; display: inline-block; width: .6em; height: 1.05em; margin-left: 3px;
  vertical-align: -.15em; background: var(--amber); animation: caret 1.06s steps(1) infinite;
}
.search input:not(:placeholder-shown) + .ph { display: none; }
.search input:focus + .ph::after { visibility: hidden; }   /* the real cursor takes over */
@keyframes caret { 50% { opacity: 0; } }
:root[data-hint="cursor"] .search .mag, :root[data-hint="none"] .search .mag { display: none; }
:root[data-hint="icon"] .search .ph::after, :root[data-hint="none"] .search .ph::after { display: none; }
.pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill:hover { color: var(--ink); }
.pill.on { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); }

/* ---------- the wall */
.wall {
  display: flex;
  gap: var(--gap);
  padding: 0 var(--gutter) 60px;
  align-items: flex-start;
  transition: opacity .16s ease-out;
}
.wall.out { opacity: 0; }
:root[data-edges="full"] .wall { padding-left: 0; padding-right: 0; }   /* Lab "pictures: edge to edge" */
/* new search / tag results come in one after another (delay set per tile in app.js) */
.tile.enter { animation: tileIn .4s ease-out both; }
@keyframes tileIn { from { opacity: 0; } to { opacity: 1; } }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--tile-bg);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  text-decoration: none;
  color: #fff;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  opacity: 0;
  transition: opacity .25s ease-out;
}
.tile img.in { opacity: 1; transition: none; }
.veil {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
:root[data-shape="squares"] .tile { aspect-ratio: 1 / 1 !important; }
:root[data-shape="squares"] .tile img { position: absolute; inset: 0; }
.cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 10px 9px;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.3;
  background: linear-gradient(transparent, rgba(10, 9, 24, 0.82));
  opacity: 0;
  transition: opacity .15s;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;   /* the whole title, cut at two lines */
}
.cap b { font-weight: 500; }
.cap span { color: rgba(255,255,255,.7); }
@media (hover: hover) {
  .tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }
}
.sentinel { height: 1px; }
.empty { padding: 40px var(--gutter); color: var(--muted); }
.more { margin: -40px 0 40px; padding: 0 var(--gutter); text-align: center; }
.more[hidden] { display: none; }
.more button { color: var(--muted); border-bottom: 1px solid var(--amber); padding-bottom: 2px; }
.more button:hover { color: var(--ink); }

/* ---------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 10; }
.lightbox[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.lightbox, .panel { animation: fade .1s ease-out; }
@keyframes fade { from { opacity: 0; } }
.lightbox.out, .lightbox.out .panel { animation: fadeout .15s ease-in forwards; }
@keyframes fadeout { to { opacity: 0; } }
.panel {
  position: absolute;
  inset: 4vh 4vw;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  background: var(--panel);
  color: var(--ink);
  outline: none;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.lightbox .panel, .lightbox .pics, .lightbox .side { overscroll-behavior: contain; }   /* reaching the end of the post doesn't carry on into the wall behind */
:root.lbOpen, :root.lbOpen body { overflow: hidden; overscroll-behavior: none; }
.pics { overflow-y: auto; background: var(--pics-bg, #0e0d1e); display: flex; flex-direction: column; gap: var(--gap); }
:root[data-theme="light"] .pics { background: var(--pics-bg, #e3d7e8); }
.pics img { display: block; width: 100%; height: auto; background: var(--tile-bg); }
.pics img.thumb { filter: none; }
.pics img { transition: opacity .15s ease-out; }
.pics img.wait { opacity: 0; }   /* a picture not loaded yet fades in instead of popping (app.js open) */
.side { overflow-y: auto; }
/* "there's more this way": a blocky copy of the pictures at the edge they scroll toward (app.js scrollHint) */
.lbHint { position: absolute; z-index: 1; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; transition: opacity .4s; }
.lbHint.gone { opacity: 0; }                     /* the right-hand column: buttons, then the text, scrolling together */
.text { padding: 0 28px 40px; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 28px 12px; position: sticky; top: 0; background: var(--panel); transition: box-shadow .25s; }
.meta.float { box-shadow: 0 1px 0 var(--line); }
.text { padding-top: 4px; }
/* next/previous post: the pictures and text fade out and back in (lab "next post"); the buttons stay */
/* soft: only dims (never to black), eases both ways, and comes back slower than it goes */
.pics, .text { transition: opacity .32s cubic-bezier(.25, .1, .25, 1); }
.panel.turn .pics, .panel.turn .text { opacity: .3; transition: opacity .18s ease-in-out; }
.nav { display: flex; gap: 4px; }
@media (min-width: 721px) { #close { order: 2; } }   /* desktop: ‹ › on the left, ✕ on the right (phones keep ✕ left) */
/* ‹ › × all alike: same box, icon drawn dead centre */
.arrow { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover { color: var(--ink); }
.title { font-size: 22px; font-weight: 500; line-height: 1.25; margin: 0 0 8px; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.sub a { color: var(--muted); }
.sub a:hover { color: var(--ink); }
.comments { list-style: none; margin: 0; padding: 0; max-width: 58ch; }
.comments li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.5;
  word-wrap: break-word;
}
.comments li:first-child { border-top: 0; }
.marks { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.up, .agree {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--night-2);
}
.up .tri { width: 10px; height: 10px; fill: var(--muted); flex: none; }
.agree { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); }
.hot .up { border-color: var(--amber); }
.hot .up .tri { fill: var(--amber); }
/* vote pill position (lab) */
.comments[data-pos="corner"] li { padding-right: 84px; }
.comments[data-pos="corner"] .marks { position: absolute; top: 12px; right: 0; margin: 0; }
.comments[data-pos="below"] .marks { order: 2; margin: 8px 0 0; }
/* highlight style (lab) */
.comments[data-hl="left line"] li.hot { border-left: 2px solid var(--amber); padding-left: 12px; }
.comments[data-hl="bottom line"] li.hot { box-shadow: inset 0 -2px 0 var(--amber); padding-bottom: 14px; }
.comments a { color: var(--amber); text-decoration: none; }
.comments a:hover { text-decoration: underline; }
.comments p { margin: 0 0 8px; }
.comments p:last-child { margin: 0; }
/* a book title in a comment, and the card of places to read its reviews (app.js openBook) */
.bk {
  display: inline; font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  text-align: inherit; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--amber) 85%, transparent) 2px;
  text-underline-offset: 4px;
}
.bk:hover, .bk.on { color: var(--amber); }
.bookCard {
  position: fixed; z-index: 30;
  width: 300px; max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  padding: 12px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .22s ease-out, transform .22s ease-out;   /* FADE_MS in app.js */
}
.bookCard.show { opacity: 1; transform: none; }
.bookCard[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bookCard { transition: none; transform: none; } }
.bcHead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
/* A cover-sized spot from the start (2:3), a dim pixel book until the cover is in; the canvas on
   top shows the cover in big blocks for a moment, then goes */
.bcCover { position: relative; width: 44px; height: 66px; flex: none; display: grid; place-items: center; background: var(--night-2); }
.bcCover svg { width: 22px; height: 22px; fill: var(--muted); opacity: .45; }
.bcCover.got svg { display: none; }
.bcCover img, .bcCover canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bcCover canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.bcHead b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.bcHead span { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.bcHead .bcRate { margin-top: 4px; }
.bcLinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.bcLinks a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid var(--line); background: var(--night-2);
  color: var(--ink); font-family: "Silkscreen", monospace; font-size: 10px; text-decoration: none;
}
.bcLinks a:hover { border-color: var(--amber); color: var(--amber); }
.bcLinks svg { width: 18px; height: 18px; fill: var(--amber); }

/* ---------- the lab */
.labBtn.on { color: var(--amber); }
.lab {
  position: fixed; top: 12px; right: 12px; z-index: 20;
  width: 300px; max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  padding: 12px 14px 10px;
}
.lab[hidden] { display: none; }
.labHead { display: flex; justify-content: space-between; align-items: center; font-family: "Silkscreen", monospace; font-size: 11px; color: var(--amber); margin-bottom: 10px; }
.labHead button { font-size: 20px; color: var(--muted); width: 28px; height: 28px; }
.lab .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lab .lbl { color: var(--muted); white-space: nowrap; }
.lab .opts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lab .opt { color: var(--muted); padding-bottom: 1px; white-space: nowrap; }
.lab .opt.on { color: var(--ink); border-bottom: 2px solid var(--amber); }
.lab .pick { width: 22px; height: 18px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; align-self: center; }
.lab .pick::-webkit-color-swatch-wrapper { padding: 0; }
.lab .pick::-webkit-color-swatch { border: 0; }
.labNote { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- phones */
@media (max-width: 720px) {
  :root { --gutter: 10px; --gap: 3px; }
  .sky { height: 112px; }
  .backLabel { display: none; }   /* phones: just the chevron, on a card big enough to tap */
  .sw.back, :root[data-back] .sw.back { top: 10px; left: var(--gutter); padding: 9px 13px; font-size: 14px; line-height: 1; background: rgba(23, 22, 46, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }   /* phones show the room's middle, so the link sits over furniture: give it a dark card */
  .search input, .search .ph { font-size: 16px; }   /* phones zoom into smaller text boxes */
  .search .mag { width: 15px; height: 15px; }
  .search .clear { padding: 12px; margin: -12px -12px -12px 0; }   /* a thumb-sized target */
  .search .clear svg { width: 12px; height: 12px; }
  .tools { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 7px; }   /* the search box's own padding makes up the rest: the words sit as far below the top as the pills sit above the bottom */
  .search { flex-basis: auto; }
  /* one column that scrolls as a whole: buttons on top (they scroll away), pictures, then text */
  .panel { inset: 0; display: flex; flex-direction: column; overflow-y: auto; box-shadow: none; }
  .side { display: contents; }
  .metaSlot { display: block; order: 1; flex: none; z-index: 2; }
  .metaSlot > .barTrack { display: block; }
  .meta { padding: 8px var(--gutter); }
  .pics { order: 2; flex: none; height: 52vh; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 0; }
  .pics img { width: 100%; height: 100%; object-fit: contain; flex: 0 0 100%; }
  /* several pictures: a strip like the wall, sideways — each full height, side by side from the left */
  .pics.many { gap: var(--gap); padding-left: var(--gutter); background: none; }
  .pics.many img { width: auto; flex: none; object-fit: cover; }
  .pics.many::after { content: ""; flex: 0 0 calc(var(--gutter) - var(--gap)); }
  :root[data-edges="full"] .pics.many { padding-left: 0; }   /* Lab "pictures: edge to edge", like the wall */
  :root[data-edges="full"] .pics.many::after { display: none; }
  .text { order: 3; padding: 16px 16px 60px; }
  .arrow { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile img, .cap, .lightbox, .panel, .head, .meta, .veil, .wall, .tile.enter, .search .ph::after { transition: none; animation: none; }
}

/* ---------- the new filter (lab "filters"): "Books that feel like [mood ▾] in [genre ▾]" (app.js) */
.fbar { display: none; flex: 1; min-width: 0; }
:root[data-filters="new"] .fbar { display: block; }
:root[data-filters="new"] .search, :root[data-filters="new"] .pills { display: none; }
.fbar button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.fpx, .fblank, .fclear { font-family: "Silkscreen", monospace; letter-spacing: .02em; }
.fpx { font-size: 13px; color: var(--ink); }
.fsent { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 9px; padding: 4px 0; }
.fpicks { display: contents; }   /* desktop: one sentence; phones: the second line (below) */
/* The pink words are lowercase in the regular font next to pixel capitals: on the same line they look
   low (short letters, a few tails, the underline below), so they sit a touch higher to look centered. */
.fbar .fblank { font-size: 13px; color: var(--amber); border-bottom: 1px dashed var(--amber); padding-bottom: 2px; position: relative; top: -0.07em; }
.fbar .fblank.open { border-bottom-style: solid; }
.fbar .fblank.typed { color: var(--ink); border-bottom-color: var(--ink); }
.fbar .fclear { font-size: 13px; color: var(--muted); margin: -8px -8px -8px 0; padding: 8px; position: relative; top: -0.04em; }   /* a ✕ after the last pick, with a bigger click area around it that doesn't move anything */
.fbar .fclear .fx { display: inline-block; width: 9px; height: 9px; fill: currentColor; vertical-align: 0; }   /* drawn, not a ✕ character: phones fill a missing character from their own fonts, each at its own height */
.flead { display: none; }
.fbar .fclear:hover { color: var(--ink); }
/* the menu floats over the wall */
.fpanel { position: absolute; top: calc(100% - 4px); left: var(--gutter); z-index: 2; width: min(860px, calc(100% - 2 * var(--gutter)));
  background: var(--night-2); border: 1px solid var(--line); padding: 16px 18px 12px; box-shadow: 0 18px 40px rgba(5, 4, 15, .55);
  max-height: calc(100dvh - 120px); overflow: auto; }
.fpanel[hidden] { display: none; }
.fpanel.g { width: min(520px, calc(100% - 2 * var(--gutter))); padding-top: 10px; }
.fpanel.in { animation: fdrop .18s steps(6, end) both; }
.fpanel.out { animation: fdrop .14s steps(5, end) reverse both; }
@keyframes fdrop { from { clip-path: inset(0 0 100% 0); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.fveil { position: fixed; inset: 0; z-index: 4; background: rgba(10, 9, 24, .55); opacity: 0; pointer-events: none; transition: opacity .15s; }
.fveil.show { opacity: 1; pointer-events: auto; }
.ftype { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--amber); padding-bottom: 6px; margin-bottom: 6px; }
.ftype .fmag { color: var(--amber); }
.ftype input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); font-family: "Silkscreen", monospace; font-size: 13px; border-radius: 0; -webkit-appearance: none; }
.ftype input::placeholder { color: var(--muted); }
.fbar .fgo { font-family: "Silkscreen", monospace; font-size: 11px; color: var(--amber-ink); background: var(--amber); padding: 4px 8px; }
.fbar .fgo[hidden] { display: none; }
.fcols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 18px; }
.fpanel.g .fcols { grid-template-columns: repeat(3, 1fr); }
.fgrp + .fgrp h4 { margin-top: 22px; }
.fcol h4 { font-family: "Silkscreen", monospace; font-weight: 400; font-size: 11px; color: var(--muted); margin: 14px 0 4px; padding-left: 8px; }
.fbar .fopt { display: block; width: 100%; text-align: left; font-size: 15px; line-height: 1.25; color: var(--ink); padding: 6px 8px; opacity: .82; }
.fbar .fopt:hover { opacity: 1; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.fbar .fopt.on { opacity: 1; color: var(--amber-ink); background: var(--amber); }
.fbar .arrow.fshut { display: none; }   /* desktop closes by clicking outside; phones get a ✕ (below) */
.fend { font-family: "Silkscreen", monospace; font-size: 12px; color: var(--muted); padding: 28px var(--gutter) 40px; text-align: center; }
.fend[hidden] { display: none; }
.fseeRow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.fend .fsee { font: inherit; color: var(--amber); background: none; border: 1px solid var(--amber); padding: 8px 12px; cursor: pointer; }
.fend .fsee:hover { background: var(--amber); color: var(--amber-ink); }
@media (max-width: 720px) {
  .fpx, .fbar .fblank { font-size: 14px; }
  :root[data-filters="new"] .tools { padding-top: 8.5px; padding-bottom: 13.5px; }   /* no search box: both lines, from letter tops to the dotted underline, sit in the middle of the bar */
  .fbar .fblank::after { content: ""; position: absolute; inset: -12px -5px; }   /* a thumb-sized tap area that doesn't move anything */
  .ftype input { font-size: 16px; }                /* 16px+ stops iPhones zooming in on the box */
  .fpanel, .fpanel.g { left: 0; right: 0; width: auto; max-height: calc(100dvh - 140px); overflow: auto; border-width: 0 0 1px; padding: 12px var(--gutter) 6px;
    background: var(--night); box-shadow: none; }   /* the same black as the bar it drops from */
  .fpanel.in { animation: fdown .22s cubic-bezier(.2, .8, .2, 1) both; }
  .fpanel.out { animation: fdown .16s ease-in reverse both; }
  @keyframes fdown { from { clip-path: inset(0 0 100% 0); transform: translateY(-10px); } to { clip-path: inset(0 0 0 0); transform: none; } }
  .ftrow { display: flex; align-items: center; gap: 12px; }
  .ftrow .ftype { flex: 1; min-width: 0; margin-bottom: 0; }
  .fbar .arrow.fshut { display: inline-grid; flex: none; }
  .fbar .fcorner { position: absolute; top: 10px; right: var(--gutter); z-index: 1; }   /* genres: the ✕ in the corner, the list starts at the top */
  .fpanel.g { padding-top: 4px; }
  .fpanel.g .fcol:nth-child(2) .fopt:first-child { width: calc(100% - 44px); }   /* the top right genre stops short of the ✕ */
  .fsent { display: block; white-space: nowrap; }
  .fsent > .fpx { display: block; text-align: center; margin-bottom: 2px; }   /* "Books that feel like" on top, the picks centered under it */
  .fpicks { display: flex; align-items: baseline; gap: 7px; }
  .fpicks::before, .fpicks::after { content: ""; flex: 1 1 0; min-width: 0; }   /* centered, like the words on the floor above; a too-long line still starts at the left edge */

  .fbar .fclear { margin: -10px -35px -10px 0; padding: 12px 12px 12px 8px; font-size: 11px; top: 0; }   /* phones: just ✕ right after the last filter, hanging outside the centering (its width and the gap before it cancelled), letter height, with a bigger tap area around it */
  .fbar .fclear .fx { width: 8px; height: 8px; }
  .fpanel.g .fcols { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  /* moods: two columns, each group whole inside one of them, filling down the left column then
     the right (like the wall), so a short group never leaves a hole beside a long one */
  .fpanel.m .fcols { display: block; columns: 2; column-gap: 12px; }
  .fpanel.m .fcol { display: contents; }
  .fpanel.m .fgrp { break-inside: avoid; padding: 10px 0 14px; }   /* padding, not margin: a margin at the top of a column gets dropped */
  .fpanel.m .fgrp h4, .fpanel.m .fgrp + .fgrp h4 { margin-top: 0; }
  .fbar .fopt { padding: 9px 8px; font-size: 17px; }
  .fcol h4 { font-size: 12px; }
  .fbar .arrow { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .fpanel.in, .fpanel.out { animation: none; } }
.fbar .arrow { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
