/* =============================================================
   Hoshiko — anime.chocoyaki.com

   Dark-first, inverted from hokkaido: cover art is the content, and 2,400
   posters on near-black read as a media wall. Light mode is a token
   override and is honestly labelled "usable, not polished".

   Three faces, each with one job:
     Zen Kaku Gothic New 900  display + every Japanese string. A Japanese
       gothic set in Latin reads as "designed in Japan" without being a
       novelty face, and it renders 日本語 natively instead of falling back.
     IBM Plex Sans            body/UI. Not Inter — Inter is the default
       everyone reaches for, and Plex Sans's humanist forms sit against Zen
       Kaku with no visible seam, which matters because Latin and Japanese
       titles constantly share a line here.
     IBM Plex Mono            every numeral. This is a database; counts,
       scores and years have to align in columns.

   The signature is the shelf strip (棚) — see .shelf.
   ============================================================= */

:root {
  color-scheme: dark;

  /* surfaces: a fixed 5-step ladder, no ad-hoc greys */
  --void:     #07080f;
  --shelf:    #0e1122;
  --shelf-2:  #151a2e;
  --rule:     #1e2740;
  --rule-lit: #2b3a5c;

  /* ink — contrast ratios measured on --void */
  --ink:       #e6ecf2;  /* 15.0:1 */
  --ink-dim:   #93a3b8;  /*  7.4:1 */
  --ink-faint: #6b7c91;  /*  4.6:1 — the floor, decorative meta only */

  /* accent: her hairclip cyan */
  --hoshi:      #22d3ee;             /* as TEXT on void: 10.4:1 */
  --hoshi-deep: #0e7490;             /* as FILL only */
  --hoshi-wash: rgba(34,211,238,.10);
  --hoshi-edge: rgba(34,211,238,.30);
  --on-hoshi:   #04121a;             /* the ONLY ink allowed on a cyan fill.
                                        white on cyan is 2.4:1 — never. */

  /* state */
  --kohaku:      #f4a13c;            /* needs a human: partial, unmapped */
  --kohaku-wash: rgba(244,161,60,.12);
  --midori:      #4ade80;            /* complete, synced */
  --beni:        #f0645a;            /* conflict, destructive */

  --focus: #7dd3fc;                  /* lighter than the accent so it shows
                                        ON a cyan fill too */

  /* Every stack ends in the JP face. Latin and Japanese share a line
     constantly here — a title, its original name, a search placeholder — and
     without it CJK falls through to whatever the OS has, which on a machine
     with no Japanese font installed is tofu (▯▯▯). The Latin face still wins
     for Latin because it comes first; the JP face only catches what the
     others cannot draw. */
  --face-jp:  'Zen Kaku Gothic New','Hiragino Sans','Noto Sans JP',sans-serif;
  --face-ui:  'IBM Plex Sans',system-ui,-apple-system,'Zen Kaku Gothic New','Noto Sans JP',sans-serif;
  --face-num: 'IBM Plex Mono',ui-monospace,'SF Mono','Zen Kaku Gothic New',monospace;

  --t-micro: .72rem;   /* 11.5px — HARD FLOOR site-wide */
  --t-small: .82rem;
  --t-body:  .95rem;
  --t-lead:  1.06rem;
  --t-h2:    clamp(1.3rem, 3vw, 1.7rem);
  --t-h1:    clamp(1.6rem, 4.5vw, 2.4rem);
  --t-hero:  clamp(2.4rem, 8vw, 4.5rem);
  --track:   .14em;

  --s1:.25rem; --s2:.5rem; --s3:.75rem; --s4:1rem;
  --s5:1.5rem; --s6:2rem;  --s7:3rem;   --s8:4.5rem;

  --r-chip: 999px;
  --r-card: 10px;   /* a 2:3 poster at 18px reads as an app icon; 10px reads
                       as a spine on a shelf */
  --r-panel: 14px;
  --r-input: 8px;

  --shadow:     0 10px 30px -14px rgba(0,0,0,.8);
  --shadow-lit: 0 0 0 1px var(--hoshi-edge), 0 12px 34px -16px rgba(34,211,238,.28);

  --wrap: 1440px;
  --read: 68ch;
  --tap: 44px;
}

