:root {
  /* Haute-Horlogerie & Fine-Press Editorial Palette (Leica / Criterion / Readwise / Apple Books) */
  --bg-outer: #040405;
  --bg-canvas: #0a0a0c;
  --bg-surface: #111114;
  --bg-surface-hover: #16161a;
  --bg-elevated: #18181c;
  --bg-sheet: rgba(15, 15, 18, 0.94);
  --bg-pill: rgba(18, 18, 22, 0.86);

  --ink-primary: #f3f0e8;
  --ink-secondary: #9c968c;
  --ink-muted: #5e5a53;

  --accent-bone: #d6c5a5;
  --accent-bone-soft: rgba(214, 197, 165, 0.09);
  --accent-bone-glow: rgba(214, 197, 165, 0.16);
  --accent-bone-line: rgba(214, 197, 165, 0.32);
  --live-green: #34d399;
  --danger-rose: #e57373;

  --hairline: rgba(255, 255, 255, 0.065);
  --hairline-strong: rgba(255, 255, 255, 0.11);
  --specular-top: rgba(255, 255, 255, 0.13);
  --card-gradient: radial-gradient(130% 110% at 0% 0%, rgba(214, 197, 165, 0.055) 0%, rgba(17, 17, 20, 0.96) 65%);

  --spring-ios: cubic-bezier(0.32, 0.72, 0, 1);

  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Side margin of every screen; narrows on small phones (see the max-width: 520px block). */
  --gutter: 26px;
}

body.theme-parchment {
  --bg-outer: #ded8cc;
  --bg-canvas: #f6f3ec;
  --bg-surface: #ece7dc;
  --bg-surface-hover: #e4decb;
  --bg-elevated: #e2dcd0;
  --bg-sheet: rgba(246, 243, 236, 0.96);
  --bg-pill: rgba(240, 236, 226, 0.9);

  --ink-primary: #171614;
  --ink-secondary: #656058;
  --ink-muted: #989186;

  --accent-bone: #7d5f30;
  --accent-bone-soft: rgba(125, 95, 48, 0.09);
  --accent-bone-glow: rgba(125, 95, 48, 0.16);
  --accent-bone-line: rgba(125, 95, 48, 0.34);
  --live-green: #059669;
  --danger-rose: #c62828;

  --hairline: rgba(23, 22, 20, 0.075);
  --hairline-strong: rgba(23, 22, 20, 0.13);
  --specular-top: rgba(255, 255, 255, 0.65);
  --card-gradient: radial-gradient(130% 110% at 0% 0%, rgba(125, 95, 48, 0.06) 0%, rgba(236, 231, 220, 0.98) 65%);
}

/* ============================================================================
   PART 1: ZERO SCROLLBARS ANYWHERE & GLOBAL OPTICAL DISCIPLINE
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html, body {
  background-color: var(--bg-outer);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  user-select: none;
}

.tactile {
  transition:
    transform 260ms var(--spring-ios),
    opacity 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
  cursor: pointer;
}

.tactile:active {
  transform: scale(0.965);
}

svg.icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ============================================================================
   PART 2: EDITORIAL PORTRAIT PRESENTATIONS (GALLERY LIGHTING & FILM GRADE)
   ============================================================================ */
.portrait-frame {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
  box-shadow:
    0 0 0 1px var(--hairline-strong),
    0 6px 16px rgba(0, 0, 0, 0.45);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) saturate(0.84);
  transition: transform 360ms var(--spring-ios), filter 360ms ease;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.portrait-xs { width: 24px; height: 24px; }
.portrait-sm { width: 32px; height: 32px; }
.portrait-md { width: 42px; height: 42px; }
.portrait-lg { width: 52px; height: 52px; }
.portrait-xl {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px var(--accent-bone-line),
    0 14px 32px rgba(0, 0, 0, 0.55);
}
.portrait-xl img {
  border-radius: 20px;
}
.portrait-xl::after {
  border-radius: 20px;
}

/* ============================================================================
   PART 3: PHONE HARDWARE SHELL & VAUL VIEWPORT DEPTH
   ============================================================================ */
.device-stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: radial-gradient(circle at 50% 15%, #131210 0%, #040405 70%);
}

