
/* =====================================================
TYPE SCALE — single source of truth
7 sizes + 3 families. Change a value here, it changes everywhere.
===================================================== */
:root{
  /* families */
  --font-display:'Cinzel',serif;                       /* main title only */
  --font-label:'Cinzel Decorative',serif;              /* labels, badges, buttons, section heads */
  --font-body:'Cormorant Garamond',Georgia,serif;      /* everything readable */

  /* size scale */
  --fs-display:2rem;        /* main title (with clamp below) */
  --fs-xl:1.5rem;           /* emoji icons, modal icon, star rows */
  --fs-lg:1.1rem;           /* subtitle, modal value, loading */
  --fs-md:1rem;             /* ALL card titles, card body */
  --fs-sm:0.875rem;         /* author, series line, countdown, inputs, AI body, modal text */
  --fs-xs:0.78rem;          /* buttons, badges, pills */
  --fs-2xs:0.68rem;         /* micro-labels */
}

/* =====================================================
GLOBAL
===================================================== */
*{ box-sizing:border-box; margin:0; padding:0; }
html, body{ overflow-x:clip; } /* nothing may widen the page on phones (fixed buttons drifted on iPhone) */

body{
  background:linear-gradient(160deg,#0d0a1f 0%,#110d28 45%,#080814 100%);
  min-height:100vh;
  font-family:var(--font-body);
  color:#e8e0f5;
  padding:0 1.25rem 3rem;
}

body::before{
  content:''; position:fixed; top:-180px; left:50%; transform:translateX(-50%);
  width:500px; height:500px;
  background:radial-gradient(ellipse,rgba(160,100,240,0.14) 0%,transparent 70%);
  pointer-events:none; z-index:0;
}

/* =====================================================
HEADER
===================================================== */
.hd{ position:relative; text-align:center; padding:5.2rem 1rem 0.5rem; overflow:visible; z-index:1; }

@keyframes tw{
  0%,100%{ opacity:0.65; transform:scale(1); }
  50%{ opacity:1; transform:scale(1.18); }
}

.title{
  font-family:var(--font-display); font-weight:900;
  font-size:clamp(1.5rem,4vw,var(--fs-display)); letter-spacing:0.08em; text-transform:uppercase;
  background:linear-gradient(135deg,#e8c7ff 0%,#c084fc 28%,#f2d6ff 52%,#d8b4fe 76%,#a855f7 100%);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  line-height:1.15; display:block; text-shadow:0 0 12px rgba(192,132,252,0.12);
}

.divline{
  position:relative; z-index:5; width:90px; height:1px;
  background:linear-gradient(90deg,transparent,rgba(220,190,255,0.4),transparent);
  margin:0.55rem auto;
}

.subtitle{ font-style:italic; font-size:var(--fs-lg); color:rgba(230,215,250,0.82); letter-spacing:0.06em; }

/* =====================================================
STARS
===================================================== */
.stars{ position:absolute; top:0.7rem; left:50%; transform:translateX(-50%); width:320px; height:70px; pointer-events:none; z-index:3; }
.stars span{ position:absolute; color:#f0c75e; line-height:1; animation:tw 3s ease-in-out infinite; filter:drop-shadow(0 0 10px rgba(240,199,94,0.35)); }
.s1{ font-size:var(--fs-xl); left:0%; top:20px; }
.s2{ font-size:var(--fs-md); left:18%; top:34px; animation-delay:.5s; }
.s3{ font-size:var(--fs-2xs); left:34%; top:10px; animation-delay:1s; }
.s4{ font-size:2.8rem; left:46%; top:0; animation-delay:.2s; }
.s5{ font-size:var(--fs-2xs); left:64%; top:10px; animation-delay:1.2s; }
.s6{ font-size:var(--fs-md); left:80%; top:34px; animation-delay:.7s; }
.s7{ font-size:var(--fs-xl); left:94%; top:20px; animation-delay:1.5s; }

/* =====================================================
LEGEND
===================================================== */
.legend:not(.legend-sticky){ visibility:hidden; height:0; margin:0; padding:0; border:none; overflow:hidden; }

.legend{
  display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden;
  justify-content:flex-start; align-items:center;
  width:100%; max-width:1050px; margin:0 0 2rem 0; padding:0.9rem 1.2rem;
  border:1px solid rgba(255,255,255,0.06); border-radius:18px;
  background:rgba(255,255,255,0.015); backdrop-filter:blur(4px);
  scrollbar-width:none; -ms-overflow-style:none;
}
.legend:empty{ display:none; }
.legend::-webkit-scrollbar{ display:none; }
.legend-sticky .li{ white-space:nowrap; }

.li{ display:flex; align-items:center; gap:6px; font-size:var(--fs-sm); color:rgba(235,225,250,0.9); font-style:italic; }
.ld{ width:11px; height:11px; border-radius:50%; flex-shrink:0; box-shadow:0 0 10px rgba(255,255,255,0.12); }

.legend-sticky{
  position:sticky; top:0; left:0; right:0; z-index:100;
  border-radius:0; border-left:none; border-right:none; border-top:none;
  border-bottom:1px solid rgba(255,255,255,0.08);
  background:rgba(13,10,31,0.92); backdrop-filter:blur(12px);
  margin:0; max-width:100%; padding:0.6rem 1.2rem;
  flex-wrap:nowrap; overflow-x:auto; align-items:center; justify-content:center;
}

.filter-pill{ transition:all 0.18s ease; user-select:none; white-space:nowrap; flex-shrink:0; }
.filter-pill:hover{ opacity:0.85; }

/* =====================================================
SECTION COLORS (legend dots)
===================================================== */
.cr{ background:#58d6c3; } .up{ background:#f0c75e; } .tbr{ background:#8ee28a; }
.nd{ background:#c95c74; } .cu{ background:#79a8ff; } .cs{ background:#5f7cff; }
.catching{ background:#f0a84c; } .trophy{ background:rgba(200,175,235,0.45); } .drop{ background:#c2415f; }

/* =====================================================
SECTION HEADERS
===================================================== */
.sec{
  font-family:var(--font-label); font-size:var(--fs-sm); letter-spacing:0.18em;
  text-transform:uppercase; margin:2rem 0 0.75rem 0.1rem;
  display:flex; align-items:center; gap:0.5rem; position:relative; z-index:1;
}
.sec::after{ content:''; flex:1; height:1px; background:linear-gradient(90deg,rgba(255,255,255,0.08),transparent); }
.sec-reading{ color:#58d6c3; } .sec-upcoming{ color:#f0c75e; } .sec-tbr{ color:#8ee28a; }
.sec-nd{ color:#c95c74; } .sec-caught{ color:#79a8ff; } .sec-complete{ color:#4f6edb; }
.sec-catching{ color:#f0a84c; } .sec-trophy{ color:#5f7cff; } .sec-dropped{ color:#c2415f; }

/* =====================================================
BOOK GRID
===================================================== */
.grid{ display:grid; grid-template-columns:1fr; gap:1rem; margin-bottom:2rem; position:relative; z-index:1; }

/* =====================================================
BOOK CARDS
===================================================== */
.card{
  background:linear-gradient(145deg,rgba(255,255,255,0.05),rgba(255,255,255,0.025));
  border:1px solid rgba(255,255,255,0.08); border-left:4px solid rgba(255,255,255,0.2);
  border-radius:18px; padding:0.78rem 0.9rem;
  display:flex; align-items:center; gap:0.85rem;
  transition:transform .18s ease,background .18s ease,border .18s ease;
  backdrop-filter:blur(6px); position:relative; overflow:hidden; cursor:pointer;
}
.card:hover{ transform:translateY(-3px); background:linear-gradient(145deg,rgba(255,255,255,0.08),rgba(255,255,255,0.03)); border-color:rgba(255,255,255,0.14); }
.card::before{ content:''; position:absolute; inset:0; background:radial-gradient(circle at top right,rgba(240,199,94,0.08),transparent 40%); pointer-events:none; }

.card-reading{ border-left:4px solid #58d6c3; } .card-upcoming{ border-left:4px solid #f0c75e; }
.card-tbr{ border-left:4px solid #8ee28a; } .card-nd{ border-left:4px solid #c95c74; }
.card-caught{ border-left:4px solid #79a8ff; } .card-complete{ border-left:4px solid #4f6edb; }
.card-catching{ border-left:4px solid #f0a84c; } .card-trophy{ border-left:4px solid rgba(200,175,235,0.45); }
.card-dropped{ border-left:4px solid #c2415f; }
.card-notforme{ border-left:4px solid #f2a8bd; }

/* =====================================================
CARD LAYOUT
===================================================== */
.card-left{ flex-shrink:0; }
.emoji-icon{ width:52px; height:52px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:var(--fs-xl); background:rgba(255,255,255,0.06); flex-shrink:0; }
.card-body{ flex:1; min-width:0; }
.card-right{ text-align:right; flex-shrink:0; min-width:95px; }
.meta{ position:relative; z-index:1; }

/* =====================================================
CARD TEXT
All card titles use --fs-md (was inconsistent: 1rem here, 0.9rem inline on series cards)
===================================================== */
.bk-title{ font-size:var(--fs-md); line-height:1.35; font-weight:600; color:#f5ecff; margin-bottom:0.35rem; }
.bk-series{ font-size:var(--fs-sm); color:rgba(232,224,240,0.6); margin-bottom:0.05rem; }
.bk-author{ font-size:var(--fs-sm); color:rgba(220,205,240,0.72); font-style:italic; }
.release-date{ font-size:var(--fs-sm); font-weight:600; color:#f0eaff; line-height:1.1; margin-bottom:0.15rem; }
.countdown{ font-size:var(--fs-sm); font-style:italic; }
.empty{ opacity:0.55; font-style:italic; padding:0.4rem 0; }

/* =====================================================
BADGES
===================================================== */
.badge-pill{
  display:inline-block; font-size:var(--fs-xs); letter-spacing:0.1em;
  text-transform:uppercase; padding:2px 7px; border-radius:20px;
  margin-top:0.2rem; font-family:var(--font-label);
}

/* =====================================================
ACTION BUTTONS — card buttons
===================================================== */
.btn-row{ display:flex; gap:0.4rem; margin-top:0.5rem; flex-wrap:wrap; }

.act-btn{
  font-family:var(--font-label); font-size:var(--fs-xs); letter-spacing:0.04em;
  padding:3px 8px; border-radius:20px; border:1.5px solid; cursor:pointer;
  background:rgba(255,255,255,0.05); color:#f0eaff; transition:background 0.15s; white-space:nowrap;
}
.act-btn:hover{ background:rgba(255,255,255,0.14); }

/* BB Brains buttons — white, no color tinting */
.bb-btn{
  color:rgba(255,255,255,0.82); border-color:rgba(255,255,255,0.22);
  background:rgba(255,255,255,0.04);
}
.bb-btn:hover{ background:rgba(255,255,255,0.1); color:#ffffff; border-color:rgba(255,255,255,0.38); }

/* =====================================================
LOADING
===================================================== */
.loading{ text-align:center; margin-top:5rem; font-size:var(--fs-lg); color:rgba(235,225,250,0.82); animation:fadePulse 2.2s ease-in-out infinite; }

@keyframes fadePulse{ 0%,100%{ opacity:0.55; } 50%{ opacity:1; } }

/* =====================================================
MOBILE
===================================================== */
@media(max-width:700px){
  :root{ --fs-display:1.4rem; --fs-lg:0.9rem; }
  .legend{ gap:0.5rem 0.8rem; padding:0.8rem; }

  /* Phone layout (22 Sep 2026, Kathryn: cards squished, buttons cut off,
     tabs hidden under the header buttons). */
  /* Header buttons scroll away with the page instead of covering the tabs,
     and sit above the stars (stars start below them). */
  #bbDnaBtn, #bbSignOutBtn{ position:absolute !important; top:6px !important; }
  .stars{ top:2.6rem; }
  .hd{ padding-top:6rem; }
  /* Pop-ups start at the top of what's visible (iPhone's address bar used to
     push their top off-screen) and scroll inside. */
  .mbg{ align-items:flex-start; padding:12px 10px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .modal{ max-height:calc(100dvh - 24px); margin-top:max(8px, env(safe-area-inset-top, 0px)); }
  /* Filter tabs wrap onto two rows so every one is visible and tappable. */
  .legend-sticky{ flex-wrap:wrap; overflow:visible; justify-content:center; gap:2px 10px; padding:6px 8px; }
  .legend-sticky .li, .filter-pill{ min-height:28px; font-size:12.5px; gap:4px; }
  .legend-sticky .ld{ width:9px; height:9px; }
  /* Cards use the full width: the genre icon becomes a small corner badge,
     text runs edge to edge, date + badge wrap underneath. */
  body{ padding-left:0.75rem; padding-right:0.75rem; }
  .card{ flex-wrap:wrap; align-items:flex-start; gap:0.5rem 0.6rem; padding:0.75rem 0.8rem; }
  .card-left{ position:absolute; top:8px; right:8px; z-index:2; }
  .emoji-icon{ width:30px; height:30px; font-size:var(--fs-md); border-radius:8px; }
  .card-body{ flex:1 1 100%; padding-right:34px; }
  .btn-row{ display:flex; flex-wrap:wrap; gap:6px; }
  .card .act-btn{ font-size:11px; padding:4px 10px; margin:0; }
  .card-right{ flex:1 1 100%; min-width:0; text-align:left; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
  .card-right .release-date{ margin-bottom:0; }
  /* "You are here" strip (Kathryn, 23 Sep): date, countdown and badge sit in
     one small line across the TOP of the card, not the bottom. */
  .card-right{ order:-1; gap:2px 8px; padding-right:34px; }
  .card-right .release-date, .card-right .countdown{ font-size:11.5px; line-height:1.3; }
  .card-right .badge-pill{ font-size:9px; padding:1px 6px; margin-top:0; letter-spacing:0.08em; }
  .card-body{ order:0; }
  /* Series line on one row: "books" drops out, long names trail off. */
  .bb-long{ display:none; }
  .bk-series{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12.5px; }
  /* Card buttons a touch smaller so more fit per row. */
  .card .act-btn{ font-size:10.5px; padding:4px 8px; letter-spacing:0.02em; }
  .card .btn-row{ gap:5px; }
  /* Home subtitle on one line. */
  .subtitle{ white-space:nowrap; font-size:clamp(10.5px, 3.5vw, 0.9rem); letter-spacing:0.01em; }
  /* Realignment banner: text on top, the three buttons on one row. */
  .alignment-banner{ padding:0.4rem 0 !important; gap:0.45rem 4px; flex-wrap:wrap; }
  .alignment-text{ flex:1 1 100%; font-size:clamp(10.5px, 3.5vw, 0.9rem); letter-spacing:0.01em; }
  .alignment-banner .act-btn{ margin:0 !important; font-size:10px; padding:4px 7px; letter-spacing:0.02em; }
  /* Bottom buttons share the width so all three fit. */
  #bb-floating{ gap:6px; padding:0 8px; bottom:calc(10px + env(safe-area-inset-bottom, 0px)); }
  #bb-floating .bb-float-btn{ flex:1 1 0; min-width:0; justify-content:center; text-align:center; white-space:normal; line-height:1.15;
    padding:8px 6px; font-size:11px; letter-spacing:0.02em; min-height:46px; }
  #bb-floating .bb-float-left, #bb-floating .bb-float-right{ margin:0; }

  .sec.bb-collapse-h{ padding:6px 0; }
  /* The footer is the last thing in #app now, and body padding (below) keeps
     it clear of the floating buttons, so only a little room is needed here
     (240px left a big empty scroll under the footer, Kathryn 25 Sep 2026). */
  #app{ padding-bottom:calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* =====================================================
DEBRIEF FORM
===================================================== */
.db-field{ margin-bottom:0.9rem; }
.db-label{ font-family:var(--font-label); font-size:var(--fs-2xs); letter-spacing:0.12em; text-transform:uppercase; color:rgba(200,175,235,0.45); margin-bottom:5px; display:block; }
.db-input{ width:100%; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12); border-radius:8px; padding:8px 10px; color:#f0eaff; font-family:var(--font-body); font-size:var(--fs-sm); resize:vertical; }
.db-input:focus{ outline:none; border-color:rgba(200,175,235,0.4); }

.star-row{ display:flex; gap:6px; font-size:var(--fs-xl); cursor:pointer; justify-content:center; margin:0.4rem 0; }
.star-row span{ opacity:0.25; transition:opacity 0.1s; color:#f0c75e; }
.star-row span.on{ opacity:1; }

.yn-row{ display:flex; gap:0.5rem; }
.yn-btn{ flex:1; padding:7px; border-radius:8px; border:1px solid rgba(255,255,255,0.12); background:rgba(255,255,255,0.04); color:rgba(220,205,240,0.6); font-family:var(--font-body); font-size:var(--fs-sm); cursor:pointer; transition:all 0.15s; }
.yn-btn.active{ background:rgba(200,175,235,0.15); border-color:rgba(200,175,235,0.4); color:#f0eaff; }

/* Tap buttons */
.tap-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.tap-row-num{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
.tap-row-num::-webkit-scrollbar{ display:none; }
.tap-btn{ font-family:var(--font-body); font-size:var(--fs-sm); padding:6px 14px; border-radius:20px; border:1.5px solid rgba(200,175,235,0.25); background:rgba(255,255,255,0.04); color:rgba(220,205,240,0.7); cursor:pointer; transition:all 0.15s ease; white-space:nowrap; flex-shrink:0; }
.tap-btn:hover{ background:rgba(200,175,235,0.1); border-color:rgba(200,175,235,0.4); color:#f0eaff; }
.tap-btn.active{ background:rgba(200,175,235,0.18); border-color:rgba(200,175,235,0.6); color:#f0eaff; box-shadow:0 0 10px rgba(200,175,235,0.2); }
.tap-num{ min-width:36px; padding:6px 8px; text-align:center; }
.tap-star{ font-size:var(--fs-sm); padding:6px 12px; }

/* =====================================================
MODALS
===================================================== */
.mbg{ display:none; position:fixed; inset:0; background:rgba(0,0,0,0.84); align-items:center; justify-content:center; z-index:9500; padding:20px; } /* above the mission banner and header buttons */

.modal{ background:linear-gradient(135deg,#1a0f2e 0%,#0f1525 100%); border-radius:16px; padding:24px; max-width:410px; width:100%; max-height:90vh; overflow-y:auto; }

.m-icon{ width:60px; height:60px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:var(--fs-xl); margin:0 auto 12px; background:rgba(255,255,255,0.06); }
.m-title{ font-family:var(--font-label); font-size:var(--fs-sm); text-align:center; margin-bottom:3px; line-height:1.4; color:#f0eaff; }
.m-series{ font-size:var(--fs-sm); color:rgba(200,175,235,0.5); text-align:center; margin-bottom:14px; font-style:italic; }
.m-box{ border-radius:10px; padding:12px; margin-bottom:10px; text-align:center; }
.m-lbl{ font-size:var(--fs-2xs); letter-spacing:0.14em; text-transform:uppercase; color:rgba(200,175,235,0.45); margin-bottom:5px; }
.m-val{ font-size:var(--fs-lg); font-weight:600; color:#f0e8ff; }
.m-cd{ font-size:var(--fs-sm); margin-top:3px; font-style:italic; }
.m-section{ margin-bottom:10px; }
.m-section-lbl{ font-size:var(--fs-2xs); letter-spacing:0.12em; text-transform:uppercase; color:rgba(200,175,235,0.38); margin-bottom:4px; }
.m-section-text{ font-size:var(--fs-sm); color:rgba(200,175,235,0.62); font-style:italic; line-height:1.55; }

/* Modal buttons — all share base sizing */
.m-close, .m-btn-primary, .m-btn-secondary{ width:100%; border-radius:10px; cursor:pointer; transition:background 0.15s; }

.m-close{ padding:9px; font-family:var(--font-body); font-size:var(--fs-sm); letter-spacing:0.1em; background:transparent; border:1px solid rgba(255,255,255,0.1); color:rgba(200,175,235,0.5); margin-top:4px; }

.m-btn-primary{ padding:10px; font-family:var(--font-label); font-size:var(--fs-xs); letter-spacing:0.1em; background:rgba(200,175,235,0.12); border:1px solid rgba(200,175,235,0.3); color:#f0eaff; margin-top:6px; }
.m-btn-primary:hover{ background:rgba(200,175,235,0.22); }

.m-btn-secondary{ padding:9px; font-family:var(--font-body); font-size:var(--fs-sm); background:transparent; border:1px solid rgba(255,255,255,0.08); color:rgba(200,175,235,0.62); margin-top:4px; }
.m-btn-secondary:hover{ background:rgba(255,255,255,0.04); }

/* =====================================================
MODAL BB SECTION
===================================================== */
.m-bb-section{ margin:14px 0 10px; padding:12px 14px 14px; border-radius:12px; border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.025); }
.m-bb-label{ font-family:var(--font-label); font-size:var(--fs-2xs); letter-spacing:0.12em; text-transform:uppercase; color:rgba(235,225,250,0.38); margin-bottom:10px; }
.m-bb-btns{ display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
.m-bb-btns .act-btn{ width:100%; white-space:normal; text-align:center; padding:6px 8px; line-height:1.3; }

/* =====================================================
BB TAKE SHELL — AI response area
===================================================== */
@keyframes bbFadeIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:translateY(0); } }

.bb-take-shell{
  margin:10px 0 8px; padding:14px; border-radius:12px;
  /* border, background, box-shadow set by JS using _accentColor */
  animation:bbFadeIn 0.35s ease forwards;
}

.bb-take-header{ font-family:var(--font-label); font-size:var(--fs-2xs); letter-spacing:0.16em; text-transform:uppercase; margin-bottom:8px; /* color set by JS */ }

.bb-take-body{ font-family:var(--font-body); font-size:var(--fs-sm); color:rgba(240,235,255,0.9); line-height:1.65; font-style:normal; }

.bb-take-loading{ opacity:0.6; font-style:italic; animation:fadePulse 1.8s ease-in-out infinite; }

/* Teach BB conversation history bubbles */
.teach-bubble{ margin:6px 0 4px; padding:8px 12px; border-radius:10px; font-family:var(--font-body); font-size:var(--fs-sm); font-style:normal; }
.teach-bubble-user{ background:rgba(255,255,255,0.05); border-left:3px solid rgba(200,175,235,0.35); color:rgba(220,205,240,0.78); font-style:italic; }
.teach-bubble-bb{ background:rgba(200,175,235,0.06); border-left:3px solid rgba(200,175,235,0.25); color:rgba(240,235,255,0.9); }

/* Markdown elements inside AI responses — sizes here, not inline in JS */
.bb-h1{ font-size:var(--fs-md); font-weight:700; margin:14px 0 5px; line-height:1.3; font-style:normal; }
.bb-h2{ font-size:var(--fs-sm); font-weight:700; margin:11px 0 4px; line-height:1.3; font-style:normal; }
.bb-h3{ font-size:var(--fs-sm); font-weight:600; margin:8px 0 3px; line-height:1.3; font-style:normal; }
.bb-li{ margin:4px 0 4px 8px; font-style:normal; }
.bb-li-bullet{ margin:3px 0 3px 8px; font-style:normal; }

/* ===== Screening: title-correction flag ===== */
.screen-correction{
  font-size:var(--fs-2xs); color:#8ee28a; opacity:.9;
  margin:2px 0 8px; letter-spacing:0.02em;
}

/* ===== Screening: spoiler/safety drawers ===== */
.screen-drawers{ margin:14px 0 4px; display:flex; flex-direction:column; gap:8px; }
.screen-drawer{
  border:1px solid rgba(200,175,235,0.22); border-radius:10px;
  background:rgba(200,175,235,0.04); overflow:hidden;
}
.screen-drawer > summary{
  cursor:pointer; list-style:none; padding:10px 12px;
  font-size:var(--fs-sm); color:#f0eaff; font-weight:600;
  display:flex; align-items:center; flex-wrap:wrap;
  transition:background 0.15s;
}
.screen-drawer > summary::-webkit-details-marker{ display:none; }
.screen-drawer > summary:hover{ background:rgba(200,175,235,0.07); }
.screen-drawer[open] > summary{ border-bottom:1px solid rgba(200,175,235,0.15); }
.screen-drawer-emoji{ margin-right:6px; }
.screen-drawer-teaser{ font-weight:400; color:rgba(200,175,235,0.6); font-size:var(--fs-2xs); }
.screen-drawer-list{ margin:8px 0 10px; padding:0 14px 0 28px; }
.screen-drawer-list li{ margin:4px 0; font-size:var(--fs-sm); line-height:1.5; color:rgba(230,225,240,0.9); }
.screen-drawer-note{
  margin:0; padding:10px 14px; font-size:var(--fs-sm); line-height:1.55;
  color:rgba(230,225,240,0.9); font-style:italic;
}
.screen-noflags{
  margin:14px 0 4px; padding:10px 12px; text-align:center;
  font-size:var(--fs-sm); color:#8ee28a;
  border:1px solid rgba(142,226,138,0.3); border-radius:10px;
  background:rgba(142,226,138,0.05);
}

/* =====================================================
TOAST
===================================================== */
.toast{
  position:fixed; bottom:1.5rem; left:50%; transform:translateX(-50%);
  background:rgba(30,20,50,0.96); border:1px solid rgba(200,175,235,0.25);
  border-radius:12px; padding:10px 18px; font-size:var(--fs-sm); color:#f0eaff;
  z-index:9999; opacity:0; transition:opacity 0.3s; pointer-events:none; white-space:nowrap;
}

/* =====================================================
FLOATING BUTTONS
===================================================== */
#bb-floating{ position:fixed; bottom:1.5rem; left:0; right:0; display:flex; justify-content:space-between; align-items:center; padding:0 1.25rem; pointer-events:none; z-index:200; }

.bb-float-btn{
  pointer-events:auto; font-family:var(--font-label); font-size:var(--fs-xs);
  letter-spacing:0.05em; padding:10px 18px; min-height:42px;
  border-radius:24px; border:1.5px solid rgba(255,255,255,0.22);
  background:rgba(13,10,31,0.92); color:rgba(255,255,255,0.82);
  cursor:pointer; backdrop-filter:blur(10px); box-shadow:0 4px 24px rgba(0,0,0,0.4);
  transition:all 0.18s ease; white-space:nowrap; display:flex; align-items:center;
}
.bb-float-btn:hover{ background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.4); color:#ffffff; transform:translateY(-2px); }
.bb-float-left{ margin-right:auto; }
.bb-float-right{ margin-left:auto; }

.screen-field{width:100%;padding:10px 12px;margin:6px 0;border-radius:8px;
  border:1px solid rgba(200,175,235,0.3);background:rgba(20,16,32,0.6);
  color:#f0eaff;font-size:14px;box-sizing:border-box;}
.screen-error{color:#e06c8a;font-size:13px;min-height:16px;margin-top:4px;}
.screen-loading{text-align:center;padding:30px 10px;}
.screen-loading{text-align:center;padding:30px 10px;}
.spinner{width:44px;height:44px;border:3px solid rgba(200,175,235,0.18);border-top-color:#c9a84c;border-right-color:rgba(201,168,76,0.5);border-radius:50%;margin:0 auto;animation:spin 1.1s cubic-bezier(0.45,0,0.55,1) infinite;box-shadow:0 0 16px rgba(201,168,76,0.25);}
@keyframes spin{to{transform:rotate(360deg);}}
@keyframes spin{to{transform:rotate(360deg);}}
.screen-trust{padding:8px 12px;border-radius:8px;font-size:13px;margin:10px 0;}
.screen-trust.ok{background:rgba(126,200,126,0.12);color:#7ec87e;}
.screen-trust.warn{background:rgba(224,108,138,0.12);color:#e06c8a;}
.screen-clamp{font-size:12px;opacity:.75;font-style:italic;margin:6px 0;}
.screen-verdict-row{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;}
.screen-pill{padding:5px 12px;border-radius:20px;font-size:13px;font-weight:600;}
.screen-pill.verdict{background:rgba(201,168,76,0.18);color:#c9a84c;}
.screen-pill.conf{background:rgba(155,127,212,0.18);color:#9b7fd4;}
.screen-take{margin:14px 0;line-height:1.6;}
.screen-sources{margin:12px 0;font-size:13px;}
.screen-sources summary{cursor:pointer;opacity:.8;}
.screen-sources a{color:#9b7fd4;word-break:break-all;}
.screen-decide-row{display:flex;gap:8px;flex-wrap:wrap;}
.m-action.save.tbr{border-color:rgba(126,200,126,0.5);}
.m-action.save.prio{border-color:rgba(201,168,76,0.5);}
.m-action.save.nope{border-color:rgba(224,108,138,0.5);}

/* =====================================================
FLOAT CHOICE BUTTONS
===================================================== */
.float-btns{ display:flex; flex-direction:column; gap:8px; width:100%; margin-bottom:12px; }

.float-choice-btn{
  width:100%; padding:12px 16px; border-radius:12px;
  border:1px solid rgba(200,175,235,0.2); background:rgba(255,255,255,0.04);
  color:rgba(220,205,240,0.85); font-family:var(--font-body); font-size:var(--fs-sm);
  text-align:left; cursor:pointer; transition:all 0.15s ease;
}
.float-choice-btn:hover{ background:rgba(200,175,235,0.1); border-color:rgba(200,175,235,0.4); color:#f0eaff; }

/* =====================================================
TROPHY SHELF
===================================================== */
.trophy-shelf{ position:relative; z-index:1; }
.trophy-sub-label{ font-family:var(--font-label); font-size:var(--fs-sm); letter-spacing:0.16em; text-transform:uppercase; margin:1.2rem 0 0.5rem 0.1rem; opacity:0.85; }
.trophy-sub-label:first-child{ margin-top:0.4rem; }

/* =====================================================
QUARTERLY ALIGNMENT BANNER
===================================================== */
.alignment-banner{ display:flex; align-items:center; justify-content:center; gap:0.7rem; flex-wrap:wrap; max-width:100%; margin:0 auto 0.6rem; padding:0.35rem 1.2rem; position:relative; z-index:1; }
.alignment-text{ font-size:var(--fs-lg); color:rgba(230,215,250,0.82); font-style:italic; letter-spacing:0.06em; text-align:center; }
.alignment-text strong{ color:#f0c75e; font-style:normal; }

.teach-bb-banner{ color:rgba(255,255,255,0.7); border-color:rgba(255,255,255,0.2); background:rgba(255,255,255,0.04); }
.teach-bb-banner:hover{ background:rgba(255,255,255,0.1); color:#ffffff; }

@keyframes teachGlow{
  0%,100%{ box-shadow:0 0 0 rgba(240,199,94,0); border-color:rgba(255,255,255,0.2); }
  50%{ box-shadow:0 0 14px rgba(240,199,94,0.4); border-color:rgba(240,199,94,0.7); }
}
.teach-bb-glow{ animation:teachGlow 1.2s ease-in-out 3; }

/* =====================================================
SENTINEL (legacy, keep for compatibility)
===================================================== */
#legend-sentinel{ height:1px; margin:0; padding:0; }

/* ============================================================
   Shelf-status card — the "already on your shelf" UI
   ============================================================ */

.shelf-card {
  padding: 4px 2px;
}

.shelf-card-header {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.shelf-card-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: #f0e6ff;
  line-height: 1.3;
  margin-bottom: 2px;
}

.shelf-card-author {
  font-size: 0.85rem;
  color: rgba(240,230,255,0.65);
  font-style: italic;
}

.shelf-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.shelf-status-label {
  font-size: 0.85rem;
  color: rgba(240,230,255,0.75);
}

.shelf-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid;
}
.shelf-status-tbr {
  background: rgba(80, 200, 120, 0.12);
  color: #8be3a6;
  border-color: rgba(80, 200, 120, 0.4);
}
.shelf-status-notforme {
  background: rgba(220, 100, 130, 0.12);
  color: #f0a8b8;
  border-color: rgba(220, 100, 130, 0.4);
}
.shelf-status-dnf {
  background: rgba(180, 100, 200, 0.12);
  color: #d9a8e8;
  border-color: rgba(180, 100, 200, 0.4);
}
.shelf-status-completed {
  background: rgba(120, 160, 240, 0.12);
  color: #a8c0f0;
  border-color: rgba(120, 160, 240, 0.4);
}
.shelf-status-reading {
  background: rgba(240, 200, 100, 0.12);
  color: #f0d088;
  border-color: rgba(240, 200, 100, 0.4);
}
.shelf-status-other {
  background: rgba(200, 200, 220, 0.1);
  color: rgba(240,230,255,0.85);
  border-color: rgba(200, 200, 220, 0.3);
}

.shelf-date {
  font-size: 0.78rem;
  color: rgba(240,230,255,0.55);
  margin-bottom: 14px;
  margin-top: 4px;
}

/* ============================================================
   Last time we screened this — recap block (S + Y + Z)
   ============================================================ */

.shelf-recap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.shelf-recap-heading {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  color: rgba(240,230,255,0.7);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.shelf-recap-row {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(240,230,255,0.85);
  margin-bottom: 6px;
}
.shelf-recap-row:last-child {
  margin-bottom: 0;
}

.shelf-recap-label {
  color: rgba(200,180,240,0.85);
  font-weight: 600;
}

/* ============================================================
   Action buttons on the shelf card
   ============================================================ */

.shelf-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.shelf-actions .bb-btn {
  width: 100%;
}

/* ============================================================
   Picker (Update my shelf → TBR / Not for me)
   ============================================================ */

.shelf-picker {
  padding: 6px 2px;
}

.shelf-picker-prompt {
  font-size: 0.95rem;
  color: rgba(240,230,255,0.9);
  margin-bottom: 16px;
  line-height: 1.4;
}

.shelf-picker-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.shelf-picker-actions .bb-btn {
  width: 100%;
}

.shelf-picker-back {
  text-align: center;
  margin-top: 4px;
}

/* ============================================================
   Not-for-me reason prompt (Column Y editable preview)
   ============================================================ */

.shelf-reason {
  padding: 4px 2px;
}

.shelf-reason-heading {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: #f0a8b8;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.shelf-reason-sub {
  font-size: 0.8rem;
  color: rgba(240,230,255,0.6);
  margin-bottom: 10px;
}

.shelf-reason-box {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #f0e6ff;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.shelf-reason-box:focus {
  outline: none;
  border-color: rgba(200,180,240,0.5);
}

.shelf-reason-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shelf-reason-actions .bb-btn {
  width: 100%;
}

/* ============================================================
   Confirmation card after a successful update
   ============================================================ */

.shelf-confirm {
  text-align: center;
  padding: 14px 4px 4px;
}

.shelf-confirm-icon {
  font-size: 2.4rem;
  color: #8be3a6;
  margin-bottom: 8px;
}

.shelf-confirm-line {
  font-size: 1rem;
  color: #f0e6ff;
  margin-bottom: 4px;
}

.shelf-confirm-sub {
  font-size: 0.85rem;
  color: rgba(240,230,255,0.7);
  margin-bottom: 18px;
}

.shelf-confirm-actions .bb-btn {
  width: 100%;
}

/* Footer: brand, every site page, socials, contact. */
.bb-footer{ text-align:center; margin:3.5rem auto 1rem; max-width:560px; padding:1.6rem 1rem 0; border-top:1px solid rgba(201,160,245,0.16); color:rgba(200,175,235,0.6); font-size:12.5px; }
.bb-foot-orn{ color:#D7AD4F; font-size:12px; margin:0 0 .8rem; }
.bb-foot-mark{ display:block; margin:0 auto .5rem; width:44px; height:44px; opacity:.9; }
.bb-foot-name{ font-family:'Cormorant Garamond','Playfair Display',Georgia,serif; font-size:1.25rem; color:#EFE6FF; letter-spacing:.02em; }
.bb-foot-tag{ font-style:italic; color:#D7AD4F; opacity:.85; margin:.2rem 0 1rem; font-size:12.5px; }
.bb-foot-links{ display:flex; flex-wrap:wrap; justify-content:center; gap:.35rem 1.1rem; margin-bottom:1rem; }
.bb-foot-links a{ color:rgba(221,204,247,0.85); text-decoration:none; font-size:13px; }
.bb-foot-links a:hover{ color:#fff; text-decoration:underline; }
.bb-foot-soc{ display:flex; justify-content:center; gap:.7rem; margin-bottom:.9rem; }
.bb-soc{ display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:50%; border:1px solid rgba(201,160,245,0.3); color:#C9A0F5; background:rgba(42,29,74,.35); transition:background .2s, color .2s; }
.bb-soc:hover{ background:rgba(201,160,245,0.18); color:#fff; }
.bb-foot-mail a{ color:rgba(201,160,245,0.85); text-decoration:none; }
.bb-foot-copy{ margin-top:.5rem; font-size:11.5px; opacity:.6; }

/* Status actions (Start / Finished / DNF / Dropped / Save date) come first,
   above Book Bestie's buttons (Kathryn, 23 Sep 2026). */
.btn-row > .act-btn:not(.bb-btn){ order:-1; }
/* Best format for this reader (bbFormatChips_): plain small text, the third
   line on the right of the card (Kathryn: not a badge). */
.fmt-line{ font-size:14px; color:rgba(220,205,240,0.72); margin-top:0.2rem; white-space:nowrap; }
/* Mood collections inside Unexplored Worlds (bbTbrCollections_), each collapsible. */
.tbr-coll{ display:grid; grid-template-columns:1fr; gap:1rem; }
.tbr-coll-cards{ display:grid; grid-template-columns:1fr; gap:1rem; }
.tbr-coll-closed .tbr-coll-cards{ display:none; }
.tbr-coll-h{ margin:0.9rem 0 0; padding-bottom:5px; border-bottom:1px solid rgba(142,226,138,0.18); font-size:1.05rem; color:#cdeecb; display:flex; align-items:baseline; flex-wrap:wrap; gap:0 6px; cursor:pointer; user-select:none; }
.tbr-coll:first-child .tbr-coll-h{ margin-top:0.2rem; }
.tbr-coll-name{ font-weight:600; letter-spacing:0.03em; }
.tbr-coll-sub{ font-style:italic; opacity:0.8; font-size:0.95rem; }
.tbr-coll-n{ opacity:0.6; }
.tbr-coll-chev{ margin-left:auto; font-size:14px; opacity:.8; transition:transform .2s; transform:rotate(90deg); }
.tbr-coll-closed .tbr-coll-chev{ transform:rotate(0deg); }

/* Collapsible shelf sections (bbMobileCollapse_) — phones and computers. */
.bb-collapse-h{ cursor:pointer; user-select:none; }
.bb-collapse-count{ opacity:.6; letter-spacing:.06em; margin-left:2px; }
.bb-collapse-chev{ margin-left:auto; order:3; font-size:14px; opacity:.8; transition:transform .2s; transform:rotate(90deg); }
.bb-closed .bb-collapse-chev{ transform:rotate(0deg); }
.bb-closed > .grid, .bb-closed > .empty{ display:none !important; }
.sec.bb-collapse-h::after{ order:2; }
.trophy-sub-label.bb-collapse-h{ display:flex; align-items:center; padding:6px 0; }

@media(max-width:700px){ .fmt-line{ font-size:12.5px; } .tbr-coll-h{ font-size:0.98rem; } .tbr-coll-sub{ font-size:0.88rem; } }

/* Card pop-up readability (Kathryn, 23 Sep 2026): the body text was small,
   italic and ~60% faded purple on dark purple. Same brand font, but larger,
   upright and brighter; section labels brighter too. */
.modal .m-title{ font-size:var(--fs-md); }
.modal .m-series{ font-size:0.98rem; color:rgba(221,204,247,0.78); }
.modal .m-lbl, .modal .m-section-lbl{ font-size:0.72rem; color:rgba(215,173,79,0.9); letter-spacing:0.1em; }
.modal .m-section{ margin-bottom:14px; }
.modal .m-section-text{ font-size:1.05rem; font-style:normal; color:#E6DDF5; line-height:1.6; }
.modal .m-bb-label{ color:rgba(235,225,250,0.72); }
.modal .m-close, .modal .m-btn-secondary{ color:rgba(221,204,247,0.8); }

/* Pop-up round 2 (Kathryn): headers never smaller than the text under them;
   the second line in the top box upright and readable. */
.modal .m-lbl, .modal .m-section-lbl{ font-size:0.98rem; letter-spacing:0.08em; }
.modal .m-section-text{ font-size:1.02rem; }
.modal .m-cd{ font-size:1rem; font-style:normal; }
.modal .m-val{ font-size:1.2rem; }

/* Computers: larger card text, section heads, header and footer (phones
   already read well, so they keep their own sizes). */
@media(min-width:701px){
  :root{ --fs-sm:0.98rem; --fs-md:1.15rem; --fs-xs:0.84rem; --fs-lg:1.2rem; }
  .bk-title{ font-size:1.18rem; }
  .bk-series, .bk-author{ font-size:1rem; }
  .sec{ font-size:1rem; }
  .bb-footer{ font-size:14px; }
  .bb-foot-links a{ font-size:15px; }
}

/* Header buttons match the site's other buttons: all caps, label font,
   a touch larger on computers (Kathryn, 23 Sep 2026). */
#bbDnaBtn, #bbSignOutBtn{ font-family:var(--font-label) !important; text-transform:uppercase; letter-spacing:0.08em; font-size:13px !important; padding:7px 14px !important; }
@media(max-width:700px){ #bbDnaBtn, #bbSignOutBtn{ font-size:11px !important; padding:6px 10px !important; } }
/* Collection sub-lines were hard to read (italic Cormorant runs small). */
.tbr-coll-sub{ font-size:1.05rem; opacity:0.9; }
@media(max-width:700px){ .tbr-coll-sub{ font-size:0.95rem; } }

/* Sub-sections take their section's colour. */
#section-upcoming .tbr-coll-h{ border-bottom-color:rgba(240,199,94,0.2); color:#f5e2b0; }
#sub-completed .tbr-coll-h{ border-bottom-color:rgba(95,124,255,0.25); color:#c9d3ff; }
#section-reading .sec{ margin-top:1.25rem; } /* first header sits closer to the filter bar */
/* Section counts: same size as the heading, numbers sitting on the line
   (Cinzel Decorative drew them small and dropped below it). */
.bb-collapse-count{ font-family:var(--font-display); font-size:1em; font-style:normal; font-variant-numeric:lining-nums; letter-spacing:.04em; align-self:center; line-height:1; }
/* Trophy Shelf sub-headings get the same fading divider as the main ones. */
.trophy-sub-label{ display:flex; align-items:center; gap:0.5rem; }
.trophy-sub-label::after{ content:''; flex:1; height:1px; order:2; background:linear-gradient(90deg,rgba(255,255,255,0.08),transparent); }
/* Footer (Kathryn, 23 Sep): no star above the logo, bigger logo, bigger tagline. */
.bb-foot-mark{ width:64px; height:64px; }
.bb-foot-tag{ font-size:15px; }
@media(min-width:701px){ .bb-foot-tag{ font-size:17px; } }
/* Signed-in page lines (Kathryn, 24 Sep): the faded line under the Book Nook
   title is a little bigger, the footer uses the same faded line instead of a
   full-width rule, and the line under the status tabs is gone. */
.divline{ width:170px; height:2px; background:linear-gradient(90deg,transparent,rgba(220,190,255,0.55),transparent); }
.bb-footer{ border-top:none; position:relative; }
.bb-footer::before{ content:''; position:absolute; top:0; left:50%; transform:translateX(-50%); width:170px; height:2px; background:linear-gradient(90deg,transparent,rgba(220,190,255,0.55),transparent); }
.legend-sticky{ border-bottom:none; }
/* Room under the footer so the floating buttons sit below the copyright
   once you reach the bottom, never on top of it. */
body{ padding-bottom:6.5rem; }
@media(max-width:700px){ body{ padding-bottom:7.5rem; } }
.fmt-line{ display:inline-flex; align-items:center; gap:6px; } .fmt-line span:last-child{ margin-left:2px; }
/* Bigger header logo (Kathryn, 24 Sep: "Between" and "the" were hard to
   read), with the stars spread wider to frame it. */
.stars{ width:min(520px,92vw); }
.s8{ font-size:var(--fs-2xs); left:8%; top:44px; animation-delay:.9s; }
.s9{ font-size:var(--fs-2xs); left:88%; top:46px; animation-delay:1.8s; }
/* Footer text links light up on hover (24 Sep). */
.bb-foot-mail a:hover{ color:#fff; text-decoration:underline; text-underline-offset:3px; }
/* 24 Sep fixes: format line back on its own row (under the pill), collection
   counts sit on the line at full size, Trophy Shelf's line reads as a
   divider (it doesn't fold). */
.card-right .fmt-line{ display:flex; justify-content:flex-end; align-items:center; gap:6px; }
.tbr-coll-n{ font-family:var(--font-display); font-size:0.92em; font-style:normal; font-variant-numeric:lining-nums; align-self:center; line-height:1; }
.sec-trophy::after{ background:repeating-linear-gradient(90deg, rgba(95,124,255,.35) 0 6px, transparent 6px 12px); height:1px; opacity:.8; }
@media(max-width:700px){ .card-right .fmt-line{ flex-basis:100%; justify-content:flex-start; } }
/* 24 Sep: footer links fit on one row; every in-app button lights up on hover. */
.bb-footer{ max-width:860px; }
button:not(:disabled){ transition:filter .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
#bbOnboard button:hover:not(:disabled), .modal button:hover:not(:disabled), .m-close:hover, .m-btn-primary:hover, .m-btn-secondary:hover, .float-choice-btn:hover, #bbGapOpts button:hover, #bbTrialBar button:hover, #bbTrialBar a:hover, #bbDnaBtn:hover, #bbSignOutBtn:hover, .act-btn:hover{ filter:brightness(1.18); border-color:rgba(215,164,255,.75) !important; box-shadow:0 0 0 1px rgba(215,164,255,.25), 0 6px 18px rgba(181,123,234,.25); }
#bbDetailOpts button:hover{ filter:brightness(1.18); border-color:rgba(215,164,255,.75) !important; }

/* Reader DNA cards: one per row on phones, two side by side on iPad and computer
   (Kathryn, 25 Sep 2026). */
@media (max-width: 640px) {
  .bb-dna-grid { grid-template-columns: 1fr !important; }
}
/* Cards may shrink below their longest word so nothing pushes the page sideways. */
.bb-dna-grid > * { min-width: 0; overflow-wrap: anywhere; }
#bbOnboard { overscroll-behavior-x: none; }
