/* ==========================================================
   Maker Library — the room after dark
   ----------------------------------------------------------
   The dialog box is not CSS: it's assets/img/panel-9.png,
   used the way an Android nine-patch is. The middle stretches,
   the corners don't. Swap that PNG to restyle the box.
   ========================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink-900: #0e0a07;
  --ink-800: #150f0b;
  --ink-700: #1d1510;
  --wood: #2c1f17;
  --wood-2: #3a281c;

  --paper: #f4ead5;
  --paper-2: #e8d9ba;
  --ink: #241a14;
  --ink-soft: #6b5844;

  --brass: #c9a227;
  --brass-dim: rgba(201, 162, 39, .35);
  --amber: #e8a13c;
  --orange: #dd6a2f;
  --teal: #3f9f97;
  --plum: #8a5a7d;

  --text: #f5edde;
  --text-dim: #b7a992;
  --text-faint: #8a7a66;
  --hair: rgba(201, 162, 39, .22);

  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Courier New", Courier, monospace;

  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-900);
  overflow-x: hidden;
}

body.tray-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

/* author display rules would otherwise beat the hidden attribute */
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--paper); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transition: top .18s ease;
}
.skip:focus { top: 12px; }

/* ---------------- top bar ---------------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 14px clamp(14px, 3.5vw, 40px);
  background: linear-gradient(rgba(14, 10, 7, .92), rgba(14, 10, 7, .55) 70%, transparent);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity .22s ease;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; color: var(--amber); }
.brand-text {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand-em { color: var(--amber); font-style: italic; }

.topnav { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.topnav a {
  font-size: .86rem; font-weight: 500; color: var(--text-dim);
  transition: color .18s ease;
}
.topnav a:hover { color: var(--text); }
.topnav-cta {
  padding: 8px 14px;
  border: 1px solid var(--hair);
  border-radius: 100px;
  color: var(--text) !important;
  background: rgba(221, 106, 47, .14);
  white-space: nowrap;
}
.topnav-cta:hover { background: rgba(221, 106, 47, .26); border-color: var(--brass-dim); }

/* ---------------- stage ---------------- */

.stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, #241811 0%, var(--ink-900) 62%);
}

.scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.scene-glow {
  position: absolute;
  left: 50%; top: -18%;
  width: 90vw; height: 70vh;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(232, 161, 60, .20), transparent 72%),
    radial-gradient(closest-side, rgba(63, 159, 151, .12), transparent 70%);
  filter: blur(28px);
}

.shelves {
  position: absolute;
  inset: 6vh -4vw 12vh -4vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: .55;
  filter: blur(.7px) brightness(.62) saturate(.75);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 21%;
  padding-bottom: 9px;
}

.shelf-books {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.spine {
  width: var(--w);
  height: var(--h);
  flex: none;
  background: var(--c);
  border-radius: 2px 2px 1px 1px;
  transform: rotate(var(--tilt));
  transform-origin: bottom center;
  box-shadow:
    inset -2px 0 rgba(0, 0, 0, .35),
    inset 2px 0 rgba(255, 255, 255, .07),
    0 2px 6px rgba(0, 0, 0, .35);
  position: relative;
}
.spine::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 22%;
  height: 2px;
  background: rgba(201, 162, 39, .35);
}
.spine:nth-child(4n)::after { top: 68%; }

.plank {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 9px;
  background: linear-gradient(var(--wood-2), #1b120c);
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
}

.scene-floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 26vh;
  background:
    linear-gradient(transparent, rgba(14, 10, 7, .9) 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 74px);
}

.scene-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(130% 100% at 50% 45%, transparent 40%, rgba(8, 5, 3, .72) 100%),
    linear-gradient(transparent 60%, rgba(8, 5, 3, .55));
}

/* ---------------- dialog: the 9-patch box ---------------- */

.dialog {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: clamp(12px, 2.4vh, 30px);
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 2rem));
}

.plate {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-left: 24px;
  padding: 7px 18px 6px;
  background: linear-gradient(#f7edd7, #e6d5b3);
  color: var(--ink);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 0 rgba(201, 162, 39, .5) inset, 0 6px 18px rgba(0, 0, 0, .35);
}

.plate-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
}
.plate-role {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7a5f3f;
}

/* 96x96 source, 30px corners, centre stretched, glass painted by `fill`.
   Change the border width and the whole frame scales with it. */
.dialog-body {
  position: relative;
  border: 26px solid transparent;
  border-image: url("../img/panel-9.png") 30 fill stretch;
  border-radius: 0;
  background: #150f0b;              /* fallback + the glass tint behind the art */
  padding: clamp(6px, 1.1vw, 14px) clamp(8px, 1.4vw, 18px) clamp(10px, 1.6vw, 20px);
}