.phone-app-shell {
  width: 100%;
  max-width: 428px;
  height: min(896px, calc(100dvh - 40px));
  background: var(--bg-canvas);
  border-radius: 50px;
  border: 1px solid var(--specular-top);
  box-shadow:
    0 50px 130px -20px rgba(0, 0, 0, 0.92),
    0 0 0 9px rgba(255, 255, 255, 0.018),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (max-width: 520px) {
  html, body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .device-stage {
    padding: 0;
    height: 100dvh;
    overflow: hidden;
  }
  .phone-app-shell {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    /* Keeps content clear of the notch when a phone is turned sideways. */
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  :root {
    /* 17px on a 320px phone, 21px on 390px, 24px from 444px. */
    --gutter: clamp(16px, 5.4vw, 24px);
  }
}

.app-inner-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  background: var(--bg-canvas);
  transition:
    transform 480ms var(--spring-ios),
    border-radius 480ms var(--spring-ios),
    opacity 480ms var(--spring-ios),
    filter 480ms var(--spring-ios);
  transform-origin: center top;
  overflow: hidden;
  position: relative;
}

.phone-app-shell.sheet-active .app-inner-viewport {
  transform: scale(0.935) translateY(12px);
  border-radius: 36px;
  opacity: 0.42;
  filter: blur(1px);
}

.screen-view {
  display: none;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
  animation: screenFade 280ms var(--spring-ios);
}

.screen-view.active {
  display: flex;
}

@keyframes screenFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   PART 4: LOBBY MASTHEAD, RECESSED GLASS SEARCH & FILTER PILLS
   ============================================================================ */
.lobby-header {
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.masthead {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.masthead .brand-serif {
  line-height: 1;
}

.masthead-overline {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The masthead's one action: open a salon around any book */
.masthead-action {
  flex-shrink: 0;
  margin-bottom: 2px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.section-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-secondary);
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-serif {
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent-bone);
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.header-right-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.minimal-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.minimal-icon-btn.active {
  color: var(--ink-primary);
  border-color: var(--hairline-strong);
}

/* Recessed Optical Search Bar */
.search-bar-container {
  padding: 2px var(--gutter) 12px;
  flex-shrink: 0;
}

.editorial-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.editorial-search-wrap svg {
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
  pointer-events: none;
}

.editorial-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 10px 14px 10px 36px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.editorial-search-input::placeholder {
  color: var(--ink-muted);
}

.editorial-search-input:focus {
  border-color: var(--accent-bone-line);
}

/* Category Filter Pills */
.category-pills-row {
  display: flex;
  gap: 8px;
  padding: 0 var(--gutter) 16px;
  overflow-x: auto;
  flex-shrink: 0;
}

.category-pill {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.category-pill.active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
  font-weight: 600;
}

/* Scrollable Feed with Top & Bottom Fade Masks */
.lobby-scroll-feed {
  flex: 1;
  overflow-y: auto;
  padding: 6px var(--gutter) calc(104px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 96px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 12px, black calc(100% - 96px), transparent 100%);
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
  margin-bottom: -6px;
}

/* ============================================================================
   PART 5: 3D CLOTHBOUND BOOK OBJECTS & ARCHITECTURAL ROOM CARDS
   ============================================================================ */
.fine-press-cover {
  width: 96px;
  height: 140px;
  border-radius: 3px 10px 10px 3px;
  position: relative;
  flex-shrink: 0;
  /* The words sit inside the gilt frame (inset 7px, 12px at the spine) with air around them. */
  padding: 13px 13px 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 8px 0 14px rgba(0, 0, 0, 0.65),
    inset 3px 0 0 rgba(255, 255, 255, 0.14),
    4px 0 0 -1px #d9d2c5,
    5px 0 0 -1px rgba(0, 0, 0, 0.4),
    0 18px 34px -6px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.fine-press-cover.small {
  width: 76px;
  height: 111px;
  padding: 10px 10px 9px 14px;
  box-shadow:
    inset 6px 0 10px rgba(0, 0, 0, 0.6),
    inset 2px 0 0 rgba(255, 255, 255, 0.12),
    3px 0 0 -1px #d9d2c5,
    0 12px 24px -4px rgba(0, 0, 0, 0.6);
}

.cover-foil-frame {
  position: absolute;
  inset: 6px 6px 6px 11px;
  border: 1px solid rgba(214, 197, 165, 0.25);
  border-radius: 1px 5px 5px 1px;
  pointer-events: none;
}

.cover-numeral {
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  color: var(--accent-bone);
  opacity: 0.9;
}

.cover-title-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.16;
  color: #f4f1ea;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.fine-press-cover.small .cover-title-text {
  font-size: 9.5px;
  letter-spacing: -0.02em;
}

.fine-press-cover.small .cover-foil-frame {
  inset: 4px 4px 4px 9px;
}

.fine-press-cover.small .cover-author-text {
  font-size: 6.5px;
}

.cover-title-text,
.cover-author-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* A long word is hyphenated inside the frame instead of crossing its line or breaking anywhere. */
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.cover-title-text { -webkit-line-clamp: 5; }
.cover-author-text { -webkit-line-clamp: 2; }

.cover-author-text {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.6);
}

/* Featured Hero Live Room Card */
.hero-room-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  box-shadow:
    inset 0 1px 0 var(--specular-top),
    0 24px 48px -12px rgba(0, 0, 0, 0.55);
  border-radius: 26px;
  padding: clamp(16px, 5vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-top-split {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.hero-meta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.live-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bone);
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.hero-book-title {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  font-weight: 400;
  margin-top: 2px;
}

.hero-book-author {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.hero-book-summary {
  font-size: 12.5px;
  line-height: 1.52;
  color: var(--ink-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  gap: 10px;
}

.host-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.host-mini-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.host-mini-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-mini-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-bone);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.join-room-btn {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* The featured card's call to sit: full width, so it never crowds the host on small phones. */
.join-room-btn.hero-cta {
  width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: -2px;
}

/* Quiet notes at the end of a feed, and the footer at the foot of Profile */
.feed-footnote {
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-secondary);
  text-align: center;
  padding: 4px 8px 0;
}

.app-footer {
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.app-footer-links a,
.app-footer-contact {
  font-size: 11.5px;
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 4px 0;
}

.app-footer-links a:active,
.app-footer-contact:active {
  color: var(--ink-primary);
}

.app-footer-mark {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* The library: search results in the salon sheet and the Search tab */
.salon-sheet {
  height: 85%;
}

/* The subject chips run edge to edge inside the sheet's padding */
.library-topics {
  padding: 0;
  margin: -4px 0 -6px;
}

.library-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  padding: 2px 0 8px;
}

.library-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--hairline);
  text-align: left;
  color: inherit;
}

.library-row .fine-press-cover.small {
  transform: scale(0.72);
  transform-origin: left center;
  margin-right: -22px;
}

.library-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.library-row-title {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.library-row-author {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-secondary);
}

.library-row-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-invite {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 18px;
  border-radius: 22px;
  background: var(--card-gradient);
  border: 1px solid var(--accent-bone-line);
  box-shadow: inset 0 1px 0 var(--specular-top);
  text-align: left;
  color: inherit;
}

.library-invite-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink-primary);
}

.library-invite-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.library-invite-cta {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-bone);
}

/* Secondary Architectural Room Card in Lobby */
.lobby-room-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 22px;
  padding: clamp(14px, 4.4vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby-card-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.lobby-room-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lobby-room-title {
  font-family: var(--font-serif);
  font-size: 19.5px;
  color: var(--ink-primary);
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin-top: 2px;
}

.lobby-room-author {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-secondary);
}

.lobby-room-summary {
  font-size: 12px;
  line-height: 1.48;
  color: var(--ink-secondary);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lobby-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  gap: 8px;
}

/* ============================================================================
   PART 6: FLOATING ARCHITECTURAL BOTTOM TAB BAR
   ============================================================================ */
.bottom-tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-pill);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid var(--hairline);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
}

.tab-bar-item {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 2px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.tab-bar-item.active {
  color: var(--ink-primary);
}

.tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.tab-badge {
  position: absolute;
  top: -4px;
  right: -9px;
  background: var(--accent-bone);
  color: #141311;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  padding: 1px 4.5px;
  border-radius: 999px;
}

/* ============================================================================
   PART 7: LIVE READING ROOM MASTHEAD & SACRED BOOK MANUSCRIPT PAGE
   ============================================================================ */
.minimal-header {
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.back-lobby-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
}

.spoiler-safe-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}

.book-scroll-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px calc(var(--gutter) + 4px) calc(140px + env(safe-area-inset-bottom, 0px));
  scroll-behavior: smooth;
  mask-image: linear-gradient(to bottom, transparent 0px, black 16px, black calc(100% - 108px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 16px, black calc(100% - 108px), transparent 100%);
}

.editorial-title-block {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}

.editorial-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editorial-kicker {
  gap: 10px;
}

/* The chapter line opens the chapters of the full book */
.chapter-picker-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  text-align: left;
  min-width: 0;
}

/* Long titles ("Book the First—Recalled to Life · Chapter I · The Period") keep to two lines. */
.chapter-picker-btn {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-picker-btn:disabled {
  cursor: default;
}

.chapter-picker-btn:not(:disabled) {
  color: var(--accent-bone);
}

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
}

.chapter-row,
.chapter-resume {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: left;
  color: var(--ink-primary);
  font-family: var(--font-serif);
  font-size: 16px;
}

.chapter-row + .chapter-row {
  border-top: 1px solid var(--hairline);
  border-radius: 0;
}

.chapter-row.current {
  color: var(--accent-bone);
}

.chapter-row.current .chapter-row-title::before {
  content: "● ";
  font-size: 9px;
  vertical-align: 2px;
}

.chapter-resume {
  flex-direction: column;
  gap: 3px;
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  padding: 12px 14px;
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.chapter-row-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.chapter-credit {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-secondary);
}

.next-chapter-btn {
  display: block;
  width: 100%;
  margin: 18px 0 6px;
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editorial-h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.editorial-byline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-secondary);
  margin-top: 6px;
}

/* Unified Architectural Reader & Room Selector Console */
.room-reader-console {
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.edition-selector-pill {
  background: transparent;
  border: none;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
  flex: 1;
}

.console-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.console-mini-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  color: var(--accent-bone);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.avatar-stack {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.avatar-stack img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--bg-surface);
  filter: contrast(1.04) saturate(0.84);
  margin-left: -6px;
}

.avatar-stack img:first-child {
  margin-left: 0;
}