html[data-theme="light"] {
  color-scheme: light;
  --void:#f7f8fb; --shelf:#fff; --shelf-2:#eef1f7;
  --rule:#dde3ee; --rule-lit:#b9c4d8;
  --ink:#10141f; --ink-dim:#4c586d; --ink-faint:#6c7789;
  --hoshi:#0b7f96; --hoshi-deep:#0891b2; --on-hoshi:#fff;
  --hoshi-wash:rgba(8,145,178,.08); --hoshi-edge:rgba(8,145,178,.30);
  --kohaku:#9a5c06; --midori:#17803d; --beni:#b93227; --focus:#0b7f96;
  --shadow:0 10px 30px -16px rgba(20,30,60,.22);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--void); color:var(--ink);
  font:400 var(--t-body)/1.5 var(--face-ui);
  -webkit-font-smoothing:antialiased;
  display:flex; flex-direction:column; min-height:100vh;
}
h1,h2,h3,p,ul,ol,figure { margin:0; }
ul,ol { padding:0; list-style:none; }
img { display:block; max-width:100%; }
a { color:var(--hoshi); text-decoration:none; }
a:hover { text-decoration:underline; }
button,input,select,textarea { font:inherit; color:inherit; }
/* Hard-won on hokkaido: any control under 16px makes Android zoom on focus
   and then fights the user's zoom on every reflow. Never lower this. */
input,select,textarea {
  font-family:var(--face-ui);
  font-size:max(16px,1rem); max-width:100%; min-width:0;
  background:var(--shelf-2); border:1px solid var(--rule);
  border-radius:var(--r-input); padding:.55rem .7rem;
}
input:focus-visible,select:focus-visible,textarea:focus-visible,
a:focus-visible,button:focus-visible,summary:focus-visible {
  outline:2px solid var(--focus); outline-offset:2px;
}
:where([lang="ja"]) { font-family:var(--face-jp); }
.u-sr {
  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:-999px; top:0; z-index:99;
  background:var(--hoshi); color:var(--on-hoshi); padding:var(--s3) var(--s4);
}
.skip:focus { left:0; }

/* ---------- header ---------- */
.top {
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; gap:var(--s4);
  padding:var(--s3) var(--s4);
  background:color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--rule);
}
.brand { display:flex; align-items:center; gap:var(--s2); text-decoration:none; }
.brand:hover { text-decoration:none; }
.brand__face {
  width:34px; height:34px; border-radius:999px;
  /* she is a prone, right-facing figure — this crop is her face and the
     hands she is resting her chin on */
  object-fit:cover; object-position:82% 26%;
  border:1px solid var(--hoshi-edge); background:var(--shelf-2);
}
.brand__name {
  font:900 1.05rem/1 var(--face-jp); color:var(--ink); letter-spacing:.01em;
}
.top__nav { display:flex; gap:var(--s4); margin-left:var(--s3); }
.top__nav a {
  color:var(--ink-dim); font:600 var(--t-small)/1 var(--face-ui);
  padding:var(--s2) 0; border-bottom:2px solid transparent;
}
.top__nav a:hover { color:var(--ink); text-decoration:none; }
.top__nav a[aria-current="page"] { color:var(--hoshi); border-bottom-color:var(--hoshi); }
.top__right { margin-left:auto; display:flex; align-items:center; gap:var(--s3); }

.wifi { margin:0; }
.wifi__btn {
  display:inline-flex; align-items:center; gap:var(--s2);
  background:var(--shelf-2); border:1px solid var(--rule);
  border-radius:var(--r-chip); padding:.35rem .7rem; cursor:pointer;
  font:500 var(--t-micro)/1 var(--face-num); color:var(--ink-dim);
}
.wifi__btn:hover { border-color:var(--rule-lit); color:var(--ink); }
.wifi__dot {
  width:7px; height:7px; border-radius:999px; background:var(--ink-faint);
}
.wifi__btn[aria-pressed="true"] {
  border-color:var(--hoshi-edge); color:var(--hoshi); background:var(--hoshi-wash);
}
.wifi__btn[aria-pressed="true"] .wifi__dot { background:var(--hoshi); }