.speech {
  font-family: var(--serif);
  font-size: clamp(1.14rem, 1.7vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -.005em;
  min-height: 2.6em;
  color: var(--text);
}

.caret {
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--amber);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.thinking {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: .9rem;
}
.thinking em { font-style: normal; letter-spacing: .02em; }
.think-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  animation: dot 1.1s ease-in-out infinite;
}
.think-dot:nth-child(2) { animation-delay: .15s; }
.think-dot:nth-child(3) { animation-delay: .3s; }
@keyframes dot {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-3px); }
}

.ask-form { display: flex; gap: 8px; margin-top: 14px; }

#ask-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(201, 162, 39, .26);
  border-radius: 8px;
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
#ask-input::placeholder { color: var(--text-faint); }
#ask-input:focus {
  border-color: var(--brass);
  background: rgba(255, 255, 255, .07);
}

#ask-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  font-weight: 600;
  font-size: .95rem;
  color: #201509;
  background: linear-gradient(180deg, #f0c060, var(--brass));
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
#ask-submit:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 22px -10px rgba(201, 162, 39, .8); }
#ask-submit:active { transform: translateY(0); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.chip {
  padding: 7px 13px;
  font-size: .82rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.chip:hover {
  color: var(--text);
  border-color: var(--brass-dim);
  background: rgba(201, 162, 39, .1);
}

.hint {
  margin-top: 10px;
  font-size: .78rem;
  color: var(--text-faint);
  letter-spacing: .01em;
}

/* ---------------- results tray ---------------- */

.tray {
  position: fixed;
  inset: 0;
  z-index: 100;   /* above the fixed top bar, which must never paint over it */
}

.tray-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 5, .74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .3s ease;
}
.tray.is-open .tray-backdrop { opacity: 1; }

.tray-panel {
  position: absolute;
  top: clamp(10px, 4vh, 44px);
  bottom: clamp(10px, 4vh, 44px);
  right: clamp(12px, 3vw, 48px);
  width: min(1000px, calc(100vw - 30vw));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg, 18px);
  background: linear-gradient(180deg, rgba(34, 25, 18, .98), rgba(16, 11, 8, .99));
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .95);
  opacity: 0;
  transform: translateY(18px) scale(.995);
  transition: opacity .32s ease, transform .32s cubic-bezier(.2, .9, .2, 1);
}
.tray.is-open .tray-panel { opacity: 1; transform: none; }

body.tray-open .dialog { visibility: hidden; }
body.tray-open .topbar { opacity: 0; pointer-events: none; }