/* Subtle Editorial Instruction Banner */
.interactive-coach-pill {
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.interactive-coach-pill strong {
  color: var(--ink-primary);
  font-weight: 500;
}

.coach-spark {
  color: var(--accent-bone);
  font-size: 12px;
  flex-shrink: 0;
}

/* Flowing Continuous Book Paragraphs with Fine-Press Drop Cap */
.continuous-manuscript {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.manuscript-paragraph {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.78;
  color: var(--ink-primary);
  letter-spacing: -0.003em;
  text-align: left;
}

.manuscript-paragraph:first-child::first-letter {
  font-family: var(--font-serif);
  font-size: 52px;
  line-height: 0.84;
  float: left;
  padding-right: 10px;
  padding-top: 4px;
  color: var(--accent-bone);
  font-weight: 400;
}

.continuous-manuscript.loupe-mode .flowing-sentence:not(.loupe-selected) {
  opacity: 0.24;
}

.flowing-sentence {
  display: inline;
  position: relative;
  border-radius: 4px;
  padding: 2px 0;
  transition:
    opacity 320ms var(--spring-ios),
    background-color 220ms ease,
    color 220ms ease;
  cursor: pointer;
}

.flowing-sentence.has-resonance {
  text-decoration: underline;
  text-decoration-color: var(--accent-bone-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.flowing-sentence.reading-active {
  background: var(--accent-bone-soft);
}

.flowing-sentence.loupe-selected {
  background: var(--accent-bone-soft);
  text-decoration: underline;
  text-decoration-color: var(--accent-bone);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

.word-span {
  transition: color 120ms ease, background-color 120ms ease;
  border-radius: 3px;
}

.word-span.spoken-now {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  padding: 0 3px;
}

/* ============================================================================
   PART 7B: THE TABLE (THE PEOPLE IN THE ROOM, SEATED AROUND THE LINES BEING READ)
   ============================================================================ */
#roomView.table-mode .interactive-coach-pill,
#roomView.table-mode .continuous-manuscript {
  display: none;
}

#roomView.table-mode .editorial-title-block {
  margin-bottom: 4px;
  padding-bottom: 14px;
}

#roomView.table-mode .editorial-h1 {
  font-size: 26px;
}

.presence-table {
  margin: 0 -14px 24px;
}

.table-stage {
  position: relative;
  padding: 46px 30px 52px;
}

.table-surface {
  position: relative;
  min-height: 250px;
  border-radius: 30px;
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 60px rgba(0, 0, 0, 0.42);
  padding: 50px 38px 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  transition: border-color 600ms ease, box-shadow 600ms ease;
}

.presence-table.warm .table-surface {
  border-color: var(--accent-bone-line);
  box-shadow:
    0 0 0 1px var(--accent-bone-line),
    0 0 70px var(--accent-bone-glow),
    0 28px 60px rgba(0, 0, 0, 0.42);
}

.table-line {
  font-family: var(--font-serif);
  color: var(--ink-secondary);
  font-size: 14.5px;
  line-height: 1.5;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 220ms ease;
}

.table-line.blank {
  min-height: 1em;
  cursor: default;
}

.table-line.current {
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink-primary);
  opacity: 1;
  display: block;
  overflow: visible;
  border-radius: 8px;
  padding: 4px 2px;
}

.table-line.current.loupe-selected {
  text-decoration: underline;
  text-decoration-color: var(--accent-bone);
  text-underline-offset: 6px;
}

.table-seats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.seat {
  position: absolute;
  left: calc(30px + (100% - 60px) * var(--sx));
  top: calc(46px + (100% - 98px) * var(--sy));
  transform: translate(-50%, -38%);
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  cursor: default;
  transition: opacity 400ms ease;
}

.seat.reader,
.seat.self {
  cursor: pointer;
}

.seat-face {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  color: #f3f0e8;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 3px var(--bg-canvas),
    0 0 0 4px var(--hairline-strong),
    0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 320ms var(--spring-ios), box-shadow 320ms ease;
}

.seat-face img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.84);
}

.seat.reader .seat-face {
  width: 62px;
  height: 62px;
}

.seat.speaking .seat-face {
  animation: seatVoice 1.15s ease-in-out infinite;
}

@keyframes seatVoice {
  0%, 100% {
    box-shadow:
      0 0 0 3px var(--bg-canvas),
      0 0 0 4px var(--accent-bone-line),
      0 0 0 4px var(--accent-bone-glow);
  }
  50% {
    box-shadow:
      0 0 0 3px var(--bg-canvas),
      0 0 0 5px var(--accent-bone),
      0 0 0 14px var(--accent-bone-glow);
  }
}

.seat.glow .seat-face {
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px var(--bg-canvas),
    0 0 0 5px var(--accent-bone),
    0 0 30px var(--accent-bone-glow);
}

.seat.away {
  opacity: 0.45;
}

.seat.empty .seat-face {
  background: transparent;
  color: var(--accent-bone);
  border: 1.5px dashed var(--accent-bone-line);
  box-shadow: 0 0 0 3px var(--bg-canvas);
  font-size: 20px;
}

.seat-live {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live-green);
  border: 2px solid var(--bg-canvas);
}

.seat-name {
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-primary);
  background: var(--bg-canvas);
  border-radius: 999px;
  padding: 1px 7px;
}

.seat-note {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-bone);
  white-space: nowrap;
  background: var(--bg-canvas);
  border-radius: 999px;
  padding: 0 6px;
}

.seat-crowd {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent-bone);
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  border-radius: 999px;
  padding: 3px 9px;
  pointer-events: auto;
}

.table-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 0 16px;
  text-align: center;
}

.table-together {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-secondary);
}

.seat-claim {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.seat-claim input {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

.seat-claim button,
.table-resonate {
  background: var(--accent-bone);
  color: var(--bg-canvas);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.table-layout-toggle {
  background: none;
  border: none;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Full-page reading folds the table into one row of seats above the prose. */
.presence-table.folded {
  margin: 0 0 22px;
}

.presence-table.folded .table-stage {
  padding: 0;
}

.presence-table.folded .table-surface {
  display: none;
}

.presence-table.folded .table-seats {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
  margin-bottom: 14px;
}

.presence-table.folded .seat {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 62px;
}

.presence-table.folded .seat-face,
.presence-table.folded .seat.reader .seat-face {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.presence-table.folded .seat-crowd {
  position: static;
  align-self: center;
}

/* ============================================================================
   PART 8: FLOATING OBSIDIAN LIVE AUDIO STAGE DOCK
   ============================================================================ */
.live-audio-player-bar {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 18px;
  right: 18px;
  z-index: 40;
  background: var(--bg-pill);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--specular-top);
  border-radius: 24px;
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-host-info {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.player-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.player-avatar-wrap img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.84);
  box-shadow: 0 0 0 1px var(--accent-bone-line);
}

.live-ring-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live-green);
  border: 2px solid var(--bg-canvas);
}

.player-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-host-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
}

.player-line-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--accent-bone);
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.player-sub-hint {
  font-size: 11px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.player-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-icon-btn.saved {
  color: var(--accent-bone);
  border-color: var(--accent-bone);
  background: var(--accent-bone-soft);
}

.player-play-cta {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--ink-primary);
  color: var(--bg-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ============================================================================
   PART 9: THE LOUPE SHEET & INTERACTIVE MENTAL MAP CANVAS
   ============================================================================ */
.loupe-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.loupe-sheet-backdrop.open {
  pointer-events: auto;
}

.loupe-editorial-sheet {
  background: var(--bg-sheet);
  backdrop-filter: blur(44px);
  -webkit-backdrop-filter: blur(44px);
  border-top: 1px solid var(--specular-top);
  border-radius: 34px 34px 0 0;
  padding: 14px 24px calc(30px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.85);
  transform: translateY(105%);
  transition: transform 440ms var(--spring-ios);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70%;
  overflow-y: auto;
}

.loupe-sheet-backdrop.open .loupe-editorial-sheet {
  transform: translateY(0);
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--ink-muted);
  opacity: 0.4;
  margin: 0 auto;
  flex-shrink: 0;
}

.loupe-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loupe-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bone);
}

.loupe-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.loupe-close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.loupe-close-btn.saved {
  border-color: var(--accent-bone);
  color: var(--accent-bone);
  background: var(--accent-bone-soft);
}

.loupe-tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
  overflow-x: auto;
}

.loupe-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 180ms ease;
}

.loupe-tab-btn.active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
  font-weight: 600;
}

.loupe-tab-stage {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInLens 220ms ease;
}

@keyframes fadeInLens {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lens-editorial-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.lens-editorial-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15.5px;
  color: var(--accent-bone);
  padding-left: 14px;
  border-left: 1.5px solid var(--accent-bone);
  line-height: 1.52;
}

.lens-editorial-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Room Vote Poll */
.minimal-poll-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.minimal-poll-option {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-align: left;
}

.minimal-poll-option.voted {
  border-color: var(--accent-bone);
}

.minimal-poll-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-bone-soft);
  transition: width 420ms var(--spring-ios);
  z-index: 0;
}