/* ---------- page furniture ---------- */
main { flex:1; }
.wrap { max-width:var(--wrap); margin:0 auto; padding:var(--s5) var(--s4) var(--s8); }
.foot {
  display:flex; gap:var(--s4); flex-wrap:wrap; justify-content:space-between;
  max-width:var(--wrap); margin:0 auto; width:100%;
  padding:var(--s5) var(--s4); border-top:1px solid var(--rule);
  color:var(--ink-faint); font:500 var(--t-micro)/1.4 var(--face-num);
}
.eyebrow {
  font:500 var(--t-micro)/1 var(--face-num);
  letter-spacing:var(--track); text-transform:uppercase; color:var(--ink-faint);
}

/* ---------- SIGNATURE: the shelf strip (棚) ----------
   The collection seen end-on, as the spine edges of books on a shelf.

   The load-bearing decision: each decade's WIDTH is proportional to how many
   titles you own from it, so the 2010s section is physically wider than the
   1970s — exactly as a real shelf would be. Density and width carry the same
   fact, which is why it reads as an object rather than as a chart. An earlier
   version gave every decade an equal slot and drew a few centred ticks in it;
   that read as scattered noise over an empty rule, because the shape of the
   collection was the one thing it failed to show.

   The hairlines are a repeating gradient — zero DOM nodes for ~600 spines.
   It exists because this shelf genuinely spans 66 years; on a two-year-old
   library it would say nothing. */
.shelf {
  display:flex; align-items:stretch; gap:7px;
  margin:var(--s5) 0 0; position:relative;
}
.shelf__dec {
  position:relative; min-width:22px; height:42px;
  padding-bottom:15px;               /* room for the label under the spines */
  text-decoration:none;
}
.shelf__dec::before {
  content:""; position:absolute; inset:0 0 15px 0; border-radius:2px;
  background:
    repeating-linear-gradient(90deg, var(--rule-lit) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--shelf-2), var(--shelf));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  transition:background .18s, box-shadow .18s;
}
.shelf__dec:hover { text-decoration:none; }
.shelf__dec:hover::before { box-shadow:inset 0 0 0 1px var(--hoshi-edge); }

/* Lit only when a filter is NARROWING things. With no filter on, every
   decade matches, so lighting them all would make the resting state the
   loudest state — the opposite of what the strip is for. Quiet by default;
   the strip answers "where on the shelf does my filter live?" */
.shelf--filtered .shelf__dec[data-hit="1"]::before {
  background:
    repeating-linear-gradient(90deg, var(--hoshi) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--shelf-2), var(--shelf));
}
.shelf--filtered .shelf__dec[data-hit="0"]::before { opacity:.4; }
.shelf__dec[aria-current="true"]::before {
  background:
    repeating-linear-gradient(90deg, var(--hoshi) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--shelf-2), var(--shelf));
  box-shadow:inset 0 0 0 1px var(--hoshi);
}
.shelf__label {
  position:absolute; inset:auto 0 0 0; text-align:center;
  font:500 var(--t-micro)/1 var(--face-num); color:var(--ink-faint);
}
.shelf__dec:hover .shelf__label,
.shelf__dec[aria-current="true"] .shelf__label { color:var(--hoshi); }
.shelf__cap {
  display:flex; justify-content:space-between; gap:var(--s4); flex-wrap:wrap;
  margin-top:var(--s3);
  font:500 var(--t-micro)/1 var(--face-num); color:var(--ink-faint);
}

/* ---------- console (search + sort + chips + filters) ---------- */
.console {
  position:sticky; top:57px; z-index:15;
  background:color-mix(in srgb, var(--void) 92%, transparent);
  backdrop-filter:blur(12px);
  padding:var(--s3) 0 var(--s2);
  border-bottom:1px solid var(--rule);
}
.console__row { display:flex; gap:var(--s2); align-items:center; }
.console__search { flex:1; min-width:0; position:relative; }
.console__search input { width:100%; padding-left:2.1rem; }
.console__search::before {
  content:"⌕"; position:absolute; left:.7rem; top:50%; transform:translateY(-50%);
  color:var(--ink-faint); font-size:1.1rem; pointer-events:none;
}
.console__go {
  background:var(--hoshi-deep); color:#fff; border:none;
  border-radius:var(--r-input); padding:.6rem 1rem; cursor:pointer;
  font:600 var(--t-small)/1 var(--face-ui);
}
.console__go:hover { background:var(--hoshi); color:var(--on-hoshi); }
.console select { padding-right:1.6rem; }