.tray-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(18px, 2.4vw, 28px) clamp(18px, 2.6vw, 32px) 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.tray-kicker {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

.tray-title {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.tray-note {
  margin-top: 8px;
  font-size: .88rem;
  color: var(--text-dim);
  max-width: 60ch;
}

.tray-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 100px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.tray-close:hover { background: rgba(201, 162, 39, .14); border-color: var(--brass-dim); }

.books {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  padding: clamp(14px, 2vw, 22px) clamp(18px, 2.6vw, 32px);
  align-content: start;
  scrollbar-width: thin;
}

/* ---------------- a book ---------------- */

.book {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  min-height: 186px;
  border-radius: 7px;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(170deg, #f8efdc, #ecdcbe);
  box-shadow:
    0 14px 28px -18px rgba(0, 0, 0, .9),
    inset 0 0 0 1px rgba(120, 90, 55, .18);
  transition: transform .22s ease, box-shadow .22s ease;
  animation: book-in .45s both;
  animation-delay: var(--delay, 0ms);
}

@keyframes book-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.book:hover {
  transform: translateY(-3px);
  box-shadow:
    0 26px 44px -22px rgba(0, 0, 0, .95),
    inset 0 0 0 1px rgba(120, 90, 55, .3);
}

.book-spine {
  position: relative;
  background: linear-gradient(90deg, hsl(var(--hue) 42% 30%), hsl(var(--hue) 44% 40%) 62%, hsl(var(--hue) 40% 33%));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 0;
}
.book-spine::after {
  content: "";
  position: absolute;
  inset: 14px 6px auto;
  height: 1px;
  background: rgba(255, 255, 255, .35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

.book-call {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: rgba(255, 255, 255, .8);
}

.book-body {
  padding: 16px 40px 30px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.book-meta {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a6b45;
}

.book-title {
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.book-blurb {
  font-size: .84rem;
  line-height: 1.5;
  color: #4c3c2c;
}

.book-why {
  margin-top: auto;
  font-size: .78rem;
  font-style: italic;
  color: #7c5f3d;
}

.book-open {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #8a5a2b;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .2s ease, transform .2s ease;
}
.book:hover .book-open { opacity: 1; transform: none; }

.book-rank {
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(120, 90, 55, .28);
}

.book-hit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 2;
}
.book:has(.book-hit:focus-visible) {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
.book-hit:focus-visible { outline: none; }

/* ---------------- tray footer + sponsor plate ---------------- */

.tray-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px clamp(18px, 2.6vw, 32px) 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: #14100b;
}

.timing {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-faint);
  letter-spacing: .01em;
}

.ad-slot { flex: 1 1 340px; max-width: 460px; display: flex; justify-content: flex-end; }

.promo {
  position: relative;
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 10px 14px 11px;
  border: 1px solid rgba(201, 162, 39, .3);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(201, 162, 39, .1), rgba(201, 162, 39, .03));
  transition: border-color .18s ease, background .18s ease;
}
.promo:hover { border-color: var(--brass); background: rgba(201, 162, 39, .14); }

.promo-flag {
  position: absolute;
  top: -8px; left: 12px;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #201509;
  background: var(--brass);
  border-radius: 2px;
}

.promo-brand {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
}

.promo-headline {
  font-family: var(--serif);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.promo-body {
  font-size: .76rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.promo-cta {
  margin-top: 3px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--brass);
}

/* ---------------- card catalog ---------------- */

.stacks {
  padding: clamp(48px, 8vw, 96px) clamp(16px, 5vw, 64px) clamp(56px, 8vw, 100px);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(221, 106, 47, .07), transparent 70%),
    var(--ink-800);
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.stacks-head { max-width: 62ch; margin-bottom: clamp(24px, 4vw, 44px); }

.kicker {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.stacks h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.stacks-sub {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: .95rem;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 10px;
  align-items: start;
}

.stack-group {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}

.stack-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  transition: background .16s ease;
}
.stack-group summary::-webkit-details-marker { display: none; }
.stack-group summary:hover { background: rgba(255, 255, 255, .035); }

.stack-call {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--amber);
  border: 1px solid var(--brass-dim);
  border-radius: 4px;
  padding: 2px 6px;
}

.stack-label {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.stack-count { font-family: var(--mono); font-size: .66rem; color: var(--text-faint); }

.stack-list {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 6px;
}

.stack-list li + li { border-top: 1px solid rgba(255, 255, 255, .045); }

.stack-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background .15s ease;
}
.stack-list a:hover { background: rgba(255, 255, 255, .04); }

.stack-title {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.stack-blurb {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--text-faint);
}

/* ---------------- footer ---------------- */

.site-footer {
  padding: clamp(34px, 5vw, 56px) clamp(16px, 5vw, 64px) clamp(40px, 6vw, 64px);
  border-top: 1px solid rgba(255, 255, 255, .06);
  background: var(--ink-900);
}

.foot-brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.foot-brand span { color: var(--amber); font-style: italic; }

.foot-note { font-size: .88rem; color: var(--text-dim); max-width: 60ch; }
.foot-fine { margin-top: 14px; font-size: .74rem; color: var(--text-faint); max-width: 66ch; }

.site-footer a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(201, 162, 39, .5); }
.site-footer a:hover { text-decoration-color: var(--brass); }

.noscript {
  max-width: 60ch;
  margin: 40px auto;
  padding: 24px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--ink-700);
}
.noscript ul { margin: 12px 0 0 18px; }
.noscript a { color: var(--amber); text-decoration: underline; }

/* ---------------- responsive ---------------- */

@media (max-width: 1100px) {
  .tray-panel { width: calc(100vw - 26vw); }
}

@media (max-width: 980px) {
  .tray-panel {
    width: auto;
    left: clamp(8px, 2vw, 20px);
    right: clamp(8px, 2vw, 20px);
    top: clamp(8px, 2vh, 20px);
    bottom: clamp(8px, 2vh, 20px);
  }
  .topnav a:not(.topnav-cta) { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .dialog { width: calc(100% - 1rem); bottom: 8px; }
  .dialog-body {
    border-width: 18px;            /* the 9-patch scales with it */
    padding: 4px 8px 8px;
  }
  .plate { margin-left: 12px; padding: 6px 12px 5px; }
  .plate-role { display: none; }
  .speech { font-size: 1.06rem; min-height: 3.1em; }
  .ask-form { flex-direction: column; }
  #ask-submit { padding: 12px; justify-content: center; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .hint { display: none; }
  .books { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  .tray-head { padding: 16px 14px 12px; flex-direction: column; gap: 10px; }
  .tray-heading { width: 100%; }
  .tray-close { align-self: flex-start; }
  .tray-foot { padding: 10px 14px 14px; }
  .ad-slot { justify-content: stretch; max-width: none; }
  .book { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret, .think-dot { animation: none; }
  .book { animation: none; }
  .tray-panel, .tray-backdrop, .book { transition: none; }
}