.minimal-poll-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Voice Notes & Microphone Recording Button */
.voice-note-card {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-voice-btn {
  width: 100%;
  background: var(--bg-surface);
  border: 1px dashed var(--accent-bone-line);
  color: var(--ink-primary);
  border-radius: 14px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.record-voice-btn.recording {
  background: rgba(229, 115, 115, 0.14);
  border-color: var(--danger-rose);
  color: #ffcdd2;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger-rose);
}

.primary-cta-btn {
  width: 100%;
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ============================================================================
   PART 10: READERS LEADERBOARD, PROFILES & FROSTED REFLECTION GATE
   ============================================================================ */
.saved-quote-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-quote-text {
  font-family: var(--font-serif);
  font-size: 18.5px;
  line-height: 1.54;
  color: var(--ink-primary);
}

.saved-quote-meaning {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
  padding-left: 12px;
  border-left: 1.5px solid var(--accent-bone);
}

.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms var(--spring-ios);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  background: var(--bg-sheet);
  backdrop-filter: blur(44px);
  -webkit-backdrop-filter: blur(44px);
  border-top: 1px solid var(--specular-top);
  border-radius: 34px 34px 0 0;
  padding: 14px 24px calc(34px + env(safe-area-inset-bottom, 0px));
  max-height: 85%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 440ms var(--spring-ios);
  box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.85);
}

.sheet-overlay.open .bottom-sheet {
  transform: translateY(0);
}

.sheet-row-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-row-item:last-child {
  border-bottom: none;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.field-input, .field-textarea, .field-select {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
}

.field-textarea {
  min-height: 110px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
  resize: none;
}

/* Subtle App Toast */
.app-toast {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--ink-primary);
  color: var(--bg-canvas);
  font-size: 11.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 240ms var(--spring-ios);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loupe-plus-pill {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.loupe-plus-pill.premium {
  background: var(--accent-bone-soft);
  border-color: var(--accent-bone);
  color: var(--accent-bone);
}

.audience-roster-pill {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--accent-bone);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Interactive Reader Mental Map & Live Sketch Canvas */
.mental-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mental-map-stage {
  position: relative;
  width: 100%;
  height: 196px;
  background: var(--bg-surface);
  border: 1px solid var(--specular-top);
  border-radius: 18px;
  overflow: hidden;
  touch-action: none;
}

.mental-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.mental-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.map-tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-tool-btn.active {
  border-color: var(--accent-bone);
  color: var(--accent-bone);
  background: var(--accent-bone-soft);
}

.saved-by-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 4px;
}

.roster-section-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 10px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-speaker-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* Luxury Reader Leaderboard Card */
.reader-leaderboard-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-rank-numeral {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--accent-bone);
  width: 26px;
  flex-shrink: 0;
}

.revenue-ledger-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-bone);
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.listener-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.listener-chip {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Creator Profile & Monetized Locked Reflection Card */
.profile-hero-card {
  background: var(--card-gradient);
  border: 1px solid var(--specular-top);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 44px -10px rgba(0, 0, 0, 0.5);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.profile-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-stat-val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.profile-stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.locked-reflection-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.cliffhanger-hook-text {
  font-size: 13px;
  line-height: 1.54;
  color: var(--ink-primary);
}

.blurred-reflection-preview {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  filter: blur(5px);
  opacity: 0.65;
  user-select: none;
  pointer-events: none;
  margin-top: 2px;
}

.unlock-reflection-cta {
  width: 100%;
  background: var(--accent-bone-soft);
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  border-radius: 14px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 5-Second Luxury Sponsor Ad Card */
.sponsor-ad-card {
  background: var(--card-gradient);
  border: 1px solid var(--accent-bone-line);
  box-shadow: inset 0 1px 0 var(--specular-top);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.membership-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.membership-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-primary);
  cursor: pointer;
  text-align: left;
}

.membership-plan.active {
  border-color: var(--accent-bone);
  background: var(--accent-bone-soft);
}

.membership-plan-price {
  font-family: var(--font-serif);
  font-size: 17px;
}

.membership-plan-note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bone);
}

/* ============================================================================
   THE FULL PAGE: THE WHOLE CHAPTER, COMPLETE PARAGRAPHS, BOOK TYPOGRAPHY
   ============================================================================ */
#readerView {
  position: relative;
  background: var(--bg-canvas);
}

.reader-progress {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: var(--hairline);
  touch-action: none;
  cursor: ew-resize;
}

/* The bar is thin to look at and wide to hold: a quiet strip above and below it answers the finger. */
.reader-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 26px;
}

.reader-progress.scrubbing {
  height: 4px;
}

.reader-scrub-label {
  position: absolute;
  top: 14px;
  transform: translateX(var(--shift, -50%));
  display: none;
  max-width: min(78vw, 360px);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-pill);
  color: var(--ink-primary);
  font: 500 11.5px var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0 0 1px var(--hairline-strong), 0 10px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.reader-progress.scrubbing .reader-scrub-label {
  display: block;
}

.reader-place {
  position: absolute;
  right: var(--gutter);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-pill);
  color: var(--ink-secondary);
  font: 500 10.5px var(--font-mono);
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px var(--hairline);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
}

.reader-place.visible {
  opacity: 1;
  transform: none;
}

.reader-progress span {
  display: block;
  height: 100%;
  background: var(--accent-bone);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 120ms linear;
}

.reader-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gutter) 12px;
  background: linear-gradient(to bottom, var(--bg-canvas) 62%, transparent);
  transition: transform 320ms var(--spring-ios), opacity 240ms ease;
}

.reader-bar.tucked {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.reader-bar-title {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.reader-size-btn {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-primary);
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.reader-page {
  --reader-size: 19px;
  position: relative;
  max-width: 36em;
  margin: 0 auto;
  padding: calc(76px + env(safe-area-inset-top, 0px)) calc(var(--gutter) + 4px) calc(140px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-serif);
  font-size: var(--reader-size);
  line-height: 1.62;
  color: var(--ink-primary);
  font-feature-settings: "kern", "liga", "onum";
  hyphens: auto;
  -webkit-hyphens: auto;
  text-rendering: optimizeLegibility;
  user-select: text;
}

.reader-chapter-head {
  text-align: center;
  margin: 8px 0 34px;
}

.reader-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.reader-chapter-title {
  margin: 12px 0 10px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: calc(var(--reader-size) * 1.45);
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.reader-byline {
  font-style: italic;
  font-size: calc(var(--reader-size) * 0.72);
  color: var(--ink-secondary);
}

.reader-chapter-head::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  margin: 26px auto 0;
  background: var(--accent-bone-line);
}

.reader-paragraph {
  margin: 0 0 0.9em;
  text-indent: 1.4em;
}

.reader-first,
.reader-subtitle {
  text-indent: 0;
}

/* A chapter's subtitle in capitals reads as small capitals under the title. */
.reader-subtitle {
  margin: -14px 0 1.6em;
  text-align: center;
  font-size: 0.78em;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--ink-secondary);
  hyphens: none;
}

/* A drop capital opens the chapter, as in a printed book. */
.reader-first::first-letter {
  float: left;
  font-size: 3.1em;
  line-height: 0.86;
  padding: 0.06em 0.08em 0 0;
  color: var(--accent-bone);
}

.reader-sentence {
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 240ms ease, color 240ms ease;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.reader-sentence:active {
  background: var(--accent-bone-soft);
}

.reader-sentence.reading-active {
  background: var(--accent-bone-glow);
  box-shadow: 0 0 0 2px var(--accent-bone-glow);
}

.reader-sentence.loupe-selected {
  background: var(--accent-bone-soft);
  text-decoration: underline;
  text-decoration-color: var(--accent-bone-line);
  text-underline-offset: 0.22em;
}

.reader-chapter-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-sans);
}

.reader-chapter-end .next-chapter-btn {
  margin: 0;
}

.reader-chapter-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(var(--reader-size) * 0.8);
  color: var(--ink-secondary);
  text-align: center;
  min-height: 1em;
}

.reader-chapter-note:empty {
  display: none;
}

/* The other readers at the table: an initial in the margin at the line each of them is on. */
.margin-reader {
  position: absolute;
  left: 2px;
  width: 19px;
  height: 19px;
  margin-top: 0.3em;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  background: hsl(var(--hue, 30) 34% 36%);
  color: #f3f0e8;
  font: 600 9.5px var(--font-sans);
  box-shadow: 0 0 0 2px var(--bg-canvas), 0 4px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: top 600ms var(--spring-ios), opacity 300ms ease;
  z-index: 3;
}