.chiprow {
  display:flex; gap:var(--s2); align-items:center; flex-wrap:wrap;
  margin-top:var(--s2); min-height:30px;
}
.count { font:500 var(--t-micro)/1 var(--face-num); color:var(--ink-dim); }
.count b { color:var(--ink); font-weight:600; }

.chip {
  display:inline-flex; align-items:center; gap:var(--s2); min-height:30px;
  padding:0 var(--s3); background:var(--shelf-2); border:1px solid var(--rule);
  border-radius:var(--r-chip); color:var(--ink-dim);
  font:600 var(--t-small)/1 var(--face-ui); white-space:nowrap;
}
.chip:hover { text-decoration:none; border-color:var(--rule-lit); color:var(--ink); }
.chip--on   { background:var(--hoshi-wash); border-color:var(--hoshi-edge); color:var(--hoshi); }
.chip--warn { background:var(--kohaku-wash); border-color:var(--kohaku); color:var(--kohaku); }
.chip--clear { border-style:dashed; }
/* A facet that would empty the result set. Still clickable — it is a real
   answer, and disabling it would hide that the combination exists — but it
   must not look like an invitation. */
.chip--off { opacity:.38; }
.chip--off:hover { opacity:.7; }
.chip__x { opacity:.7; font-size:1.05em; line-height:1; }
@media (hover:none) { .chip { min-height:38px; } }

.fpanel { margin-top:var(--s2); }
.fpanel__sum {
  display:inline-flex; align-items:center; gap:var(--s2); cursor:pointer;
  color:var(--ink-dim); font:600 var(--t-small)/1 var(--face-ui);
  padding:var(--s2) 0; list-style:none;
}
.fpanel__sum::-webkit-details-marker { display:none; }
.fpanel__sum::before { content:"▸"; transition:transform .15s; }
.fpanel[open] .fpanel__sum::before { transform:rotate(90deg); }
.fpanel__grid {
  display:grid; gap:var(--s4); padding:var(--s4) 0;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  border-top:1px solid var(--rule);
}
.fgroup > .eyebrow { display:block; margin-bottom:var(--s2); }
.fgroup__list { display:flex; flex-wrap:wrap; gap:var(--s2); max-height:9.5rem; overflow:auto; }
.frow { display:flex; gap:var(--s2); align-items:center; }
.frow input[type="number"] { width:6rem; }

/* ---------- the grid ---------- */
.grid {
  display:grid; gap:var(--s4) var(--s3); margin-top:var(--s5);
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
}
@media (min-width:1100px){ .grid{grid-template-columns:repeat(auto-fill,minmax(176px,1fr));} }

.acard {
  position:relative; display:flex; flex-direction:column;
  background:var(--shelf); border:1px solid var(--rule);
  border-radius:var(--r-card); overflow:hidden;
  transition:border-color .16s, transform .16s, box-shadow .16s;
}
.acard:hover, .acard:focus-within {
  border-color:var(--rule-lit); transform:translateY(-2px); box-shadow:var(--shadow-lit);
}
.acard__art {
  display:block; aspect-ratio:2/3; background:var(--shelf-2);
  position:relative; overflow:hidden;
}
.acard__art img { width:100%; height:100%; object-fit:cover; filter:saturate(.9); }
.acard:hover .acard__art img { filter:none; }
/* stretched link: one tab stop per card, named by its title, and no JS */
.acard__art::after { content:""; position:absolute; inset:0; }

/* No-art state. Every card is art-less until the agent uploads covers, so
   this is the DEFAULT presentation and has to look deliberate. The Japanese
   title set large in Zen Kaku is a genuinely handsome object, and it is also
   the most useful thing we could put there. */