.margin-reader.away {
  opacity: 0.45;
}

.margin-reader img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Where a page begins: its number in the right margin, as in a printed edition. */
.page-mark {
  position: absolute;
  right: 0;
  margin-top: 0.5em;
  font: 500 9px var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  opacity: 0.8;
  pointer-events: none;
  user-select: none;
}

body.look-framed .page-mark {
  right: 14px;
}

/* Go to a line, at the top of the chapters sheet. */
.goto-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 8px 10px;
}

.goto-line .field-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 14px;
}

/* ---- Your page: looks chosen by each reader, kept on this device. */
.look-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.look-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
}

.look-card.on {
  border-color: var(--accent-bone);
  box-shadow: 0 0 0 1px var(--accent-bone);
}

.look-name {
  font: 600 13px var(--font-sans);
  margin-top: 4px;
}

.look-note {
  font: 400 11px var(--font-sans);
  color: var(--ink-secondary);
  line-height: 1.35;
}

.look-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 58px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.look-preview i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-muted);
}

.look-preview i:nth-child(1) { width: 38%; background: var(--accent-bone); }
.look-preview i:nth-child(2) { width: 92%; }
.look-preview i:nth-child(3) { width: 84%; }
.look-preview i:nth-child(4) { width: 60%; }

.look-preview-press {
  background: #fbfbf9;
  box-shadow: inset 0 0 0 1px #d9d6ce;
}

.look-preview-press i { background: #8f8a80; }
.look-preview-press i:nth-child(1) { background: #161616; }

.look-preview-framed {
  outline: 2px double var(--accent-bone-line);
  outline-offset: -5px;
}

.look-preview-galley::before,
.look-preview-galley::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #b3313a;
}

.look-preview-galley::before { top: 6px; }
.look-preview-galley::after { bottom: 6px; }
.look-preview-galley i:nth-child(1) { background: #b3313a; }

/* Press: a white page with black type and every fifth line numbered in the margin. */
body.look-press .reader-scroll {
  background: #fbfbf9;
}

body.look-press .reader-bar {
  background: linear-gradient(to bottom, #fbfbf9 62%, transparent);
}

body.look-press .reader-page {
  color: #161616;
}

body.look-press .reader-first::first-letter,
body.look-press .reader-kicker,
body.look-press .reader-byline {
  color: #4a4740;
}

body.look-press .reader-chapter-head::after {
  background: #c9c5bb;
}

body.look-press .reader-sentence.mark5::before {
  content: attr(data-n);
  position: absolute;
  left: 4px;
  margin-top: 0.42em;
  font: 500 9.5px var(--font-mono);
  letter-spacing: 0;
  color: #a19c92;
}

body.look-press .margin-reader {
  box-shadow: 0 0 0 2px #fbfbf9, 0 4px 10px rgba(0, 0, 0, 0.18);
}

body.look-press .reader-place {
  background: #ffffff;
  color: #6b675f;
  box-shadow: 0 0 0 1px #e2dfd7;
}

/* Framed: a double rule around the page, as on a bound edition. */
body.look-framed .reader-page {
  padding-left: calc(var(--gutter) + 22px);
  padding-right: calc(var(--gutter) + 22px);
  padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px));
}

body.look-framed .reader-page::before {
  content: "";
  position: absolute;
  inset: calc(62px + env(safe-area-inset-top, 0px)) 10px 118px;
  border: 1px solid var(--accent-bone-line);
  outline: 3px double var(--accent-bone-line);
  outline-offset: 5px;
  border-radius: 2px;
  pointer-events: none;
}

body.look-framed .margin-reader {
  left: 14px;
}

/* Galley: two red rules and the title in red, as on a French cover. */
body.look-galley .reader-chapter-head {
  padding: 26px 0 24px;
  border-top: 2px solid #b3313a;
  border-bottom: 2px solid #b3313a;
  margin-bottom: 38px;
}

body.look-galley .reader-chapter-head::after {
  display: none;
}

body.look-galley .reader-chapter-title {
  color: #b3313a;
  font-style: italic;
}

body.look-galley .reader-first::first-letter {
  color: #b3313a;
}

body.look-galley .reader-chapter-end {
  border-top: 2px solid #b3313a;
}

.reader-the-end {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-secondary);
}

.reader-back-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* ============================================================================
   THE TABLE, MINIMISED: A CIRCLE THAT FOLLOWS YOU THROUGH THE APP
   ============================================================================ */
.table-bubble {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 80;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  touch-action: none;
  transition: transform 420ms var(--spring-ios);
  -webkit-tap-highlight-color: transparent;
}

.table-bubble[hidden] {
  display: none;
}

.table-bubble.dragging {
  transition: none;
}

.table-bubble-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 24px;
  box-shadow:
    0 0 0 1.5px var(--accent-bone-line),
    0 12px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 260ms var(--spring-ios);
}

.table-bubble:active .table-bubble-face,
.table-bubble.dragging .table-bubble-face {
  transform: scale(1.08);
}

/* Someone is reading aloud at the table: the ring breathes. */
.table-bubble.live .table-bubble-face {
  animation: bubbleBreath 2.4s ease-in-out infinite;
}

@keyframes bubbleBreath {
  0%, 100% { box-shadow: 0 0 0 2px var(--live-green), 0 0 0 0 rgba(52, 211, 153, 0.35), 0 12px 30px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 0 2px var(--live-green), 0 0 0 9px rgba(52, 211, 153, 0), 0 12px 30px rgba(0, 0, 0, 0.5); }
}

.table-bubble-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-bone);
  color: #141311;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-canvas);
}

.table-bubble-count[hidden] {
  display: none;
}

/* What just happened at the table, said beside the circle for a moment. */
.table-bubble-note {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translate(8px, -50%);
  max-width: 200px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 320ms var(--spring-ios);
}

.table-bubble.on-left .table-bubble-note {
  right: auto;
  left: calc(100% + 10px);
  transform: translate(-8px, -50%);
}

.table-bubble.noting .table-bubble-note {
  opacity: 1;
  transform: translate(0, -50%);
}

.table-bubble-dismiss {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 79;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.82);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-primary);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 220ms ease, transform 320ms var(--spring-ios), background-color 200ms ease;
}

.table-bubble-dismiss .icon {
  width: 18px;
  height: 18px;
}

.table-bubble-dismiss.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.table-bubble-dismiss.armed {
  background: var(--danger-rose);
  transform: scale(1.15);
}

/* Wikisource results under the library's */
.library-more:empty {
  display: none;
}

.library-source {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================================
   WHO READS, WHO WAITS: THE RAISED HAND, MUTE AND THE PAGE'S PLAY BUTTON
   ============================================================================ */
/* A raised hand stays visible on the seat until it is lowered or answered. */
.seat.hand .seat-face {
  box-shadow:
    0 0 0 3px var(--bg-canvas),
    0 0 0 5px var(--accent-bone);
}

.seat.hand .seat-face::after {
  /* The Legamus hand: drawn in thin dark lines on the bone circle, like the website's. */
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13.5V6.5a1.5 1.5 0 0 1 3 0V11'/%3E%3Cpath d='M11 10.5V4.5a1.5 1.5 0 0 1 3 0V11'/%3E%3Cpath d='M14 11V5.5a1.5 1.5 0 0 1 3 0V12'/%3E%3Cpath d='M17 12V8.5a1.5 1.5 0 0 1 3 0V14a7.5 7.5 0 0 1-7.5 7.5h-1.2a6 6 0 0 1-4.7-2.3l-3.2-4.1a1.6 1.6 0 0 1 2.4-2.1L8 15'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--accent-bone);
  box-shadow: 0 0 0 2px var(--bg-canvas);
  animation: handNudge 2.6s ease-in-out infinite;
}

@keyframes handNudge {
  0%, 82%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-14deg); }
  94% { transform: rotate(10deg); }
}

.seat.hand .seat-note,
.seat.speaking .seat-note {
  color: var(--accent-bone);
}

.seat.guest.hand {
  cursor: pointer;
}

.player-icon-btn.raised,
.voice-mute-btn.muted {
  color: var(--accent-bone);
  border-color: var(--accent-bone);
  background: var(--accent-bone-soft);
}

.voice-mute-btn .icon {
  width: 15px;
  height: 15px;
}

.reader-play-btn {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
}

/* On the narrowest phones the player keeps its four controls and the reader's name; the line count
   steps aside (the table already shows the line) and the bar uses the screen's own margins. */
@media (max-width: 374px) {
  .live-audio-player-bar {
    left: 10px;
    right: 10px;
  }
  .player-line-tag {
    display: none;
  }
  .player-controls-group {
    gap: 4px;
  }
  .player-icon-btn {
    width: 31px;
    height: 31px;
  }
  .reader-bar-title {
    display: none;
  }
}

/* ============================================================================
   LIVE VOICE: THE MICROPHONE, WHO SPEAKS, WHO IS MUTED FOR YOU
   ============================================================================ */
.voice-audio {
  display: none;
}

.mic-btn .icon {
  width: 15px;
  height: 15px;
}

/* A live microphone is unmistakable: green, like the table's live dot. */
.mic-btn.live {
  color: #0b1a12;
  background: var(--live-green);
  border-color: var(--live-green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

.seat.mic .seat-face::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--live-green) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1a12' stroke-width='2.6' stroke-linecap='round'><rect x='9' y='3' width='6' height='11' rx='3'/><path d='M18 11a6 6 0 0 1-12 0'/></svg>") center / 10px no-repeat;
  box-shadow: 0 0 0 2px var(--bg-canvas);
}

/* On the narrowest phones the bar keeps its five controls; the reader's name gives way. */
@media (max-width: 374px) {
  .player-text-col {
    display: none;
  }
}

/* ============================================================================
   YOUR ACCOUNT AND YOUR FRIENDS
   ============================================================================ */
.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.account-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.account-handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-bone);
}

.account-email {
  font-size: 12px;
  color: var(--ink-secondary);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label.field-group > span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

/* 16px keeps iPhones from zooming into the field. */
.account-form .field-input {
  font-size: 16px;
  padding: 12px 14px;
}

.code-input {
  font-family: var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 22px !important;
}

.account-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.account-consent input {
  margin-top: 3px;
  accent-color: var(--accent-bone);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.account-reason {
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: rgba(214, 197, 165, 0.08);
}

.account-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--danger-rose);
}

.account-links {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.account-links a {
  color: var(--accent-bone);
}

.friend-add {
  display: flex;
  gap: 8px;
}

.friend-add input {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--ink-primary);
  font: 16px var(--font-sans);
  outline: none;
}

.friend-add input:focus {
  border-color: var(--accent-bone-line);
}

.friend-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.friend-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
  margin-top: 1px;
}

.account-vip {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bone);
  border: 1px solid var(--accent-bone-line);
  border-radius: 999px;
  padding: 5px 11px;
}

.hand-glyph {
  width: 1.1em;
  height: 1.1em;
  margin-right: 7px;
  vertical-align: -0.2em;
}

/* ============================================================================
   ON TABLETS AND COMPUTERS: A FULL-HEIGHT READING COLUMN, NOT A PHONE IN A FRAME
   The app keeps its phone-born layout (one column, the table, the sheets), but it fills the
   window's height and grows a little wider. On wide screens the authors of every century,
   the same engravings as on the website, stand faintly on either side.
   ============================================================================ */
@media (min-width: 521px) {
  .device-stage {
    position: relative;
    isolation: isolate;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #070708;
  }
  .phone-app-shell {
    max-width: 540px;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow:
      0 0 0 1px rgba(214, 197, 165, 0.1),
      0 0 140px 40px rgba(0, 0, 0, 0.85);
  }
}

@media (min-width: 1100px) {
  .phone-app-shell { max-width: 580px; }
}

.app-backdrop {
  display: none;
}

@media (min-width: 900px) {
  .app-backdrop {
    position: absolute;
    inset: -2% -1%;
    z-index: -2;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-content: center;
    opacity: 0.2;
    pointer-events: none;
  }
  .app-backdrop img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
  }
  /* Darker toward the column, so the eye rests on the table. */
  .device-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse 46% 120% at 50% 50%, rgba(7, 7, 8, 0.96) 40%, rgba(7, 7, 8, 0.55) 72%, rgba(7, 7, 8, 0.2) 100%);
  }
}

/* ============================================================================
   KEEP LEGAMUS ON YOUR PHONE: THE HOME-SCREEN GUIDE
   ============================================================================ */
.install-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 20px;
}

.install-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--accent-bone-line), 0 12px 28px rgba(0, 0, 0, 0.5);
}

.install-title {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink-primary);
}

.install-sub {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.install-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 6px;
  padding: 0;
}

.install-steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 54px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--bg-surface);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  font-family: var(--font-serif);
  font-size: 14px;
}

.install-steps b,
.install-or b {
  color: var(--ink-primary);
  font-weight: 500;
}

/* The button to look for, drawn small, in the bone colour. */
.install-key {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 2px;
  vertical-align: -8px;
  border-radius: 8px;
  border: 1px solid var(--accent-bone-line);
  color: var(--accent-bone);
  background: rgba(216, 199, 168, 0.06);
}

.install-key svg {
  width: 16px;
  height: 16px;
}