.acard__blank {
  position:absolute; inset:0; display:flex; flex-direction:column;
  justify-content:space-between; padding:var(--s3);
  background:
    linear-gradient(160deg,
      hsl(var(--hue) 42% 16% / .85), hsl(var(--hue) 38% 9% / .95)),
    var(--shelf-2);
}
.acard__blank::before {
  content:""; position:absolute; inset:0;
  background:repeating-linear-gradient(90deg,
    rgba(255,255,255,.045) 0 1px, transparent 1px 6px);
  mix-blend-mode:overlay;
}
.acard__ja {
  position:relative; font:900 1.15rem/1.35 var(--face-jp);
  color:rgba(255,255,255,.92);
  display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden;
  text-shadow:0 2px 12px rgba(0,0,0,.5);
}
.acard__ja--ro { font-size:1rem; line-height:1.3; font-weight:600; font-family:var(--face-ui); }
.acard__seal {
  position:relative; align-self:flex-start;
  font:500 var(--t-micro)/1 var(--face-num); letter-spacing:var(--track);
  color:rgba(255,255,255,.62);
}

.acard__body { padding:var(--s3); display:flex; flex-direction:column; gap:var(--s1); }
.acard__title {
  font:600 var(--t-small)/1.3 var(--face-ui); color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.acard__meta {
  display:flex; gap:var(--s2); align-items:baseline;
  font:500 var(--t-micro)/1 var(--face-num); color:var(--ink-dim);
}
.acard__type { color:var(--hoshi); letter-spacing:.04em; }
.acard__score { margin-left:auto; color:var(--ink); font-weight:600; }
.acard__eps--partial { color:var(--kohaku); }
.acard__plex { position:relative; z-index:2; }

/* ---------- pager ---------- */
.pager {
  display:flex; gap:var(--s2); justify-content:center; align-items:center;
  flex-wrap:wrap; margin-top:var(--s7);
}
.pager a, .pager span {
  min-width:2.2rem; height:2.2rem; display:inline-flex; align-items:center;
  justify-content:center; padding:0 .6rem; border-radius:var(--r-input);
  border:1px solid var(--rule); color:var(--ink-dim);
  font:500 var(--t-small)/1 var(--face-num);
}
.pager a:hover { border-color:var(--rule-lit); color:var(--ink); text-decoration:none; }
.pager [aria-current="page"] {
  background:var(--hoshi-wash); border-color:var(--hoshi-edge); color:var(--hoshi);
}
.pager .gap { border:none; }

/* ---------- Plex button ---------- */
.pbtn {
  display:inline-flex; align-items:center; gap:var(--s2); min-height:var(--tap);
  padding:0 var(--s4); border-radius:var(--r-chip);
  background:var(--hoshi-deep); color:#fff; border:none;
  font:600 var(--t-small)/1 var(--face-ui); white-space:nowrap;
}
.pbtn:hover { background:var(--hoshi); color:var(--on-hoshi); text-decoration:none; }
/* The button always says where it is about to send you. This one detail
   kills the top failure mode: "I clicked, got a spinner, don't know why." */
.pbtn__host {
  font:500 var(--t-micro)/1 var(--face-num); opacity:.75;
  padding-left:var(--s2); border-left:1px solid rgba(255,255,255,.25);
}
.pbtn--none {
  background:none; color:var(--kohaku); border:1px dashed var(--kohaku);
  cursor:default;
}
.pbtn--ghost { background:none; color:var(--hoshi); border:1px solid var(--hoshi-edge); }
.pbtn--sm { min-height:32px; padding:0 var(--s3); font-size:var(--t-micro); }

/* ---------- title page ---------- */
.tp { display:grid; gap:var(--s6); grid-template-columns:minmax(0,1fr); }
@media (min-width:900px){ .tp{grid-template-columns:260px minmax(0,1fr);} }
.tp__art {
  aspect-ratio:2/3; border-radius:var(--r-panel); overflow:hidden;
  border:1px solid var(--rule); position:relative; background:var(--shelf-2);
}
.tp__side { display:flex; flex-direction:column; gap:var(--s4); }
.tp h1 { font:900 var(--t-h1)/1.15 var(--face-jp); letter-spacing:-.01em; }
.tp__alt { color:var(--ink-dim); font:400 var(--t-lead)/1.4 var(--face-ui); }
.tp__alt[lang="ja"] { font-family:var(--face-jp); }
.tp__facts {
  display:flex; flex-wrap:wrap; gap:var(--s2) var(--s4);
  font:500 var(--t-small)/1 var(--face-num); color:var(--ink-dim);
  padding:var(--s3) 0; border-block:1px solid var(--rule);
}
.tp__facts b { color:var(--ink); font-weight:600; }
.tp__syn { max-width:var(--read); color:var(--ink-dim); line-height:1.65; }
.tp__syn p + p { margin-top:var(--s3); }

.sect { margin-top:var(--s6); }
.sect > .eyebrow { display:block; margin-bottom:var(--s3); }

.taglist { display:flex; flex-wrap:wrap; gap:var(--s2); }
.tagmore { margin-top:var(--s3); }
.tagmore > summary {
  cursor:pointer; color:var(--ink-dim); font:600 var(--t-small)/1 var(--face-ui);
  padding:var(--s2) 0; list-style:none;
}
.tagmore > summary::-webkit-details-marker { display:none; }
.tagmore[open] > summary { color:var(--ink); }

.seasons { display:flex; gap:var(--s2); flex-wrap:wrap; }
.season {
  display:flex; flex-direction:column; gap:2px; min-width:6.5rem;
  padding:var(--s3); border:1px solid var(--rule); border-radius:var(--r-input);
  background:var(--shelf); color:var(--ink-dim);
  font:500 var(--t-micro)/1.3 var(--face-num);
}
.season:hover { border-color:var(--rule-lit); text-decoration:none; }
.season[aria-current="true"] { border-color:var(--hoshi-edge); background:var(--hoshi-wash); }
.season b { color:var(--ink); font:600 var(--t-small)/1.2 var(--face-ui); }

.links { display:flex; flex-wrap:wrap; gap:var(--s2); }

/* ---------- Hoshiko ---------- */
.hosh { display:flex; align-items:flex-end; pointer-events:none; }
.hosh__img {
  width:clamp(96px,15vw,150px); height:auto; flex:0 0 auto;
  filter:drop-shadow(0 6px 14px rgba(0,0,0,.6));
  animation:hosh-drift 7s ease-in-out infinite;
}
.hosh__bubble {
  pointer-events:auto; position:relative; margin:0 0 1.8rem -.4rem;
  max-width:24ch; padding:var(--s3) var(--s4);
  background:var(--shelf-2); color:var(--ink);
  border:1px solid var(--hoshi-edge); border-radius:var(--r-panel);
  font:500 var(--t-small)/1.45 var(--face-ui);
}
/* She faces right, so the bubble sits to her right with the tail pointing
   back at her, at mouth height. */
.hosh__bubble::before {
  content:""; position:absolute; left:-7px; bottom:14px;
  width:12px; height:12px; background:var(--shelf-2); transform:rotate(45deg);
  border-left:1px solid var(--hoshi-edge); border-bottom:1px solid var(--hoshi-edge);
}
@keyframes hosh-drift { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
/* On a phone she would eat a third of the screen. "Never in the way", made
   mechanical rather than left to judgement. */
@media (max-width:560px){
  .hosh__img { display:none; }
  .hosh__bubble { max-width:none; margin:0; }
  .hosh__bubble::before { display:none; }
}

/* ---------- empty / zero states ---------- */
.zero {
  display:flex; align-items:flex-end; gap:var(--s4); flex-wrap:wrap;
  padding:var(--s7) 0;
}
.zero__msg h2 { font:900 var(--t-h2)/1.2 var(--face-jp); margin-bottom:var(--s2); }
.zero__msg p { color:var(--ink-dim); }

/* ---------- landing: the gate ----------
   One figure, one line, one door, centred in the viewport. Nothing else on
   the page, because anything else would be a fact about a private shelf. */
.gate {
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:var(--s5); padding:var(--s6) var(--s4);
}
.hosh--gate .hosh__img { width:clamp(160px,26vw,240px); }
.hosh--gate .hosh__bubble { font-size:var(--t-lead); max-width:none; }
@media (max-width:560px){
  .hosh--gate { flex-direction:column; align-items:center; gap:var(--s3); }
  .hosh--gate .hosh__img { display:block; width:min(62vw,220px); }
  .hosh--gate .hosh__bubble { margin:0; text-align:center; }
}

/* ---------- landing (legacy hero, kept for ?page=stats style views) ---------- */
.land { max-width:var(--wrap); margin:0 auto; padding:var(--s8) var(--s4); }
.land__hero { display:flex; flex-direction:column; gap:var(--s5); }
.land h1 {
  font:900 var(--t-hero)/1.02 var(--face-jp); letter-spacing:-.02em; max-width:14ch;
}
.land h1 em { font-style:normal; color:var(--hoshi); }
.land__sub { color:var(--ink-dim); font-size:var(--t-lead); max-width:46ch; }

/* The shelf seen end-on: 2,400 spine edges as ONE gradient, zero DOM nodes.
   You perceive the SIZE of the collection without seeing a single title —
   which is the point, since the covers are private. */
.spines {
  height:clamp(96px,17vh,168px); border-radius:var(--r-panel);
  border:1px solid var(--rule); position:relative; overflow:hidden;
  background:
    repeating-linear-gradient(90deg,
      var(--rule)     0 1px, transparent 1px 3px,
      var(--rule-lit) 3px 4px, transparent 4px 7px),
    linear-gradient(180deg, var(--shelf) 0%, var(--void) 100%);
}
.spines::after {
  content:""; position:absolute; inset:0;
  background:repeating-linear-gradient(90deg,
    var(--hoshi) 0 1px, transparent 1px 53px);
  opacity:.45;
}
.land__stats {
  display:flex; flex-wrap:wrap; gap:var(--s2) var(--s5);
  font:500 var(--t-small)/1 var(--face-num); color:var(--ink-dim);
}
.land__stats b { color:var(--ink); font-weight:600; }
.land__cta { display:flex; gap:var(--s3); align-items:center; flex-wrap:wrap; }

/* ---------- forms / panels ---------- */
.panel {
  background:var(--shelf); border:1px solid var(--rule);
  border-radius:var(--r-panel); padding:var(--s5);
}
.form { display:flex; flex-direction:column; gap:var(--s3); max-width:22rem; }
.form label { font:600 var(--t-small)/1 var(--face-ui); color:var(--ink-dim); }
.err {
  background:rgba(240,100,90,.1); border:1px solid var(--beni);
  color:var(--beni); border-radius:var(--r-input); padding:var(--s3);
  font-size:var(--t-small);
}
.note { color:var(--ink-faint); font-size:var(--t-micro); }

table.tbl { width:100%; border-collapse:collapse; font-size:var(--t-small); }
.tbl th {
  text-align:left; font:500 var(--t-micro)/1 var(--face-num);
  letter-spacing:var(--track); text-transform:uppercase; color:var(--ink-faint);
  padding:var(--s2); border-bottom:1px solid var(--rule);
}
.tbl td { padding:var(--s2); border-bottom:1px solid var(--rule); color:var(--ink-dim); }
.tbl tr:hover td { color:var(--ink); }
.scroll { overflow-x:auto; }

/* ---------- narrow screens ----------
   The header and console are the two places that genuinely break: the nav
   collides with the brand and pushes Settings off-screen, and the search box
   gets squeezed to "Searc" by the sort control beside it. */
@media (max-width:720px){
  .top { gap:var(--s2); padding:var(--s2) var(--s3); flex-wrap:wrap; }
  .brand__name { display:none; }          /* the avatar carries the brand */
  .top__nav { margin-left:0; gap:var(--s3); flex:1; }
  .top__nav a { font-size:var(--t-micro); }
  .wifi__label { display:none; }           /* the dot carries the state */
  .wifi__btn { padding:.4rem .55rem; }

  .console { top:49px; }
  .console__row { flex-wrap:wrap; }
  .console__search { flex:1 0 100%; order:-1; }   /* search gets its own row */
  .console select { flex:1; min-width:0; }
  .shelf__cap span:last-child { display:none; }   /* the explainer, not the fact */
  .wrap { padding:var(--s4) var(--s3) var(--s7); }
  .fpanel__grid { grid-template-columns:1fr; }
}
@media (max-width:420px){
  .grid { grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:var(--s3) var(--s2); }
  .acard__ja { font-size:1rem; -webkit-line-clamp:4; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after { animation-duration:.001ms !important; animation-iteration-count:1 !important;
                         transition-duration:.001ms !important; scroll-behavior:auto !important; }
  .acard:hover { transform:none; }
}