.install-now {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.install-now svg {
  width: 20px;
  height: 20px;
}

.install-or {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* The frame of the app never scrolls itself: only its inner feeds do. "clip" (unlike "hidden")
   cannot be moved by the browser when it brings a field or a row into view, so the header and the
   bottom bar always stay where they belong, on phones and computers alike. */
.device-stage,
.phone-app-shell,
.app-inner-viewport {
  overflow: hidden;
  overflow: clip;
}

/* ============================================================================
   WARM PAPER ON WIDE SCREENS: the column rests on a deeper paper, the authors in ink around it,
   and the cards cast soft warm shadows instead of night-black ones.
   ============================================================================ */
@media (min-width: 521px) {
  body.theme-parchment .device-stage { background: #e6dfd0; }
  body.theme-parchment .phone-app-shell {
    box-shadow:
      0 0 0 1px rgba(28, 24, 20, 0.08),
      0 0 120px 30px rgba(80, 60, 30, 0.18);
  }
}

@media (min-width: 900px) {
  body.theme-parchment .app-backdrop { opacity: 0.5; }
  body.theme-parchment .device-stage::before {
    background: radial-gradient(ellipse 46% 120% at 50% 50%, rgba(230, 223, 208, 0.97) 40%, rgba(230, 223, 208, 0.55) 72%, rgba(230, 223, 208, 0.15) 100%);
  }
}

body.theme-parchment .hero-room-card {
  box-shadow:
    inset 0 1px 0 var(--specular-top),
    0 18px 40px -18px rgba(80, 60, 30, 0.22);
}

/* Covers: long words fit whole; on Warm Paper the black books cast soft warm shadows. */
.fine-press-cover.long-word .cover-title-text { font-size: 12px; letter-spacing: -0.02em; }
.fine-press-cover.small.long-word .cover-title-text { font-size: 8.2px; letter-spacing: -0.03em; }
body.theme-parchment .fine-press-cover {
  box-shadow:
    inset 8px 0 14px rgba(0, 0, 0, 0.65),
    inset 3px 0 0 rgba(255, 255, 255, 0.14),
    4px 0 0 -1px #d9d2c5,
    5px 0 0 -1px rgba(0, 0, 0, 0.25),
    0 14px 24px -10px rgba(70, 50, 25, 0.45);
}
body.theme-parchment .fine-press-cover.small {
  box-shadow:
    inset 6px 0 10px rgba(0, 0, 0, 0.6),
    inset 2px 0 0 rgba(255, 255, 255, 0.12),
    3px 0 0 -1px #d9d2c5,
    0 10px 18px -8px rgba(70, 50, 25, 0.45);
}

/* On paper the bottom bar is nearly opaque: black books passing beneath no longer haze it. */
body.theme-parchment .bottom-tab-bar { background: rgba(246, 243, 236, 0.97); }

/* The loupe sheet, closed, waits below the screen: hidden entirely, so its shadow cannot rise
   over the bottom bar (visible on Warm Paper). It slides in and out exactly as before. */
.loupe-editorial-sheet {
  visibility: hidden;
  transition: transform 440ms var(--spring-ios), visibility 0s linear 440ms;
}
.loupe-sheet-backdrop.open .loupe-editorial-sheet {
  visibility: visible;
  transition: transform 440ms var(--spring-ios), visibility 0s linear 0s;
}
body.theme-parchment .loupe-editorial-sheet { box-shadow: 0 -24px 70px rgba(70, 50, 25, 0.28); }

/* ============================================================================
   FULL SCREEN ON TABLETS AND COMPUTERS (replaces the centred column)
   The app fills the window: header, lists and bottom bar run edge to edge, the scroll lives at
   the window's edge, and the content keeps a comfortable reading width in the middle. On wide
   screens the book lists open into two columns, so cards never stretch into long thin lines.
   ============================================================================ */
@media (min-width: 521px) {
  .device-stage,
  body.theme-parchment .device-stage { background: var(--bg-canvas); }
  .device-stage::before,
  body.theme-parchment .device-stage::before { display: none; }
  .phone-app-shell,
  body.theme-parchment .phone-app-shell {
    max-width: none;
    box-shadow: none;
  }

  #lobbyView, #notebookView { --page: max(var(--gutter), calc((100% - 1180px) / 2)); }
  #searchView { --page: max(var(--gutter), calc((100% - 860px) / 2)); }
  #profileView { --page: max(var(--gutter), calc((100% - 760px) / 2)); }
  #roomView { --page: max(var(--gutter), calc((100% - 820px) / 2)); }
  #readerView { --page: max(var(--gutter), calc((100% - 900px) / 2)); }

  .screen-view .lobby-header,
  .screen-view .search-bar-container,
  .screen-view .category-pills-row,
  .screen-view .lobby-scroll-feed,
  #roomView .minimal-header,
  #roomView .book-scroll-viewport,
  #readerView .reader-bar {
    padding-left: var(--page);
    padding-right: var(--page);
  }

  /* The four tabs stay together in the middle, not scattered across a wide screen. */
  .bottom-tab-bar {
    padding-left: max(6px, calc((100% - 620px) / 2));
    padding-right: max(6px, calc((100% - 620px) / 2));
  }

  /* Sheets rise in the middle at a readable width. */
  .bottom-sheet {
    width: min(100%, 680px);
    margin-left: auto;
    margin-right: auto;
  }
  .loupe-editorial-sheet {
    width: min(100%, 720px);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1100px) {
  #lobbyRoomsContainer,
  #savedNotebookContainer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    align-items: start;
    column-gap: 24px;
  }
  #lobbyRoomsContainer > .section-label-row,
  #lobbyRoomsContainer > .library-invite,
  #lobbyRoomsContainer > .lens-editorial-body,
  #lobbyRoomsContainer > .hero-room-card,
  #savedNotebookContainer > .section-label-row,
  #savedNotebookContainer > .lens-editorial-body {
    grid-column: 1 / -1;
  }
}

/* Installed on an iPhone: the app runs under the status bar. On Warm Paper, a soft shade behind
   the clock keeps the white time and battery readable; at night none is needed. */
html.ios-standalone body.theme-parchment .phone-app-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 10px);
  background: linear-gradient(to bottom, rgba(28, 24, 20, 0.5), rgba(28, 24, 20, 0));
  z-index: 200;
  pointer-events: none;
}

/* At a table on a wide screen, the player bar keeps the table's width, centred. */
@media (min-width: 521px) {
  #roomView .live-audio-player-bar {
    left: max(12px, calc((100% - 820px) / 2));
    right: max(12px, calc((100% - 820px) / 2));
  }
}

/* ============================================================================
   READERS MEET BEYOND THE TABLE: faces, numbers, shared lines, answers
   ============================================================================ */
.initials-face { display: grid; place-items: center; }
.initials-face span { font-family: var(--font-serif); color: #f3efe6; line-height: 1; }
.portrait-xs.initials-face span { font-size: 10px; }
.portrait-sm.initials-face span { font-size: 13px; }
.portrait-md.initials-face span { font-size: 16px; }
.portrait-lg.initials-face span { font-size: 19px; }
.portrait-xl.initials-face span { font-size: 26px; }

.avatar-edit { display: grid; place-items: center; cursor: pointer; }
.avatar-initials { font-family: var(--font-serif); font-size: 26px; color: #f3efe6; }
.avatar-edit img { position: absolute; inset: 0; }
.avatar-edit-badge {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 3px 0 4px; text-align: center;
  font: 600 9px var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase;
  color: #f3efe6; background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
}
.profile-name { font-family: var(--font-serif); font-size: 23px; color: var(--ink-primary); line-height: 1.12; }
.profile-sub { font-size: 12px; color: var(--ink-secondary); margin-top: 3px; }
.profile-bio { font-family: var(--font-serif); font-size: 15px; line-height: 1.5; color: var(--ink-primary); cursor: text; }
.profile-bio-empty { color: var(--ink-muted); font-style: italic; }
.link-btn { background: none; border: 0; padding: 0; font: 500 12px var(--font-sans); color: var(--accent-bone); cursor: pointer; text-align: left; width: fit-content; }
.link-btn:hover { text-decoration: underline; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.stat-row + .stat-row { border-top: 0; padding-top: 0; }
.stat-cell { background: none; border: 0; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-primary); cursor: default; min-width: 0; }
.stat-cell.tactile { cursor: pointer; }
.stat-cell b { font: 400 21px var(--font-serif); line-height: 1.1; }
.stat-cell span { font-size: 10px; color: var(--ink-secondary); text-align: center; line-height: 1.25; }

.join-room-btn.is-on { background: transparent; color: var(--ink-primary); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.loupe-close-btn.danger { color: var(--danger-rose); }
.loupe-close-btn[disabled] { opacity: 0.6; pointer-events: none; }
.reader-menu { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--hairline-strong); border-radius: 16px; background: var(--bg-surface); }

/* A shared line */
.fragment-card {
  background: var(--card-gradient);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  padding: 18px 18px 12px;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 10px;
}
.fragment-by { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fragment-by b { display: block; font-size: 13px; font-weight: 500; color: var(--ink-primary); }
.fragment-by span { display: block; font-size: 11px; color: var(--ink-secondary); }
.fragment-text { font-family: var(--font-serif); font-size: 18px; line-height: 1.5; color: var(--ink-primary); margin: 0; }
.fragment-source { font: 500 10px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-bone); }
.fragment-thought { font-size: 13.5px; line-height: 1.55; color: var(--ink-secondary); padding-left: 12px; border-left: 1.5px solid var(--accent-bone); white-space: pre-line; }
.fragment-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px -8px 0; }
.fragment-act { background: none; border: 0; border-radius: 999px; padding: 7px 10px; font: 500 12px var(--font-sans); color: var(--ink-secondary); cursor: pointer; }
.fragment-act:hover { background: var(--accent-bone-soft); color: var(--ink-primary); }
.fragment-act.on { color: var(--accent-bone); }
.fragment-act span:empty { display: none; }

.answer-list { display: flex; flex-direction: column; gap: 14px; margin: 4px 0 14px; }
.answer { display: flex; gap: 10px; align-items: flex-start; }
.answer-body { min-width: 0; flex: 1; }
.answer-head { display: flex; gap: 8px; align-items: baseline; }
.answer-head b { font-size: 13px; font-weight: 500; color: var(--ink-primary); cursor: pointer; }
.answer-head span { font-size: 11px; color: var(--ink-muted); }
.answer-body p { font-size: 14px; line-height: 1.5; color: var(--ink-primary); margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.answer-tools { display: flex; gap: 14px; margin-top: 4px; }
.answer-tools .link-btn { font-size: 11px; color: var(--ink-muted); }
.answer-form { display: flex; gap: 8px; align-items: flex-end; }
.answer-form textarea,
.line-thought {
  flex: 1; width: 100%; resize: vertical; min-height: 44px;
  background: var(--bg-surface); color: var(--ink-primary);
  border: 1px solid var(--hairline-strong); border-radius: 14px;
  padding: 10px 12px; font: 16px/1.45 var(--font-serif);
}
.line-thought { font-size: 15px; }
.answer-form textarea:focus, .line-thought:focus { outline: none; border-color: var(--accent-bone-line); }
.report-form { display: flex; flex-direction: column; gap: 14px; }
.report-form .field-input { font-size: 16px; padding: 12px 14px; }

/* Readers to follow: a row of faces to slide through */
.reader-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.reader-strip::-webkit-scrollbar { display: none; }
.reader-strip-card {
  flex: 0 0 142px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 16px 10px 12px; border-radius: 20px;
  background: var(--card-gradient); border: 1px solid var(--hairline);
}
.reader-strip-card b { font-size: 13px; font-weight: 500; color: var(--ink-primary); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-strip-card span { font-size: 11px; line-height: 1.35; color: var(--ink-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }

/* The notebook: private or shared, and your thought */
.notebook-intro { font-size: 12.5px; margin-bottom: 10px; }
.line-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--hairline-strong); border-radius: 999px;
  padding: 6px 12px 6px 6px; font: 500 11.5px var(--font-sans); color: var(--ink-secondary); cursor: pointer;
}
.share-toggle i { width: 26px; height: 16px; border-radius: 999px; background: var(--hairline-strong); position: relative; transition: background 200ms ease; }
.share-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-secondary); transition: transform 200ms var(--spring-ios), background 200ms ease; }
.share-toggle.on { color: var(--accent-bone); border-color: var(--accent-bone-line); }
.share-toggle.on i { background: var(--accent-bone-glow); }
.share-toggle.on i::after { transform: translateX(10px); background: var(--accent-bone); }
.listener-chip.tactile { cursor: pointer; }

/* On wide screens the feed's own pieces join the two-column grid. */
#socialFeedSlot, #searchSocialResults { display: contents; }
@media (min-width: 1100px) {
  #lobbyRoomsContainer > #socialFeedSlot > .section-label-row,
  #lobbyRoomsContainer > #socialFeedSlot > .reader-strip,
  #lobbyRoomsContainer > #socialFeedSlot > .library-invite,
  #savedNotebookContainer > .notebook-intro { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .stat-cell b { font-size: 18px; }
  .stat-cell span { font-size: 9px; }
}


/* ============================================================================
   Real covers, tonight's table, tables with a time, author pages (6 November 2026)
   ============================================================================ */
.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 320ms ease;
  border-radius: inherit;
}
.fine-press-cover.real .cover-photo { opacity: 1; }
.fine-press-cover.real .cover-foil-frame,
.fine-press-cover.real .cover-numeral,
.fine-press-cover.real .cover-title-text,
.fine-press-cover.real .cover-author-text { opacity: 0; }
.fine-press-cover.real::after {
  /* The spine's shadow keeps the photo a book, not a flat picture. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 8px 0 14px rgba(0, 0, 0, 0.55), inset 3px 0 0 rgba(255, 255, 255, 0.12);
}
.fine-press-cover.small.real::after { box-shadow: inset 6px 0 10px rgba(0, 0, 0, 0.5), inset 2px 0 0 rgba(255, 255, 255, 0.1); }

.author-link { border-bottom: 1px dotted var(--hairline-strong); }
.author-link:hover { color: var(--ink-primary); border-bottom-color: var(--accent-bone); }
.author-source { font-size: 11px; color: var(--accent-bone); text-decoration: none; margin-left: 4px; white-space: nowrap; }
.author-source:hover { text-decoration: underline; }
.join-room-btn.is-on { background: var(--accent-bone-soft); color: var(--accent-bone); border: 1px solid var(--accent-bone-line, rgba(214, 197, 165, 0.35)); }

.tonight-card {
  background: linear-gradient(160deg, rgba(214, 197, 165, 0.16), rgba(214, 197, 165, 0.03) 60%), var(--card-gradient);
  border: 1px solid rgba(214, 197, 165, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
  border-radius: 22px;
  padding: 16px 18px 14px;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tonight-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bone);
}
.tonight-title {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.15;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}
.tonight-sub { font-size: 12.5px; color: var(--ink-secondary); }
.tonight-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-primary);
  opacity: 0.9;
  margin-top: 4px;
}
.tonight-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.tonight-people { display: flex; align-items: center; gap: 0; font-size: 12px; color: var(--ink-secondary); min-width: 0; }
.tonight-people .portrait-frame { margin-right: -7px; border: 2px solid var(--bg-surface); }
.tonight-people span { margin-left: 13px; white-space: nowrap; }
.table-when {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bone);
  margin-bottom: 2px;
}
.profile-hero-card .tonight-title { font-size: 24px; }
.profile-hero-card .account-actions a.loupe-close-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* A question to the reader: the house sheet in place of the browser's grey boxes */
.ask-overlay { z-index: 120; }
.ask-sheet { gap: 10px; }
.ask-title {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin-top: 2px;
}
.ask-text { font-size: 13px; line-height: 1.5; color: var(--ink-secondary); }
.ask-field { width: 100%; box-sizing: border-box; font-size: 15px; padding: 12px 14px; margin-top: 2px; }
.ask-field.field-textarea { min-height: 92px; font-family: var(--font-serif); line-height: 1.45; }
.ask-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ask-actions .join-room-btn { width: 100%; }
.ask-actions .loupe-close-btn { align-self: center; }
.join-room-btn.danger { background: var(--danger-rose); color: #fff; }
.join-room-btn:disabled { opacity: 0.45; cursor: default; }
.ask-field-wrap { position: relative; }
.ask-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin-top: 1px; font-size: 15px; color: var(--ink-muted); pointer-events: none; }
.ask-field.with-prefix { padding-left: 30px; }
.ask-hint { min-height: 16px; font-size: 12px; line-height: 1.35; color: var(--ink-muted); }
.ask-hint.good { color: var(--accent-bone); }
.ask-hint.bad { color: var(--danger-rose); }
.account-error.notice { color: var(--accent-bone); }

/* The shelves of the library: language, family, shelf */
.library-langs { margin-bottom: 2px; }
.library-families .category-pill, .library-shelves .category-pill { font-size: 11px; padding: 5px 10px; }
.library-shelves { margin-top: -2px; }

/* The reader's other pages: monogram seats in the house ink, one family with the faces */
.net-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.net-seat {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-bone); color: #15130f; text-decoration: none;
  font-family: var(--font-serif); font-size: 12.5px; letter-spacing: -0.01em; line-height: 1;
  box-shadow: 0 0 0 1px var(--accent-bone-line), 0 6px 14px rgba(0, 0, 0, 0.35);
}
.net-seat svg { width: 15px; height: 15px; display: block; fill: currentColor; }
.net-seat.site { font-size: 17px; padding-bottom: 1px; }
a.net-seat:hover { filter: brightness(1.06); }
.link-row-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; padding: 9px 10px; border-radius: 999px; border: 1px solid var(--hairline-strong);
  background: transparent; color: var(--ink-secondary); font: 500 12.5px var(--font-sans); cursor: pointer;
}
.seg-btn.on { background: var(--accent-bone); color: #15130f; border-color: var(--accent-bone); }
.links-form { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.links-row { display: flex; align-items: center; gap: 10px; }
.links-row .links-label { width: 72px; flex: none; font-size: 12.5px; color: var(--ink-secondary); }
.links-row .field-input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px; }

/* Placing your photo */
.crop-stage { display: grid; place-items: center; padding: 4px 0; }
#cropCanvas {
  width: min(280px, 72vw); height: auto; aspect-ratio: 1; display: block;
  border-radius: 20px; background: #000; touch-action: none; cursor: grab;
  box-shadow: 0 0 0 1px var(--accent-bone-line), 0 14px 32px rgba(0, 0, 0, 0.55);
}
#cropCanvas:active { cursor: grabbing; }
.crop-zoom-row { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-secondary); }
.crop-zoom { flex: 1; accent-color: var(--accent-bone); }
