/* ============================================
   COMPONENTS — Phase 2 public pages
   ============================================ */

/* ---- Section ---- */
.section {
  padding: var(--s-6) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

/* ---- Book Cover ---- */
.book-cover {
  aspect-ratio: 2 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover--sm { width: 120px; }
.book-cover--md { width: 160px; }
.book-cover--lg { width: 220px; }

/* ---- Book-to-Book Nav ---- */
.book-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  margin-bottom: var(--s-1);
}

.book-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text2);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-sm);
  transition: background 150ms ease, color 150ms ease;
}

.book-nav__link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.book-nav__link--next {
  margin-left: auto;
  text-align: right;
}

.book-nav__text {
  display: flex;
  flex-direction: column;
}

.book-nav__label {
  font-size: var(--t-xs);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-nav__title {
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

@media (max-width: 480px) {
  .book-nav__title { max-width: 120px; }
}

/* ---- Book Hero Wrap (immersive cover background) ---- */
.book-hero-wrap {
  position: relative;
  overflow: hidden;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.book-hero-wrap .book-description,
.book-hero-wrap .book-tag,
.book-hero-wrap .text-secondary {
  color: inherit;
}

/* Blurred cover wash layer */
.book-hero-wrap::before {
  content: '';
  position: absolute;
  inset: -80px;
  background-image: var(--cover-url);
  background-size: cover;
  background-position: center 30%;
  filter: blur(60px) saturate(1.4);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

/* Bottom gradient fade — dissolve wash into page bg */
.book-hero-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

/* ---- Book Hero (two-column editorial layout) ---- */
.book-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  padding: var(--s-6) 0 var(--s-5);
  align-items: start;
}

/* Cover column */
.book-hero__cover-col {
  position: sticky;
  top: var(--s-4);
}

.book-hero .book-cover--lg {
  width: 260px;
  border: none;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.15),
    0 12px 40px rgba(0,0,0,0.25),
    0 30px 80px rgba(0,0,0,0.30);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-hero .book-cover--lg:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.15),
    0 20px 50px rgba(0,0,0,0.28),
    0 40px 100px rgba(0,0,0,0.35);
}

/* CTA buttons below cover */
.book-hero__cta {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
  width: 100%;
}

.book-hero__cta-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Body column */
.book-hero__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: flex-start;
  padding: var(--s-1) 0;
  min-width: 0;
}

.book-hero__primary {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

/* Month/year date label */
.book-hero__date {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-1);
}

.book-hero__title {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.book-hero__author {
  font-family: var(--font-reading);
  font-style: italic;
  font-size: var(--t-lg);
  color: inherit;
  margin: 2px 0 0;
}

/* Grade row */
.book-hero__grade {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) 0 var(--s-1);
}

/* Hero footer: metadata + action pills */
.book-hero__footer {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}

/* Inline metadata row (pages · year · isbn) */
.book-meta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: inherit;
}

.book-meta-inline__item {
  white-space: nowrap;
}

.book-meta-inline__item + .book-meta-inline__item::before {
  content: '\00b7';
  padding: 0 8px;
  color: var(--border);
  font-weight: 700;
}

/* Action link row */
.book-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  margin-top: var(--s-3);
}

/* Text-style action links */
.book-links__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  line-height: 1;
}

.book-links__pill svg {
  flex-shrink: 0;
}

.book-links__pill:hover {
  text-decoration: underline;
}

/* Home hero compatibility — keep existing patterns working */
.book-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.book-hero__meta--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

/* Meeting info — time & location */
.book-hero__meeting-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-2);
}
.meeting-info__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text2);
}
.meeting-info__item svg {
  opacity: 0.5;
  flex-shrink: 0;
}

/* ---- Dark mode hero adjustments ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .book-hero-wrap::before {
    opacity: 0.10;
    filter: blur(60px) saturate(1.0);
  }
  :root:not([data-theme="light"]) .book-hero-wrap::after {
    height: 50%;
  }
}
[data-theme="dark"] .book-hero-wrap::before {
  opacity: 0.10;
  filter: blur(60px) saturate(1.0);
}
[data-theme="dark"] .book-hero-wrap::after {
  height: 50%;
}

/* ---- Mobile hero layout ---- */
@media (max-width: 640px) {
  .book-hero-wrap {
    padding-bottom: var(--s-1);
  }

  .book-hero {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    padding: var(--s-5) 0 var(--s-4);
  }

  .book-hero__cover-col {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .book-hero__cta {
    width: 260px;
  }

  .book-hero .book-cover--lg {
    width: 260px;
    box-shadow:
      0 2px 8px rgba(0,0,0,0.15),
      0 12px 40px rgba(0,0,0,0.25),
      0 30px 80px rgba(0,0,0,0.30);
  }

  .book-hero__body {
    padding: 0;
    text-align: center;
  }

  .book-hero__primary {
    align-items: center;
  }

  .book-hero__tags {
    justify-content: center;
  }

  .book-hero__grade {
    justify-content: center;
  }

  .book-hero__footer {
    align-items: center;
  }

  .book-meta-inline {
    justify-content: center;
  }

  .book-hero__actions {
    justify-content: center;
  }

  .book-description {
    text-align: left;
  }
}

/* ---- Home Hero ---- */
.home-hero {
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: var(--s-6) calc(50vw - 50%) var(--s-5);
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, hsla(var(--hero-hue), 55%, 65%, 0.12), transparent),
    radial-gradient(ellipse 60% 50% at 80% 30%, hsla(var(--hero-hue), 45%, 70%, 0.08), transparent);
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.home-hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  align-items: start;
  max-width: var(--content-width, 960px);
  margin: 0 auto;
}

.home-hero__cover {
  width: 220px;
  border: none;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.12),
    0 12px 36px rgba(0,0,0,0.20),
    0 28px 70px rgba(0,0,0,0.25);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-hero__cover:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.12),
    0 18px 44px rgba(0,0,0,0.24),
    0 36px 90px rgba(0,0,0,0.30);
}

.home-hero__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-top: var(--s-2);
}

.home-hero__label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.home-hero__title {
  margin-top: var(--s-1);
}

.home-hero__author {
  margin-bottom: var(--s-1);
}

.home-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-1);
}

.home-hero__description {
  max-width: 520px;
  margin-bottom: var(--s-1);
}

.home-hero__actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-1);
}

.home-hero__meeting {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: fit-content;
}

/* Home hero dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-hero {
    background:
      radial-gradient(ellipse 80% 60% at 20% 80%, hsla(var(--hero-hue), 40%, 45%, 0.10), transparent),
      radial-gradient(ellipse 60% 50% at 80% 30%, hsla(var(--hero-hue), 35%, 50%, 0.06), transparent);
  }
}
[data-theme="dark"] .home-hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, hsla(var(--hero-hue), 40%, 45%, 0.10), transparent),
    radial-gradient(ellipse 60% 50% at 80% 30%, hsla(var(--hero-hue), 35%, 50%, 0.06), transparent);
}

/* Home hero mobile */
@media (max-width: 640px) {
  .home-hero {
    padding: var(--s-5) calc(50vw - 50%) var(--s-4);
  }

  .home-hero__layout {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    justify-items: center;
  }

  .home-hero__cover {
    width: 200px;
  }

  .home-hero__body {
    text-align: center;
    align-items: center;
    padding-top: 0;
  }

  .home-hero__label {
    justify-content: center;
  }

  .home-hero__tags {
    justify-content: center;
  }

  .home-hero__description {
    text-align: left;
  }

  .home-hero__actions {
    justify-content: center;
  }

  .home-hero__meeting {
    width: auto;
    justify-content: center;
  }
}

/* ---- Book Card ---- */
.book-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: opacity 180ms ease;
}

.book-card:hover {
  opacity: 0.8;
  text-decoration: none;
}

.book-card__cover {
  aspect-ratio: 2 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--s-2);
}

.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__title {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: var(--t-lg);
  line-height: 1.35;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__author {
  font-family: var(--font-reading);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--text2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__footer {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-1);
}

/* Strip variant: fixed width for horizontal scroll */
.book-card--strip {
  width: 140px;
  flex-shrink: 0;
}

/* Grid variant: fills its column */
.book-card--grid {
  width: 100%;
}

/* ---- Banner ---- */
.banner {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-radius: var(--radius-md);
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.banner__text {
  flex: 1;
  min-width: 0;
}

.banner .btn-primary {
  background: var(--bg);
  color: var(--text);
}

.banner .btn-primary:hover {
  opacity: 0.9;
}

@media (max-width: 480px) {
  .banner {
    flex-direction: column;
    text-align: center;
    padding: var(--s-4);
  }
}

/* ---- Metadata List ---- */
.metadata-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-2) var(--s-3);
  align-items: baseline;
}

.metadata-list dt {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

.metadata-list dd {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text);
}

.metadata-list dd a {
  color: var(--accent);
}
.metadata-list dd .btn {
  text-decoration: none;
}

/* ---- Login Prompt Link ---- */
.login-prompt-link {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.login-prompt-link:hover {
  text-decoration: underline;
}

/* (Book metadata + links styles moved into Book Hero section above) */

/* ---- Status Pill ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

.status-pill--reading {
  background: #E0F2F1;
  color: var(--accent2);
}

.status-pill--nominations,
.status-pill--voting {
  background: #FFF8E1;
  color: #92400e;
}

.status-pill--results {
  background: var(--surface);
  color: var(--text2);
}

.status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- Grade Badge (see enhanced version at end of file) ---- */

/* ---- Grade Distribution (gradient strip) ---- */
.grade-dist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--s-4) var(--s-4) var(--s-3);
}
.grade-dist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}
.grade-dist__title {
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 600;
  color: var(--text);
}
.grade-dist__right {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.grade-dist__avg-badge {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}
.grade-dist__avg-badge--f { background: rgba(239,68,68,0.12);  color: #DC2626; }
.grade-dist__avg-badge--d { background: rgba(249,115,22,0.12); color: #C2410C; }
.grade-dist__avg-badge--c { background: rgba(120,113,108,0.12); color: #57534E; }
.grade-dist__avg-badge--b { background: rgba(59,130,246,0.12); color: #1D4ED8; }
.grade-dist__avg-badge--a { background: rgba(34,197,94,0.12);  color: #15803D; }
.grade-dist__avg-badge--s { background: rgba(245,158,11,0.12); color: #B45309; }
.grade-dist__count {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
}

/* Strip (the gradient bar) */
.grade-dist__strip-wrap {
  position: relative;
  margin-bottom: 8px;
}
.grade-dist__strip {
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.07),
    inset 0 -1px 3px rgba(255,255,255,0.6),
    0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  animation: grade-dist-develop 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Grain overlay — tactile print feel */
.grade-dist__strip::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
  pointer-events: none;
  border-radius: var(--radius-sm);
}

/* Average-grade tick mark */
.grade-dist__tick {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
  pointer-events: none;
}
.grade-dist__tick::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.15);
}

/* Axis labels */
.grade-dist__axis {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}
.grade-dist__axis span {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
}
.grade-dist__axis span.active {
  color: var(--text2);
  opacity: 1;
  position: relative;
  cursor: default;
}
.grade-dist__axis span.active[data-count]::after {
  content: attr(data-count);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--text1);
  color: var(--bg);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.grade-dist__axis span.active[data-count]:hover::after,
.grade-dist__axis span.active[data-count].is-tapped::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Develop animation — Polaroid desaturate → saturate */
@keyframes grade-dist-develop {
  0%   { filter: saturate(0) brightness(1.08); opacity: 0.5; }
  40%  { filter: saturate(0.3) brightness(1.04); opacity: 0.8; }
  100% { filter: saturate(1) brightness(1); opacity: 1; }
}

/* Dark mode adjustments */
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist {
  background: var(--surface);
  border-color: var(--border);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__strip {
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.25),
    inset 0 -1px 3px rgba(255,255,255,0.05),
    0 1px 3px rgba(0,0,0,0.15);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__strip::after {
  mix-blend-mode: overlay;
  opacity: 0.6;
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--f { background: rgba(239,68,68,0.18);  color: #f87171; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--d { background: rgba(249,115,22,0.18); color: #fb923c; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--c { background: rgba(168,162,158,0.15); color: #a8a29e; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--b { background: rgba(59,130,246,0.18); color: #60a5fa; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--a { background: rgba(34,197,94,0.18);  color: #4ade80; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-dist__avg-badge--s { background: rgba(245,158,11,0.22); color: #fbbf24; }

/* ---- Review Card ---- */
.review-card {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--border);
}

.review-card:first-child {
  border-top: none;
}

.review-card__body {
  flex: 1;
  min-width: 0;
}

.review-card__text {
  font-family: var(--font-reading);
  font-size: var(--t-base);
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--s-1);
}

/* Markdown content inside review text */
.review-card__text p {
  margin: 0 0 0.5em;
}
.review-card__text p:last-child {
  margin-bottom: 0;
}
.review-card__text strong,
.review-card__text b {
  font-weight: 600;
}
.review-card__text em,
.review-card__text i {
  font-style: italic;
}
.review-card__text ul,
.review-card__text ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.review-card__text blockquote {
  border-left: 3px solid var(--border);
  padding-left: var(--s-3);
  margin: 0.5em 0;
  color: var(--text2);
  font-style: italic;
}
.review-card__text code {
  font-family: monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.review-card__text pre {
  background: var(--surface);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.5em 0;
}
.review-card__text pre code {
  background: none;
  padding: 0;
}

.review-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.review-card__date {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
}

.review-card__edited {
  font-style: italic;
  opacity: 0.7;
}

.review-card__delete {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: var(--s-1);
  transition: color 120ms ease;
}
.review-card__delete:hover {
  color: var(--danger, #c0392b);
}

/* ---- Review Card: Grade + Spoiler Column ---- */
.review-card__grade-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.spoiler-badge {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b45309;
  white-space: nowrap;
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler-badge {
  color: #fbbf24;
}

.dnf-badge {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .dnf-badge {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* ---- Spoiler Filter ---- */
.spoiler-filter {
  display: flex;
  align-items: center;
  padding: var(--s-2) 0;
  margin-bottom: var(--s-1);
}
.spoiler-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 12px 4px 8px;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 120ms ease;
  white-space: nowrap;
}
.spoiler-toggle:hover {
  background: var(--surface);
  color: var(--text2);
}
.spoiler-toggle:active {
  transform: scale(0.97);
}
.spoiler-toggle[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text3);
}
.spoiler-toggle__icon { flex-shrink: 0; }
.spoiler-toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.spoiler-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-lg);
  background: var(--surface2);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text2);
  transition: background 200ms ease, color 200ms ease;
}
.spoiler-toggle[aria-pressed="true"] .spoiler-toggle__count {
  background: var(--accent);
  color: #fff;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler-toggle {
  border-color: var(--border);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler-toggle:hover {
  background: var(--surface);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler-toggle[aria-pressed="true"] {
  background: var(--surface2);
  border-color: var(--text3);
}

/* Animated spoiler card reveal/hide */
.review-card[data-spoiler="true"] {
  transition: opacity 250ms ease, max-height 300ms ease, margin 250ms ease;
  overflow: hidden;
}
.review-list:not(.show-spoilers) .review-card[data-spoiler="true"] {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: none;
}
.review-list.show-spoilers .review-card[data-spoiler="true"] {
  opacity: 1;
  max-height: 2000px;
}

/* ---- Spoiler Toggle (review form) ---- */
.spoiler-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-top: var(--s-3);
  margin-bottom: var(--s-3);
  user-select: none;
}

/* Visually hide the native checkbox */
.spoiler-checkbox input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spoiler-checkbox__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 52px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--text2);
  min-height: 24px;
}

/* Toggle track */
.spoiler-checkbox__label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 200ms ease, border-color 200ms ease;
}

/* Toggle thumb */
.spoiler-checkbox__label::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: left 200ms ease;
}

/* Checked state — slide thumb right, accent track */
.spoiler-checkbox input:checked + .spoiler-checkbox__label::before {
  background: var(--accent);
  border-color: var(--accent);
}
.spoiler-checkbox input:checked + .spoiler-checkbox__label::after {
  left: 21px;
}

/* Focus ring for keyboard accessibility */
.spoiler-checkbox input:focus-visible + .spoiler-checkbox__label::before {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- "Did you finish?" checkbox (review form) ---- */
.finish-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: var(--s-3);
  user-select: none;
}
.finish-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.finish-checkbox__label {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--text2);
}

/* ---- Reviews Header ---- */
.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}
.reviews-header .t-section {
  margin-bottom: 0;
}
.reviews-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* ---- Review List ---- */
.review-list {
  display: flex;
  flex-direction: column;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: var(--s-6) 0;
}

.empty-state__message {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text3);
  margin-bottom: var(--s-3);
}

.empty-state__cta {
  margin-top: var(--s-2);
}

/* ---- History Header & Controls ---- */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}
.history-header .t-section {
  margin-bottom: 0;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.history-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.history-btn[hidden] {
  display: none;
}

/* Sort dropdown */
.sort-dropdown {
  position: relative;
}
.sort-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 20;
}
.sort-dropdown.is-open .sort-dropdown__menu {
  display: block;
}
.sort-dropdown__item {
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text2);
  cursor: pointer;
  transition: background 100ms ease;
}
.sort-dropdown__item:hover {
  background: var(--surface);
  color: var(--text);
}
.sort-dropdown__item.is-selected {
  color: var(--text);
  font-weight: 600;
}

/* Search expand wrapper — hidden by default */
.history-search {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}
.history-search.is-open {
  display: flex;
}
.history-search__icon {
  flex-shrink: 0;
  color: var(--text3);
}
.history-search__input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text);
  width: 180px;
}
.history-search__input::placeholder {
  color: var(--text3);
}
.history-search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  color: var(--text3);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.history-search__close:hover {
  color: var(--text);
}

.history-no-results {
  text-align: center;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: var(--t-sm);
  padding: var(--s-5) 0;
}

/* ---- History Grid ---- */
.history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}

@media (min-width: 480px) {
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .history-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- History Strip (horizontal scroll) ---- */
.history-strip {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s-2);
  -webkit-overflow-scrolling: touch;
}

.history-strip > * {
  scroll-snap-align: start;
}

/* Hide scrollbar but keep functionality */
.history-strip::-webkit-scrollbar {
  height: 0;
}

/* ---- Activity Feed ---- */
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-item__avatar {
  margin-top: 1px;
}

.activity-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-2);
}

.activity-item__text {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--text-secondary);
  line-height: 1.45;
}

.activity-item__actor {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

a.activity-item__actor:hover {
  text-decoration: underline;
}

.activity-item__book {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

a.activity-item__book:hover {
  text-decoration: underline;
}

.activity-item__target {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

a.activity-item__target:hover {
  text-decoration: underline;
}

.activity-item__emoji {
  font-size: var(--t-base);
  line-height: 1;
}

.activity-item__time {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Stagger entrance */
.activity-item {
  animation: activitySlideIn 350ms ease both;
}

@keyframes activitySlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.activity-item:nth-child(1)  { animation-delay: 0ms; }
.activity-item:nth-child(2)  { animation-delay: 30ms; }
.activity-item:nth-child(3)  { animation-delay: 60ms; }
.activity-item:nth-child(4)  { animation-delay: 90ms; }
.activity-item:nth-child(5)  { animation-delay: 120ms; }
.activity-item:nth-child(6)  { animation-delay: 150ms; }
.activity-item:nth-child(7)  { animation-delay: 180ms; }
.activity-item:nth-child(8)  { animation-delay: 210ms; }
.activity-item:nth-child(9)  { animation-delay: 240ms; }
.activity-item:nth-child(10) { animation-delay: 270ms; }
.activity-item:nth-child(n+11) { animation-delay: 300ms; }

/* ---- Upcoming Docket ---- */
.upcoming-section {
  padding-bottom: var(--s-5);
}

.upcoming-docket {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  border-left: 2px solid var(--border);
  margin-left: var(--s-1);
}

.upcoming-docket__item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding-left: var(--s-4);
  position: relative;
}

/* Timeline dot */
.upcoming-docket__item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  border: 2px solid var(--bg);
}

.upcoming-docket__marker {
  flex-shrink: 0;
  min-width: 88px;
  padding-top: 2px;
}

.upcoming-docket__month {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}

.upcoming-docket__card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  text-decoration: none;
  color: inherit;
  padding: var(--s-3);
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.upcoming-docket__card:hover {
  background: var(--surface);
}

.upcoming-docket__card--tbd {
  opacity: 0.6;
}

.upcoming-docket__cover {
  width: 56px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.upcoming-docket__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upcoming-docket__cover--tbd {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  border-style: dashed;
}

.upcoming-docket__cover--tbd svg {
  width: 24px;
  height: 24px;
}

.upcoming-docket__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.upcoming-docket__title {
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.upcoming-docket__title--tbd {
  font-style: italic;
  color: var(--text3);
}

.upcoming-docket__author {
  font-family: var(--font-reading);
  font-size: var(--t-sm);
  font-style: italic;
  color: var(--text2);
}

.upcoming-docket__details {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  margin-top: 2px;
}

/* Responsive: stack on narrow screens */
@media (max-width: 480px) {
  .upcoming-docket__item {
    flex-direction: column;
    gap: var(--s-1);
  }

  .upcoming-docket__marker {
    min-width: 0;
  }

  .upcoming-docket__card {
    padding: var(--s-2);
  }
}

/* ---- About Section ---- */
.about-section {
  border-top: 1px solid var(--border);
  padding: var(--s-6) 0;
}

.about-section__content {
  max-width: 520px;
}

.about-section__stats {
  display: flex;
  gap: var(--s-5);
  margin-top: var(--s-3);
}

.about-section__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---- Placeholder Cover (deterministic color from title) ---- */
.placeholder-cover {
  --ph-hue: 200;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(
    160deg,
    hsl(var(--ph-hue) 45% 65%),
    hsl(calc(var(--ph-hue) + 35) 40% 50%)
  );
  padding: var(--s-2);
  overflow: hidden;
}

.placeholder-cover__initial {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.placeholder-cover__title {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}

/* Legacy SVG icon (hidden if initial is present) */
.placeholder-cover svg {
  width: 32px;
  height: 32px;
  opacity: 0.25;
}

/* ============================================
   NOMINATION FORM — Phase 3
   ============================================ */

/* ---- Form Elements (reusable) ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text);
}

/* When inside .form-group, the label is just text — the group handles layout */
.form-group > .form-label {
  display: inline;
}

.form-required {
  color: var(--danger, #dc2626);
  margin-left: 2px;
}

.form-hint {
  color: var(--text3);
  font-weight: 400;
}

.form-input {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-base);
  color: var(--text);
  background: var(--bg);
  transition: border-color 150ms ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.form-input::placeholder {
  color: var(--text3);
}

textarea.form-input {
  resize: vertical;
  min-height: 60px;
}

.char-counter {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
  text-align: right;
  margin-top: 2px;
}

.char-counter--warn {
  color: var(--danger);
}

/* ---- Buttons (reusable) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-3) var(--s-4);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.btn:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--cta-bg);
  color: var(--cta-text);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---- Nomination Page ---- */
.nom-page {
  padding: var(--s-6) 0;
  max-width: 520px;
  margin: 0 auto;
}

.nom-page__heading {
  margin-bottom: var(--s-1);
}

.nom-page__subheading {
  margin-bottom: var(--s-5);
}

/* ---- Nomination Search ---- */
.nom-search {
  position: relative;
  margin-bottom: var(--s-3);
}
.nom-search__results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 360px;
  overflow-y: auto;
  margin-top: var(--s-1);
}
.nom-search__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  cursor: pointer;
  transition: background 100ms;
  border-bottom: 1px solid var(--border);
}
.nom-search__item:last-child {
  border-bottom: none;
}
.nom-search__item:hover {
  background: var(--surface);
}
.nom-search__item img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.nom-search__item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.nom-search__item-title {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nom-search__item-author {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text2);
}
.nom-search__empty {
  padding: var(--s-3);
  text-align: center;
  font-size: var(--t-sm);
  color: var(--text3);
}

.nom-divider {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-3);
}
.nom-divider::before,
.nom-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.nom-divider__text {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nom-form[hidden] { display: none; }
.nom-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.nom-form__fields {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ---- Cover Preview (tappable) ---- */
.nom-preview[hidden] { display: none; }
.nom-preview {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  width: 100%;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  animation: fadeIn 200ms ease;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.nom-preview:hover,
.nom-preview:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.nom-preview__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--s-1);
  min-width: 0;
}

.nom-preview__title {
  font-family: var(--font-brand);
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--text);
}

.nom-preview__author {
  font-family: var(--font-reading);
  font-style: italic;
  font-size: var(--t-xs);
  color: var(--text2);
}

.nom-preview__year {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
  margin-top: 2px;
}

.nom-preview__hint {
  color: var(--accent);
  font-style: italic;
  margin-top: var(--s-1);
}

/* ---- Nomination Confirmed ---- */
.nom-confirmed {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.nom-confirmed__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--success, #16a34a);
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--s-2) var(--s-3);
  align-self: flex-start;
}

.nom-confirmed__card {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nom-confirmed__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nom-confirmed__title {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 400;
  color: var(--text);
}

.nom-confirmed__author {
  font-family: var(--font-reading);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--text2);
}

.nom-confirmed__reason {
  margin-top: var(--s-2);
  font-family: var(--font-reading);
  font-size: var(--t-sm);
  color: var(--text2);
  line-height: 1.5;
}

.nom-confirmed__actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ---- Inline Messages ---- */
.nom-message {
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-sm);
}

.nom-message--success {
  background: #E0F2F1;
  color: var(--accent2);
  border: 1px solid #B2DFDB;
}

.nom-message--error {
  background: #FEF2F2;
  color: var(--danger);
  border: 1px solid #FECACA;
}

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


/* ============================================
   VOTING BALLOT — Phase 4
   ============================================ */

/* ---- Vote Page ---- */
.vote-page {
  padding: var(--s-6) 0;
  max-width: 600px;
  margin: 0 auto;
}

.vote-page__header {
  text-align: center;
  margin-bottom: var(--s-3);
}

.vote-page__heading {
  margin-bottom: var(--s-1);
}

.vote-page__count {
  margin-top: var(--s-1);
}

.vote-page__instructions {
  text-align: center;
  margin-bottom: var(--s-4);
}

.vote-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.vote-form__submit {
  align-self: center;
  min-width: 200px;
}

/* ---- Ballot List ---- */
.ballot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ---- Ballot Card ---- */
.ballot-card {
  display: grid;
  grid-template-columns: 36px 80px 1fr 40px;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: grab;
  user-select: none;
  transition: box-shadow 150ms ease, opacity 150ms ease;
}

.ballot-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ballot-card:active {
  cursor: grabbing;
}

.ballot-card--dragging {
  opacity: 0.35;
}

.ballot-hint {
  text-align: center;
  margin-top: var(--s-2);
}

.ballot-card--ghost {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--text);
}

/* Rank badge */
.ballot-card__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--t-base);
  color: var(--text);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Top-3 rank accent colors */
.ballot-card:nth-child(1) .ballot-card__rank {
  background: #D4A017;
  color: #fff;
}
.ballot-card:nth-child(2) .ballot-card__rank {
  background: #94A3B8;
  color: #fff;
}
.ballot-card:nth-child(3) .ballot-card__rank {
  background: #CD7F32;
  color: #fff;
}

/* Cover */
.ballot-card__cover {
  width: 80px;
}

/* Body */
.ballot-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ballot-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Details toggle */
.ballot-card__details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text3);
  font-family: inherit;
  transition: color 120ms ease;
  margin-top: 2px;
}

.ballot-card__details-toggle:hover {
  color: var(--text);
}

.ballot-card__details-chevron {
  transition: transform 200ms ease;
}

.ballot-card__details-toggle[aria-expanded="true"] .ballot-card__details-chevron {
  transform: rotate(180deg);
}

/* Collapsible detail section */
.ballot-card__details[hidden] {
  display: none !important;
}

.ballot-card__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.ballot-card__reason {
  font-style: italic;
  color: var(--text2);
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ballot-card__links {
  display: flex;
  gap: var(--s-2);
  margin-top: 2px;
}

.ballot-card__link {
  color: var(--accent);
  text-decoration: underline;
}

/* Controls column (up/down + drag handle) */
.ballot-card__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ballot-card__move {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.ballot-card__move:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.ballot-card__move:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Drag handle */
.ballot-card__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  cursor: grab;
  padding: 2px 0;
  touch-action: none;
}

.ballot-card__handle:active {
  cursor: grabbing;
}

/* ---- No-JS Rank Selects ---- */
.vote-nojs-ranks {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.form-input--sm {
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-xs);
  width: auto;
  display: inline-flex;
}

/* Mobile: compact ballot card */
@media (max-width: 480px) {
  .ballot-card {
    grid-template-columns: 32px 56px 1fr 36px;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
  }

  .ballot-card__cover {
    width: 56px;
  }

  .ballot-card__rank {
    width: 30px;
    height: 30px;
    font-size: var(--t-sm);
  }
}


/* ============================================
   MEETING DETAILS BAR — Shared partial (nominations, vote, results)
   ============================================ */

.meeting-details-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-3);
  margin-bottom: var(--s-4);
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text2);
}

.meeting-details-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.meeting-details-bar__item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.meeting-details-bar__link {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms ease;
}

.meeting-details-bar__link:hover {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 640px) {
  .meeting-details-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-1);
  }
}

/* ============================================
   NOMINATIONS PAGE — Sprint 5
   ============================================ */

.nominations-page {
  padding: var(--s-6) 0;
  max-width: 640px;
  margin: 0 auto;
}

.nominations-page__header {
  text-align: center;
  margin-bottom: var(--s-3);
}

.nominations-page__heading {
  margin-bottom: var(--s-1);
}

.nominations-page__count {
  margin-top: var(--s-1);
}

.nominations-page__actions {
  text-align: center;
  margin-bottom: var(--s-4);
}

.nominations-page__empty {
  text-align: center;
  padding: var(--s-6) 0;
}

/* ---- Nominee Grid ---- */
.nominee-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ---- Nominee Card ---- */
.nominee-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nominee-card__cover {
  width: 80px;
}

.nominee-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nominee-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Entrance animation for new nominees */
@keyframes nominee-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nominee-card--entering {
  animation: nominee-enter 400ms ease-out both;
}

@media (max-width: 480px) {
  .nominee-card {
    grid-template-columns: 60px 1fr;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
  }

  .nominee-card__cover {
    width: 60px;
  }
}


/* ============================================
   RESULTS — Phase 4
   ============================================ */

/* ---- Results Page ---- */
.results-page {
  padding: var(--s-6) 0;
  max-width: 640px;
  margin: 0 auto;
}

.results-page__header {
  text-align: center;
  margin-bottom: var(--s-5);
}

.results-page__heading {
  margin-bottom: var(--s-1);
}

.results-page__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

.results-page__note {
  text-align: center;
  margin-top: var(--s-5);
  font-style: italic;
}

/* ---- Status Pills (Open/Closed) ---- */
.status-pill--open {
  background: #FFF8E1;
  color: #92400e;
}

.status-pill--closed {
  background: #E0F2F1;
  color: var(--accent2);
}

/* ---- Winner Callout ---- */
.results-winner {
  position: relative;
  padding: var(--s-5);
  margin-bottom: var(--s-5);
  background: linear-gradient(135deg, #FFFBEB 0%, #FFF7ED 50%, #FFFBEB 100%);
  border: 2px solid #FDE68A;
  border-radius: var(--radius-md);
  animation: winnerReveal 600ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.results-winner::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.results-winner::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(245,166,35,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

@keyframes winnerReveal {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.results-winner__ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400E;
  margin-bottom: var(--s-3);
}
.results-winner__ribbon svg {
  color: var(--star);
}

.results-winner__card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.results-winner__cover {
  flex-shrink: 0;
  width: 120px;
  display: block;
}
.results-winner__cover-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.15);
}

.results-winner__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.results-winner__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.results-winner__author {
  font-family: var(--font-reading);
  font-size: 0.95rem;
  color: var(--text2);
  font-style: italic;
}
.results-winner__nominator {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 400;
  color: #92400E;
  margin-top: 2px;
}

.results-winner__link {
  margin-top: var(--s-2);
  align-self: flex-start;
}

/* ---- Results Winner Dark Mode ---- */
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.2) 0%, rgba(180, 83, 9, 0.1) 50%, rgba(120, 53, 15, 0.2) 100%);
  border-color: rgba(251, 191, 36, 0.3);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner::before {
  background: radial-gradient(circle, rgba(245, 166, 35, 0.08) 0%, transparent 70%);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner::after {
  background: radial-gradient(circle, rgba(245, 166, 35, 0.06) 0%, transparent 70%);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner__ribbon {
  color: #fbbf24;
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner__nominator {
  color: rgba(251, 191, 36, 0.7);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .results-winner__cover-img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn--sm {
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-xs);
}

/* ---- Bar Chart ---- */
.results-chart {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.results-bar {
  display: grid;
  grid-template-columns: 48px 1fr 64px;
  gap: var(--s-2);
  align-items: center;
}

.results-bar__cover {
  width: 48px;
}

.book-cover--xs {
  width: 48px;
}

.placeholder-cover--xs {
  width: 48px;
}

.placeholder-cover--xs .placeholder-cover__initial {
  font-size: 1rem;
}

.placeholder-cover--xs .placeholder-cover__title {
  display: none;
}

.placeholder-cover--sm .placeholder-cover__initial {
  font-size: 1.75rem;
}

.placeholder-cover--sm .placeholder-cover__title {
  font-size: 0.5625rem;
}

.results-bar__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.results-bar__meta {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  min-width: 0;
}

.results-bar__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.results-bar__nominator {
  white-space: nowrap;
  flex-shrink: 0;
  font-style: italic;
}

.results-bar__author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -2px;
}

.results-bar__track {
  height: 12px;
  background: var(--surface2, var(--surface));
  border-radius: 6px;
  overflow: hidden;
}

.results-bar__fill {
  height: 100%;
  border-radius: 6px;
  min-width: 4px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.results-bar__points {
  text-align: right;
  white-space: nowrap;
  color: var(--text2);
}

/* ---- Results: "Last updated" label ---- */
.results-page__updated {
  text-align: center;
  margin-top: var(--s-3);
  font-style: italic;
}

/* ---- Results: Live-update animations ---- */

/* Pop + glow for points / vote count when values change */
@keyframes results-pop {
  0%   { transform: scale(1); color: inherit; }
  15%  { transform: scale(1.5); color: var(--star, #F5A623); text-shadow: 0 0 8px rgba(245, 166, 35, 0.6); }
  40%  { transform: scale(0.9); color: var(--star, #F5A623); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); color: inherit; text-shadow: none; }
}

.is-pop {
  display: inline-block; /* scale needs a block-like context */
  animation: results-pop 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Amber glow row highlight when a bar's data changes */
@keyframes results-row-highlight {
  0%   { background-color: rgba(245, 166, 35, 0.25); box-shadow: 0 0 12px rgba(245, 166, 35, 0.2); }
  40%  { background-color: rgba(245, 166, 35, 0.12); box-shadow: 0 0 6px rgba(245, 166, 35, 0.1); }
  100% { background-color: transparent; box-shadow: none; }
}

.results-bar.is-updated {
  animation: results-row-highlight 2s ease-out;
  border-radius: var(--radius-sm);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .results-bar {
    grid-template-columns: 40px 1fr 52px;
    gap: var(--s-2);
  }

  .results-bar__cover {
    width: 40px;
  }

  .book-cover--xs {
    width: 40px;
  }

  .results-bar__nominator {
    display: none;
  }

  .results-winner {
    padding: var(--s-4);
  }

  .results-winner__cover {
    width: 90px;
  }

  .results-winner__title {
    font-size: 1.1rem;
  }
}

/* ==================================================================
   Phase 5 — Admin, Auth, Reviews
   ================================================================== */

/* ---- Button: Ghost ---- */
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: var(--surface);
}

/* ---- Button: Tertiary (text-only) ---- */
.btn--tertiary {
  background: transparent;
  color: var(--text2);
  border: none;
  padding: var(--s-1) 0;
}
.btn--tertiary:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---- Form Select & Textarea ---- */
.form-select {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-base);
  color: var(--text);
  background: var(--bg);
  transition: border-color 150ms ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-2) center;
  padding-right: var(--s-5);
}

.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.form-textarea {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-base);
  color: var(--text);
  background: var(--bg);
  transition: border-color 150ms ease;
  resize: vertical;
  min-height: 120px;
  box-sizing: border-box;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.form-textarea::placeholder {
  color: var(--text3);
}

/* ---- Alert Boxes ---- */
.alert {
  border-radius: var(--radius-md);
  padding: var(--s-3);
  margin-bottom: var(--s-4);
}

.alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

/* ---- Grade Select (legacy) ---- */
.grade-select {
  max-width: 200px;
}

/* ---- Grade Picker (pill strip) ---- */
.grade-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.grade-picker__display {
  align-self: center;
}

.grade-picker__value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  background: var(--surface);
  color: var(--text3);
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

/* Scrollable pill strip */
.grade-picker__strip {
  display: flex;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
}
.grade-picker__strip::-webkit-scrollbar {
  display: none;                   /* Chrome/Safari */
}

/* Individual grade pill */
.grade-pill {
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  padding: 0 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-sm);
  color: var(--text3);
  cursor: pointer;
  scroll-snap-align: center;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.grade-pill:hover {
  background: var(--surface);
  border-color: var(--text3);
  color: var(--text2);
}

.grade-pill:active {
  transform: scale(0.93);
}

.grade-pill.is-selected {
  transform: scale(1.08);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-pill {
  background: var(--surface);
  border-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-pill.is-selected {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---- Formatting Hint (subtle inline) ---- */
.formatting-hint {
  margin: calc(-1 * var(--s-2)) 0 0;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
  line-height: 1.6;
}

.formatting-hint code {
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text3);
  letter-spacing: -0.02em;
}

/* ---- Expand Review Button ---- */
/* ---- Markdown Toolbar ---- */
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface);
}
.md-toolbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: none;
  border-radius: var(--radius-xs);
  background: none;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--text2);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.md-toolbar__btn:hover {
  background: var(--bg);
  color: var(--text);
}
.md-toolbar__btn.is-active {
  background: var(--accent);
  color: #fff;
}
.md-toolbar__btn--preview {
  font-size: var(--t-xs);
  font-weight: 600;
  padding: 0 10px;
}
.md-toolbar__spacer {
  flex: 1;
}

/* Textarea attached to toolbar (no top border radius) */
.form-textarea--toolbar {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ---- Character Count ---- */
.char-count {
  margin-top: 4px;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  text-align: right;
}
.char-count--warn { color: var(--amber); }
.char-count--over { color: var(--red); font-weight: 600; }

/* ---- Review Preview Pane ---- */
.review-preview {
  min-height: 120px;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: var(--t-base);
  color: var(--text);
  line-height: 1.7;
}
.review-preview p { margin-bottom: var(--s-2); }
.review-preview blockquote {
  border-left: 3px solid var(--border);
  padding-left: var(--s-3);
  color: var(--text2);
  margin: var(--s-2) 0;
}
.review-preview ul { padding-left: var(--s-4); margin: var(--s-2) 0; }
.review-preview li { margin-bottom: 4px; }
.review-preview a { color: var(--accent); text-decoration: underline; }

/* Dark mode — toolbar + preview */
:is([data-theme="dark"], :root:not([data-theme="light"])) .md-toolbar {
  background: var(--surface2);
  border-color: var(--border);
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .md-toolbar__btn:hover {
  background: var(--surface);
}

/* Compact toolbar (reply forms) */
.md-toolbar--compact {
  gap: 1px;
  padding: 3px;
}
.md-toolbar--compact .md-toolbar__btn {
  min-width: 28px;
  height: 26px;
  padding: 0 4px;
  font-size: var(--t-xs);
}
.reply-form__textarea--toolbar {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ---- Admin: Stats Row ---- */
.admin-stats {
  display: flex;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.admin-stat-card {
  flex: 1;
  padding: var(--s-4);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.admin-stat-card__value {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.admin-stat-card__label {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 6px;
}

/* ---- Admin: Meeting Card ---- */
.admin-meeting-card {
  padding: var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--s-3);
  transition: border-color 150ms ease;
}

.admin-meeting-card:hover {
  border-color: var(--text3);
}

.admin-meeting-card__header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}

.admin-meeting-card__body {
  margin-bottom: var(--s-2);
}

.admin-meeting-card__actions {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Meeting card with book cover */
.admin-meeting-card--with-cover {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--s-3);
}

.admin-meeting-card__cover {
  width: 80px;
  flex-shrink: 0;
  grid-row: 1 / -1;
}

.admin-meeting-card__cover .book-cover {
  width: 80px;
  aspect-ratio: 2 / 3;
}

.admin-meeting-card__content {
  min-width: 0;
}

/* ---- Admin: Actions Row ---- */
.admin-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-3);
}

/* ---- Admin: Status Override ---- */
.admin-status-override {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
}

.admin-status-override label {
  white-space: nowrap;
}

.form-input--sm {
  padding: 5px 8px;
  font-size: var(--t-sm);
  line-height: 1.4;
}

/* ---- Admin: Table ---- */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-body);
  font-size: var(--t-sm);
}

.admin-table th,
.admin-table td {
  padding: var(--s-2) var(--s-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
}

/* ---- Admin: Users table ---- */
.admin-table--users {
  table-layout: auto;
}

.user-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}

.user-actions {
  display: flex;
  gap: var(--s-1);
  justify-content: flex-end;
  white-space: nowrap;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: capitalize;
}

.role-badge--admin {
  background: var(--amber);
  color: #000;
}

/* ---- Admin: Reviews table ---- */
.admin-table--reviews {
  table-layout: auto;
}

.review-book-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-expand-row {
  display: none;
}
.review-expand-row.is-open {
  display: table-row;
}

.review-expand-row td {
  padding-top: 0 !important;
  border-bottom: 1px solid var(--border);
}

.review-expand-body {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--s-3);
  margin-bottom: var(--s-2);
  line-height: 1.6;
  white-space: pre-wrap;
}

.js-review-row {
  cursor: default;
}

/* ---- Admin: Nominees ---- */
.admin-nominees {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.admin-nominee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-nominee-form {
  display: flex;
  gap: var(--s-2);
  align-items: flex-end;
  margin-top: var(--s-3);
}

.admin-nominee-form .form-input {
  flex: 1;
}

/* ---- Login Page ---- */
.login-page {
  max-width: 380px;
  margin: 0 auto;
  padding: var(--s-7) 0;
}

.login-page__heading {
  margin-bottom: var(--s-2);
}

.login-page__subtitle {
  margin-bottom: var(--s-4);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.login-form[hidden] {
  display: none;
}

.login-sent {
  text-align: center;
}

.login-sent p {
  margin-bottom: var(--s-2);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-4) 0 var(--s-3);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider__text {
  white-space: nowrap;
}

/* ---- Changelog ---- */
.changelog-page {
  padding: var(--s-6) 0 var(--s-7);
}

.changelog-page__heading {
  margin-bottom: var(--s-1);
}

.changelog-page__intro {
  margin-bottom: var(--s-6);
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}

.changelog-release {
  /* no outer card — content sits directly on the page */
}

.changelog-release__meta {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}
.changelog-release__meta-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.changelog-release__version {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--t-sm);
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-lg);
  letter-spacing: 0.02em;
}

.changelog-release__title {
  font-family: var(--font-body);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.changelog-release__intro {
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: var(--s-5);
}

.changelog-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.changelog-feature {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3);
  background: var(--surface2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.changelog-feature__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
}

.changelog-feature__text {
  color: var(--text2);
  font-size: var(--t-sm);
  line-height: 1.5;
}

.changelog-release__outro {
  color: var(--text2);
  line-height: 1.6;
  font-style: italic;
}

/* ---- Changelog Collapse ---- */
.changelog-release__meta {
  position: relative;
}
.changelog-release__toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text3);
  transition: color 120ms ease, transform 200ms ease;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
}
.changelog-release__toggle:hover {
  color: var(--text);
}
.changelog-release__body {
  transition: opacity 200ms ease;
}
.changelog-release__body.is-collapsed {
  display: none;
}

@media (max-width: 600px) {
  .changelog-features {
    grid-template-columns: 1fr;
  }
}

/* ---- Nav User ---- */
.nav-user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--t-sm);
}

.nav-user__name {
  color: var(--text2);
}

.nav-user__link {
  color: var(--text2);
  text-decoration: none;
}

.nav-user__link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---- Review Form Page ---- */
.review-form-page {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-3);
}

.review-form-page__book {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.review-form__actions {
  display: flex;
  gap: var(--s-3);
  align-items: center;
}

/* ---- Review Card: Author Name ---- */
.review-card__author {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

/* ---- Review Card: Book Link (My Reviews) ---- */
.review-card__book-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--s-1);
}

.review-card__book-link:hover strong {
  text-decoration: underline;
}

.review-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-1);
}
.review-card__heading .review-card__book-link {
  margin-bottom: 0;
}
.review-card__heading .grade-badge {
  margin-top: 2px;
}

.review-card__actions {
  margin-top: var(--s-2);
}

.review-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-1);
}

/* ---- My Reviews Summary ---- */
.my-reviews-summary {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--s-5);
}
.my-reviews-summary__stat {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.my-reviews-summary__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.my-reviews-summary__label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text3);
}
.my-reviews-summary__divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ---- My Reviews List ---- */
.my-reviews-list {
  display: flex;
  flex-direction: column;
}

.review-card--linked {
  padding: var(--s-4) 0;
  border-top: 1px solid var(--border);
}

.review-card--linked:first-child {
  border-top: none;
}

/* ---- Review Card: Cover Thumbnail ---- */
.review-card__cover {
  flex-shrink: 0;
  width: 60px;
  align-self: flex-start;
}
.review-card__cover-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.review-card__cover:hover .review-card__cover-img {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

@media (max-width: 480px) {
  .review-card__cover {
    width: 48px;
  }
}

/* ---- About Page ---- */
.about-intro {
  margin-bottom: var(--s-6);
}
.about-intro__tagline {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: var(--s-3);
}
.about-intro__desc {
  font-family: var(--font-reading);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text2);
  max-width: 680px;
}
.about-intro__desc p {
  margin-bottom: var(--s-3);
}
.about-intro__desc p:last-child {
  margin-bottom: 0;
}

.about-stats {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  padding: var(--s-5) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.about-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  flex: 1;
  text-align: center;
}
.about-stats__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
}
.about-stats__icon svg {
  width: 22px;
  height: 22px;
}
.about-stats__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.about-stats__label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.about-section {
  margin-bottom: var(--s-6);
}
.t-section-sm {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--s-3);
  color: var(--text);
}
.about-section__text {
  font-family: var(--font-reading);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text2);
  margin-bottom: var(--s-3);
}

.about-ctas__buttons {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: -3px;
  margin-right: 6px;
}

.about-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.about-steps__item {
  position: relative;
  padding-left: 36px;
  margin-bottom: var(--s-3);
  font-family: var(--font-reading);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text2);
  counter-increment: step;
}
.about-steps__item::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-steps__item strong {
  color: var(--text);
}

@media (max-width: 480px) {
  .about-stats {
    flex-direction: column;
    gap: var(--s-4);
    padding: var(--s-4);
  }
  .about-stats__item {
    flex-direction: row;
    gap: var(--s-3);
    text-align: left;
  }
  .about-stats__icon {
    width: 36px;
    height: 36px;
  }
  .about-stats__icon svg {
    width: 20px;
    height: 20px;
  }
  .about-stats__value {
    font-size: 1.5rem;
  }
  .about-ctas__buttons {
    flex-direction: column;
  }
  .about-ctas__buttons .btn {
    text-align: center;
    justify-content: center;
  }
}

/* ---- Status Pill (admin) ---- */
.status-pill {
  display: inline-block;
  padding: 2px var(--s-2);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill--scheduled { background: #F1F5F9; color: #475569; }
.status-pill--upcoming { background: #EFECE6; color: #57534E; }
.status-pill--reading { background: #DBEAFE; color: #1D4ED8; }
.status-pill--nominations { background: #FFEDD5; color: #C2410C; }
.status-pill--voting { background: #F3E8FF; color: #7C3AED; }
.status-pill--results { background: #D1FAE5; color: #059669; }

/* ---- Responsive: Admin ---- */
@media (max-width: 640px) {
  /* Stats row */
  .admin-stats {
    flex-direction: column;
  }

  /* Nominee add form */
  .admin-nominee-form {
    flex-direction: column;
    align-items: stretch;
  }

  /* ---- Meetings table → stacked cards ---- */
  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    padding: var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--s-2);
    background: var(--surface);
  }

  .admin-table td {
    padding: 2px 0;
    border: none;
    text-align: left !important;
  }

  /* First td is month/year — make it the card heading */
  .admin-table td:first-child {
    font-weight: 600;
    font-size: var(--t-base);
    margin-bottom: var(--s-1);
  }

  /* Last td is the Manage button — right-align */
  .admin-table td:last-child {
    margin-top: var(--s-2);
  }

  .admin-table-wrap {
    overflow-x: visible;
  }

  /* ---- Users table: stacked on mobile ---- */
  .admin-table--users td:first-child {
    font-weight: normal;
    font-size: inherit;
    margin-bottom: 0;
  }

  .user-actions {
    justify-content: flex-start;
  }

  /* ---- Lifecycle stepper: vertical on mobile ---- */
  .lifecycle-stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--s-3);
  }

  .lifecycle-step {
    padding: var(--s-1) 0;
    font-size: 12px;
  }

  .lifecycle-step__connector {
    width: 2px;
    height: 16px;
    margin: 0 0 0 3px;
    display: block;
  }

  /* ---- Pipeline panel: stack on mobile ---- */
  .pipeline-panel__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .pipeline-panel__footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-2);
  }

  .pipeline-override {
    margin-left: 0;
  }

  /* ---- Status override: stack on mobile ---- */
  .admin-status-override {
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
    gap: var(--s-2);
    width: 100%;
    padding-top: var(--s-2);
    border-top: 1px solid var(--border);
  }

  .admin-status-override label {
    width: 100%;
  }

  .admin-status-override .form-input--sm {
    flex: 1;
  }

  /* ---- QR panel: full-width codes on mobile ---- */
  .qr-panel__grid {
    flex-direction: column;
    align-items: center;
  }

  .qr-panel__code {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1;
  }

  .qr-panel__item {
    width: 100%;
    align-items: center;
  }

  /* ---- Admin page header ---- */
  .admin-page__header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }

  .admin-toolbar {
    width: 100%;
  }

  .admin-search {
    flex: 1;
  }

  .admin-search__input {
    width: 100%;
  }

  /* ---- Admin winner callout ---- */
  .admin-winner--with-cover {
    grid-template-columns: 1fr;
  }

  .admin-winner__cover {
    width: 80px;
  }
}

/* ==================================================================
   Phase 6 — QR Codes, Display Name, Admin Settings
   ================================================================== */

/* ---- QR Panel ---- */
.qr-panel {
  margin: var(--s-4) 0;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.qr-panel__heading {
  margin-bottom: var(--s-3);
}

.qr-panel__grid {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.qr-panel__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}

.qr-panel__code {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-sm);
}

.qr-panel__label {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text);
}

.qr-panel__url {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text3);
  word-break: break-all;
  max-width: 160px;
  text-align: center;
}

/* ---- Display Name Form (nav) ---- */
.display-name-form {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.display-name-form__input {
  padding: 2px var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text);
  background: var(--bg);
  width: 120px;
}

.display-name-form__input:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  border-color: transparent;
}

/* ---- Admin: User List ---- */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ---- Admin: Settings Card ---- */
.admin-settings-card {
  padding: var(--s-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--s-3);
}

/* ---- Admin: Inline Form (double selector for specificity over .admin-form) ---- */
.admin-form.admin-form--inline {
  display: flex;
  flex-direction: row;
  gap: var(--s-2);
  align-items: flex-end;
  flex-wrap: wrap;
}

.admin-form.admin-form--inline .form-input {
  flex: 1;
  min-width: 140px;
}

/* ---- Print styles for QR panel ---- */
@media print {
  .global-nav,
  .admin-shell__nav,
  .pipeline-panel,
  .admin-nominees,
  .admin-form,
  .admin-settings-card:last-child {
    display: none;
  }

  .qr-panel {
    border: none;
    padding: 0;
    background: none;
    break-inside: avoid;
  }

  .qr-panel__code {
    width: 200px;
    height: 200px;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ballot-card,
  .results-bar__fill,
  .grade-chart__bar {
    transition: none;
  }

  .nom-preview,
  .results-winner,
  .is-pop,
  .results-bar.is-updated {
    animation: none;
  }

  .results-bar {
    transition: none;
  }
}

/* ==================================================================
   ADMIN DESIGN POLISH — Visual refinements
   ================================================================== */

/* ---- Admin Page Layout ---- */
.admin-page {
  padding: var(--s-5) 0 var(--s-7);
}

.admin-page__heading {
  margin-bottom: var(--s-1);
}

.admin-page__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}

.admin-page__subheading {
  margin-top: var(--s-5);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--border);
}

/* ---- Admin Toolbar (search + sort) ---- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.admin-search {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  transition: border-color 150ms ease;
}

.admin-search:focus-within {
  border-color: var(--focus);
}

.admin-search__icon {
  flex-shrink: 0;
  color: var(--text3);
}

.admin-search__input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text);
  width: 200px;
  padding: 2px 0;
}

.admin-search__input::placeholder {
  color: var(--text3);
}

.admin-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.admin-search__clear:hover {
  color: var(--text);
}

.admin-search__clear[hidden] {
  display: none;
}

.admin-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  transition: background 120ms ease, color 120ms ease;
}

.admin-toolbar__btn:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ---- Admin User Row (expanded info) ---- */
.user-row__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.user-row__name-line {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

/* ---- Pagination Controls ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--admin-border);
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 150ms ease, background 150ms ease;
}

.pagination__btn:hover:not(.is-disabled) {
  border-color: var(--accent);
  background: var(--surface);
}

.pagination__btn.is-disabled {
  color: var(--text3);
  cursor: default;
  opacity: 0.5;
}

.pagination__info {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--text2);
}

/* ---- Admin Empty State ---- */
.admin-empty {
  padding: var(--s-5) var(--s-4);
  background: var(--admin-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

/* ---- Admin Winner / Selected Book Callout ---- */
.admin-winner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
}

.admin-winner--with-cover {
  align-items: flex-start;
}

.admin-winner__cover {
  width: 64px;
  flex-shrink: 0;
}

.admin-winner__cover .book-cover {
  width: 64px;
  aspect-ratio: 2 / 3;
}

.admin-winner__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
  flex: 1;
  min-width: 0;
}

/* ---- Admin Detail Meta ---- */
.admin-detail-meta {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--admin-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ---- Admin: Back Link ---- */
.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text3);
  text-decoration: none;
  margin-bottom: var(--s-3);
  transition: color 150ms ease;
}

.admin-back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---- Admin Nominee Row (refined) ---- */
.admin-nominee {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease;
}

.admin-nominee:hover {
  border-color: var(--text3);
}

.admin-nominee .book-cover--xs {
  flex-shrink: 0;
  width: 36px;
  align-self: flex-start;
}

.admin-nominee__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.admin-nominee__actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  flex-shrink: 0;
  align-self: flex-start;
}

.admin-nominee-edit {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex: 1;
  min-width: 0;
}
.admin-nominee-edit[hidden] {
  display: none;
}
.admin-nominee-edit .form-input--sm {
  font-size: var(--t-sm);
  padding: var(--s-1) var(--s-2);
}

/* ---- Admin Form ---- */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

/* ---- Lifecycle Stepper ---- */
.lifecycle-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: var(--s-3) 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
}

.lifecycle-step {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

.lifecycle-step--active {
  color: var(--text);
  font-weight: 700;
}

.lifecycle-step--done {
  color: #059669;
}

.lifecycle-step__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.lifecycle-step--active .lifecycle-step__dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.lifecycle-step--done .lifecycle-step__dot {
  background: #059669;
}

.lifecycle-step__connector {
  width: 24px;
  height: 1px;
  background: var(--border);
  margin: 0 var(--s-1);
  flex-shrink: 0;
}

.lifecycle-step--done + .lifecycle-step__connector,
.lifecycle-step--done ~ .lifecycle-step__connector {
  background: #059669;
}

/* Mobile layout handled in Responsive: Admin section */

/* ---- Pipeline Panel (Admin Meeting Wizard) ---- */
.pipeline-panel {
  margin-top: var(--s-3);
  padding: var(--s-4);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--border);
}

.pipeline-panel--scheduled { border-left-color: #94A3B8; }
.pipeline-panel--upcoming  { border-left-color: #78716C; }
.pipeline-panel--reading   { border-left-color: #3B82F6; }
.pipeline-panel--nominations { border-left-color: #EA580C; }
.pipeline-panel--voting    { border-left-color: #8B5CF6; }
.pipeline-panel--results   { border-left-color: #059669; }

.pipeline-panel__header {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.pipeline-panel__icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.pipeline-panel__titles {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
}

.pipeline-panel__label {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.pipeline-panel__desc {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text2);
  line-height: 1.5;
}

.pipeline-panel__checks {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}

.pipeline-check {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--text2);
}

.pipeline-check__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--border);
  color: var(--text3);
}

.pipeline-check--ok .pipeline-check__icon {
  background: #D1FAE5;
  color: #059669;
}

.pipeline-check--warn .pipeline-check__icon {
  background: #FEF3C7;
  color: #D97706;
}

.pipeline-check__hint {
  color: var(--text3);
  font-size: var(--t-xs);
}

.pipeline-panel__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.pipeline-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, color 150ms ease;
}

.pipeline-link:hover {
  color: var(--text);
  border-color: var(--text3);
  text-decoration: none;
}

.pipeline-link__arrow {
  font-size: 10px;
  opacity: 0.5;
}

.pipeline-panel__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.pipeline-cta {
  font-weight: 600;
}

.pipeline-cta[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pipeline-panel__footer {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--admin-border);
}

.pipeline-override {
  margin-left: auto;
}

.pipeline-override__toggle {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  cursor: pointer;
  user-select: none;
}

.pipeline-override__toggle:hover {
  color: var(--text2);
}

.pipeline-override__body {
  margin-top: var(--s-2);
}

/* ---- Edit Form Slide Animation ---- */
.admin-edit-reveal {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 300ms ease, opacity 200ms ease 50ms;
}

.admin-edit-reveal.is-open {
  max-height: 600px;
  opacity: 1;
}

/* ---- Button: Danger ---- */
.btn--danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}

.btn--danger:hover {
  opacity: 0.9;
}

/* ---- Admin: Danger Zone ---- */
.admin-danger-zone {
  margin-top: var(--s-6);
  padding: var(--s-4);
  border: 1px solid var(--danger, #dc2626);
  border-radius: var(--radius-md);
  background: #FEF2F2;
}

.admin-danger-zone .admin-page__subheading {
  margin-top: 0;
  border-bottom-color: rgba(220, 38, 38, 0.2);
  color: var(--danger, #dc2626);
}

/* ---- Admin: Collapsible Section ---- */
.admin-collapsible__toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-3) 0;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  text-align: left;
  transition: color 150ms ease;
}

.admin-collapsible__toggle:hover {
  color: var(--text);
}

.admin-collapsible__chevron {
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.admin-collapsible.is-open .admin-collapsible__chevron {
  transform: rotate(90deg);
}

.admin-collapsible__body {
  display: none;
}

.admin-collapsible.is-open .admin-collapsible__body {
  display: block;
}

/* ==================================================================
   PROFILE PAGE
   ================================================================== */

.profile-page {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-3);
}

.profile-page__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.profile-page__heading {
  margin-bottom: 0;
}

.profile-section {
  margin-bottom: var(--s-5);
}

.profile-section__title {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  margin-bottom: var(--s-2);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s-4);
  box-shadow: var(--shadow);
}

/* ---- Slug Preview ---- */
.slug-preview {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-top: var(--s-1);
  margin-bottom: var(--s-3);
}

.slug-preview code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: var(--t-xs);
  color: var(--text2);
}

.profile-card__avatar {
  display: flex;
  justify-content: center;
  margin-bottom: var(--s-4);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.profile-logout {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---- Avatar Picker ---- */
.avatar-picker {
  margin-top: var(--s-3);
}

/* Tabs */
.avatar-picker__tabs {
  display: flex;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.avatar-picker__tab {
  padding: var(--s-2) var(--s-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.avatar-picker__tab:hover {
  color: var(--text2);
}

.avatar-picker__tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Panels */
.avatar-picker__panel {
  display: none;
}

.avatar-picker__panel.is-active {
  display: block;
}

/* Grid inside panels */
.avatar-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
}

/* Individual options */
.avatar-picker__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--s-1);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.avatar-picker__option:hover {
  background: var(--surface2);
}

.avatar-picker__option.is-active {
  border-color: var(--accent);
  background: var(--surface);
}

/* ==================================================================
   BOOK DETAIL — Genre Tags, Description, Grade Badge Polish
   ================================================================== */

/* ---- Book Genre Tags ---- */
.book-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-1);
}

.book-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-lg);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ---- Book Description ---- */
.book-description {
  margin-top: var(--s-2);
  font-family: var(--font-reading);
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--text2);
}

.book-description__text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-description__text.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.book-description__toggle {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
}

.book-description__toggle:hover {
  text-decoration: underline;
}

/* ---- Book Meta Inline (year, pages in hero) ---- */
.book-hero__meta-inline {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-1);
}

.book-hero__meta-inline span {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text3);
}

/* ---- Grade Badge — Enhanced ---- */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-lg);
  flex-shrink: 0;
  /* Default: neutral */
  background: var(--surface);
  color: var(--text);
}

/* S tier — premium gold */
.grade-badge--s {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A, #FCD34D);
  color: #78350F;
  box-shadow: 0 1px 6px rgba(245, 158, 11, 0.18);
}

/* A tier — emerald */
.grade-badge--a {
  background: linear-gradient(135deg, #ECFDF5, #A7F3D0);
  color: #065F46;
}

/* B tier — blue */
.grade-badge--b {
  background: linear-gradient(135deg, #EFF6FF, #BFDBFE);
  color: #1E3A5F;
}

/* C tier — warm neutral */
.grade-badge--c {
  background: linear-gradient(135deg, #F5F5F4, #E7E5E4);
  color: #57534E;
}

/* D tier — orange */
.grade-badge--d {
  background: linear-gradient(135deg, #FFF7ED, #FED7AA);
  color: #9A3412;
}

/* F tier — red */
.grade-badge--f {
  background: linear-gradient(135deg, #FEF2F2, #FECACA);
  color: #991B1B;
}

.grade-badge--sm {
  width: 36px;
  height: 36px;
  font-size: var(--t-sm);
}

.grade-badge--xs {
  width: auto;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 20px;
  vertical-align: middle;
}

/* ---- Spoiler ---- */
.spoiler {
  background: var(--text);
  color: transparent;
  border-radius: 3px;
  padding: 0 0.2em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}
.spoiler:hover {
  background: var(--text2);
}
.spoiler.is-revealed {
  background: var(--amber-light, #FFF8E1);
  color: var(--text);
  cursor: pointer;
}

/* Spoiler example in form hint */
.spoiler-example {
  background: var(--text);
  color: transparent;
  border-radius: 3px;
  padding: 0 0.2em;
  font-size: 0.9em;
}

/* ---- Formatting Help ---- */
.formatting-help {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-3);
  margin-bottom: var(--s-3);
}
.formatting-help__label {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--text2);
  margin: 0 0 var(--s-1);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.formatting-help__label svg {
  opacity: 0.6;
}
.formatting-help__examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
}
.formatting-help__item {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.formatting-help__item code {
  font-family: monospace;
  font-size: var(--t-xs);
  background: var(--bg, #fff);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text);
}
.formatting-help__item strong {
  font-weight: 600;
}
.formatting-help__item em {
  font-style: italic;
}


/* ==================================================================
   MEMBERS DIRECTORY PAGE
   ================================================================== */

.members-page {
  padding: var(--s-6) 0;
}

.members-page__header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

/* ---- Members Search ---- */
.members-search {
  position: relative;
  margin-bottom: var(--s-4);
}

.members-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

.members-search__input {
  width: 100%;
  max-width: 320px;
  padding: var(--s-2) var(--s-3) var(--s-2) 36px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  transition: border-color 150ms ease;
}

.members-search__input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Members Grid ---- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-3);
}

/* ---- Member Card ---- */
.member-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.member-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.member-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.member-card__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card__meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .members-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================================================================
   PUBLIC MEMBER PROFILE
   ================================================================== */

.member-profile {
  padding: var(--s-6) 0;
}

/* ---- Hero ---- */
.member-profile__hero {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.member-profile__hero-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

/* ---- Stats bar ---- */
.member-profile__stats {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--s-5);
}

.member-stat {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.member-stat__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.member-stat__label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text3);
}

/* ---- Social links ---- */
.member-profile__social {
  margin-bottom: var(--s-5);
}

.member-profile__section-title {
  margin-bottom: var(--s-3);
}

.member-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.member-social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text2);
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}

.member-social-link:hover {
  border-color: var(--text3);
  color: var(--text);
}

.member-social-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ---- Reviews ---- */
.member-profile__reviews {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}

.member-review-list {
  display: flex;
  flex-direction: column;
}

.member-review-card {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
}

.member-review-card:first-child {
  padding-top: 0;
}

.member-review-card:last-child {
  border-bottom: none;
}

.member-review-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
  flex: 1;
}

.member-review-card__book {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.member-review-card__book:hover strong {
  text-decoration: underline;
}

.member-review-card__text {
  margin-top: var(--s-1);
  line-height: 1.6;
  color: var(--text2);
}

.member-review-card__text p:first-child { margin-top: 0; }
.member-review-card__text p:last-child  { margin-bottom: 0; }

/* ---- Review card: Reviewer row (book-detail) ---- */
.review-card__reviewer {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: inherit;
}

.review-card__reviewer:hover .review-card__author {
  text-decoration: underline;
}

.review-card__reviewer .avatar {
  flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .member-profile__hero {
    flex-direction: column;
    text-align: center;
  }

  .member-profile__stats {
    flex-direction: column;
    gap: var(--s-3);
    text-align: center;
  }

  .member-stat {
    flex-direction: column;
    gap: var(--s-1);
  }
}


/* ============================================
   DARK MODE — Component Overrides
   Hardcoded colors that don't auto-adapt via tokens.
   Two selectors share overrides (OS pref + manual toggle).
   ============================================ */

/* Helper: use :is() to avoid repeating every rule twice */
:is([data-theme="dark"], :root:not([data-theme="light"])) .status-pill--reading {
  background: rgba(14, 116, 108, 0.25);
  color: #5eead4;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .status-pill--nominations,
:is([data-theme="dark"], :root:not([data-theme="light"])) .status-pill--voting {
  background: rgba(217, 119, 6, 0.25);
  color: #fbbf24;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .status-pill--scheduled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .status-pill--upcoming {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text2);
}

/* Grade badges — dark translucent backgrounds */
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--s { background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08)); color: #fbbf24; box-shadow: 0 1px 6px rgba(245, 158, 11, 0.12); }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--a { background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08)); color: #4ade80; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--b { background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.08)); color: #60a5fa; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--c { background: linear-gradient(135deg, rgba(168, 162, 158, 0.15), rgba(168, 162, 158, 0.06)); color: #a8a29e; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--d { background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(249, 115, 22, 0.08)); color: #fb923c; }
:is([data-theme="dark"], :root:not([data-theme="light"])) .grade-badge--f { background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08)); color: #f87171; }

/* Winner callout gradient */
:is([data-theme="dark"], :root:not([data-theme="light"])) .winner-callout {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.12), rgba(180, 83, 9, 0.04));
  border-color: rgba(217, 119, 6, 0.2);
}

/* Success/error messages */
:is([data-theme="dark"], :root:not([data-theme="light"])) .nom-message--success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .nom-message--error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

/* Admin danger zone */
:is([data-theme="dark"], :root:not([data-theme="light"])) .danger-zone {
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Form select dropdown arrow — lighten for dark backgrounds */
:is([data-theme="dark"], :root:not([data-theme="light"])) .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0A0A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* Date/time inputs — native icons adapt to dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) input[type="date"],
:is([data-theme="dark"], :root:not([data-theme="light"])) input[type="datetime-local"],
:is([data-theme="dark"], :root:not([data-theme="light"])) input[type="time"],
:is([data-theme="dark"], :root:not([data-theme="light"])) input[type="month"] {
  color-scheme: dark;
}

/* Form focus ring — slightly brighter */
:is([data-theme="dark"], :root:not([data-theme="light"])) .form-input:focus,
:is([data-theme="dark"], :root:not([data-theme="light"])) .form-textarea:focus,
:is([data-theme="dark"], :root:not([data-theme="light"])) .form-select:focus {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

/* Alert boxes — dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .alert--error {
  background: rgba(185, 28, 28, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .alert--success {
  background: rgba(22, 163, 74, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
}

/* Nom preview focus ring — dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .nom-preview:focus-visible {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

/* Spoiler text — adapt to dark surface */
:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler:not(.is-revealed) {
  background: var(--surface2);
  color: transparent;
}
:is([data-theme="dark"], :root:not([data-theme="light"])) .spoiler.is-revealed {
  background: var(--surface2);
  color: var(--text);
}

/* Admin toolbar — dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .admin-search {
  background: var(--surface2);
  border-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .admin-toolbar__btn {
  background: var(--surface2);
  border-color: var(--border);
}

/* Admin winner — dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .admin-winner {
  background: var(--surface2);
  border-color: var(--border);
}

/* Pipeline panel — dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .pipeline-check--ok .pipeline-check__icon {
  background: rgba(5, 150, 105, 0.2);
  color: #34D399;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .pipeline-check--warn .pipeline-check__icon {
  background: rgba(217, 119, 6, 0.2);
  color: #FBBF24;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .pipeline-link {
  background: var(--surface2);
  border-color: var(--border);
}

/* Admin nav hover state */
:is([data-theme="dark"], :root:not([data-theme="light"])) .admin-nav .nav-links a:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Banner inversion — keep contrast in dark mode */
:is([data-theme="dark"], :root:not([data-theme="light"])) .banner .btn-primary {
  background: var(--text);
  color: var(--bg);
}

/* ---- Toast notifications ---- */
.toast {
  position: fixed;
  bottom: var(--s-4);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
}

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

.toast--success {
  background: #065F46;
  color: #D1FAE5;
}

.toast--error {
  background: #991B1B;
  color: #FEE2E2;
}

/* ==================================================================
   Emoji Reactions
   ================================================================== */

/* ---- Reaction bar (below each review) ---- */
.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border2);
  position: relative;
}

/* ---- Reaction pill (emoji + count) ---- */
.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  font-size: var(--t-sm);
  line-height: 1.4;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.reaction-pill:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}

.reaction-pill.is-active {
  border-color: var(--accent);
  background: rgba(180, 83, 9, 0.08);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.15);
}

.reaction-pill:disabled {
  cursor: default;
  opacity: 0.85;
}

.reaction-pill:disabled:hover {
  border-color: var(--border);
  background: var(--bg);
}

.reaction-pill__emoji {
  font-size: 1rem;
  line-height: 1;
}

.reaction-pill__count {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
}

.reaction-pill.is-active .reaction-pill__count {
  color: var(--accent);
}

/* ---- Add reaction button ---- */
.reaction-add {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  min-height: 32px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--text3);
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

.reaction-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}

/* ---- Emoji picker popover ---- */
.emoji-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 280px;
  max-height: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: picker-in 150ms ease;
}

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

.emoji-picker__search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text);
  background: var(--bg);
  outline: none;
}

.emoji-picker__search::placeholder {
  color: var(--text3);
}

.emoji-picker__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.emoji-picker__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 100ms ease;
}

.emoji-picker__btn:hover {
  background: var(--surface);
}

.emoji-picker__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-3);
  color: var(--text3);
  font-size: var(--t-sm);
}

/* ---- Dark mode overrides ---- */
:is([data-theme="dark"], :root:not([data-theme="light"])) .reaction-pill {
  background: var(--surface);
  border-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reaction-pill:hover {
  background: var(--surface2);
  border-color: rgba(217, 119, 6, 0.5);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reaction-pill.is-active {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.5);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reaction-add {
  border-color: var(--border);
  color: var(--text3);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reaction-add:hover {
  border-color: rgba(217, 119, 6, 0.5);
  color: var(--accent);
  background: var(--surface2);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .emoji-picker {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .emoji-picker__search {
  background: var(--surface);
  border-bottom-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .emoji-picker__btn:hover {
  background: var(--surface2);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reactor-tooltip {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ---- Reactor tooltip (who reacted) ---- */
.reactor-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
  max-width: 320px;
  pointer-events: none;
  animation: tooltip-in 120ms ease;
}

.reactor-tooltip__emoji {
  font-size: 0.875rem;
  flex-shrink: 0;
}

.reactor-tooltip__names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ---- Mobile: smaller picker ---- */
@media (max-width: 600px) {
  .emoji-picker {
    width: 240px;
  }
  .emoji-picker__grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .reactor-tooltip {
    max-width: 260px;
  }
}

/* ==================================================================
   Review Replies
   ================================================================== */

.reply-section {
  margin-top: var(--s-2);
}

/* ---- Reply list ---- */
.reply-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-left: var(--s-3);
  border-left: 2px solid var(--border);
  margin-bottom: var(--s-2);
}

.reply {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.reply--new {
  opacity: 0;
  transform: translateY(8px);
}

.reply__meta {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex-wrap: wrap;
}

.reply__author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

a.reply__author-link:hover .reply__author {
  text-decoration: underline;
}

.reply__author {
  font-size: var(--t-sm);
  font-weight: 600;
}

.reply__date {
  font-size: var(--t-xs);
  color: var(--text3);
}

.reply__edited {
  font-size: var(--t-xs);
  color: var(--text3);
  font-style: italic;
}

.reply__body {
  font-size: var(--t-sm);
  line-height: 1.55;
  margin-top: 2px;
}

.reply__body p {
  margin: 0 0 0.4em;
}

.reply__body p:last-child {
  margin-bottom: 0;
}

.reply__actions {
  display: flex;
  gap: var(--s-2);
  margin-top: 2px;
}

.reply__edit-btn,
.reply__delete-btn {
  all: unset;
  font-size: var(--t-xs);
  color: var(--text3);
  cursor: pointer;
  transition: color 0.15s;
}

.reply__edit-btn:hover {
  color: var(--accent);
}

.reply__delete-btn:hover {
  color: #EF4444;
}

/* ---- Reply trigger button ---- */
.reply-trigger {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--text3);
  cursor: pointer;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-md);
  transition: color 150ms ease, background 150ms ease;
  box-sizing: border-box;
}

.reply-trigger:hover {
  color: var(--accent);
  background: var(--surface2);
}

.reply-trigger svg {
  flex-shrink: 0;
}

/* ---- Reply form ---- */
.reply-form-wrap {
  margin-top: var(--s-1);
}

.reply-form__textarea {
  display: block;
  width: 100%;
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--t-sm);
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.reply-form__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

.reply-form__textarea::placeholder {
  color: var(--text3);
}

.reply-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s-1);
}

.reply-form__char-count {
  font-size: var(--t-xs);
  color: var(--text3);
}

.reply-form__char-count--warn {
  color: #D97706;
}

.reply-form__char-count--over {
  color: #EF4444;
  font-weight: 600;
}

.reply-form__btns {
  display: flex;
  gap: var(--s-1);
}

/* ---- btn--xs size variant ---- */
.btn--xs {
  font-size: var(--t-xs);
  padding: 4px 12px;
  min-height: 28px;
}

/* ---- Dark mode ---- */
:is([data-theme="dark"], :root:not([data-theme="light"])) .reply-list {
  border-left-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reply-form__textarea {
  background: var(--surface);
  border-color: var(--border);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .reply-form__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

/* ==================================================================
   Announcements
   ================================================================== */

/* ---- Home page announcement banners ---- */
.announcements {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-top: var(--s-3);
  margin-bottom: var(--s-3);
}

.announcement {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  font-size: var(--t-sm);
}

.announcement--info {
  background: rgba(59, 130, 246, 0.05);
  border-left-color: #93C5FD;
  color: var(--text2);
}

.announcement--warning {
  background: rgba(245, 158, 11, 0.05);
  border-left-color: #F59E0B;
  color: var(--text2);
}

.announcement--success {
  background: rgba(16, 185, 129, 0.05);
  border-left-color: #34D399;
  color: var(--text2);
}

.announcement__icon {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.6;
}

.announcement__icon svg {
  width: 15px;
  height: 15px;
}

.announcement__content {
  flex: 1;
  min-width: 0;
}

.announcement__title {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  display: block;
}

.announcement__body {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  margin-top: 2px;
  opacity: 0.75;
}

/* ---- Dark mode ---- */
:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement--info {
  background: rgba(59, 130, 246, 0.06);
  border-left-color: rgba(147, 197, 253, 0.5);
  color: var(--text2);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement--warning {
  background: rgba(245, 158, 11, 0.06);
  border-left-color: rgba(245, 158, 11, 0.5);
  color: var(--text2);
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement--success {
  background: rgba(16, 185, 129, 0.06);
  border-left-color: rgba(52, 211, 153, 0.5);
  color: var(--text2);
}

/* ---- Admin announcement list ---- */
.announcement-admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-3);
}

.announcement-admin-item {
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.announcement-admin-item.is-inactive {
  opacity: 0.5;
}

.announcement-admin-item__header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.announcement-admin-item__meta {
  margin-top: var(--s-1);
}

.announcement-admin-item__actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.announcement-type-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.announcement-type-badge--info {
  background: #DBEAFE;
  color: #1E40AF;
}

.announcement-type-badge--warning {
  background: #FEF3C7;
  color: #92400E;
}

.announcement-type-badge--success {
  background: #D1FAE5;
  color: #065F46;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement-type-badge--info {
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement-type-badge--warning {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}

:is([data-theme="dark"], :root:not([data-theme="light"])) .announcement-type-badge--success {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}

/* ==================================================================
   Winner Reveal Animation
   ================================================================== */

.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  overflow: hidden;
}

.winner-overlay__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  z-index: 1;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}
.winner-overlay__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.winner-overlay.is-entering {
  opacity: 1;
  transition: opacity 400ms ease;
}

.winner-overlay.is-dismissing {
  opacity: 0;
  transition: opacity 600ms ease;
}

/* Book cover in overlay */
.winner-overlay__cover {
  width: 300px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 215, 0, 0.3);
  transform: scale(0.7);
  opacity: 0;
}

.winner-overlay.is-entering .winner-overlay__cover {
  transform: scale(1);
  opacity: 1;
  transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 400ms ease;
}

.winner-overlay__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Winner label */
.winner-overlay__label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: #FFD700;
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(255, 215, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
}

.winner-overlay.is-entering .winner-overlay__label {
  transform: translateY(0);
  opacity: 1;
  transition: transform 500ms ease 300ms, opacity 400ms ease 300ms;
}

.winner-overlay__label svg {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Confetti particles */
.winner-confetti {
  position: absolute;
  top: -20px;
  opacity: 0;
  pointer-events: none;
}

.winner-overlay.is-entering .winner-confetti {
  animation: confetti-fall linear forwards;
  animation-delay: inherit;
  animation-duration: inherit;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    top: -20px;
    transform: rotate(0deg) translateX(0);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    top: 110vh;
    transform: rotate(720deg) translateX(calc(var(--drift, 30px)));
  }
}

/* Add some lateral drift variety */
.winner-confetti:nth-child(odd) { --drift: -40px; }
.winner-confetti:nth-child(3n) { --drift: 60px; }
.winner-confetti:nth-child(5n) { --drift: -25px; }
.winner-confetti:nth-child(7n) { --drift: 45px; }

/* Reduced motion: skip animation entirely (JS also checks, this is a CSS fallback) */
@media (prefers-reduced-motion: reduce) {
  .winner-overlay {
    display: none !important;
  }
}

/* Mobile: slightly smaller cover */
@media (max-width: 600px) {
  .winner-overlay__cover {
    width: 200px;
  }
  .winner-overlay__label {
    font-size: 1.2rem;
  }
}

/* Scope the @media dark mode selector for components too */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-pill--scheduled { background: rgba(148, 163, 184, 0.1); }
  :root:not([data-theme="light"]) .status-pill--reading { background: rgba(14, 116, 108, 0.15); }
  :root:not([data-theme="light"]) .status-pill--nominations,
  :root:not([data-theme="light"]) .status-pill--voting { background: rgba(217, 119, 6, 0.15); }
  :root:not([data-theme="light"]) .status-pill--upcoming { background: rgba(255, 255, 255, 0.06); }
}


/* ================================================================
   APP DIALOG — styled replacement for confirm() / alert()
   ================================================================ */

.app-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  max-width: 380px;
  width: calc(100% - var(--s-6));
  max-height: fit-content;
  background: var(--bg);
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 24px 48px rgba(0, 0, 0, 0.08);
  animation: dialog-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-dialog.is-closing {
  animation: dialog-exit 0.12s ease-in forwards;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: backdrop-enter 0.2s ease-out;
}

.app-dialog.is-closing::backdrop {
  animation: backdrop-exit 0.12s ease-in forwards;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes dialog-exit {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.96) translateY(6px); }
}
@keyframes backdrop-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes backdrop-exit {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.app-dialog__content {
  padding: var(--s-4) var(--s-4) var(--s-3);
}

.app-dialog__title {
  margin: 0 0 var(--s-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--t-base);
  line-height: 1.3;
  color: var(--text);
}

.app-dialog__title[hidden] { display: none; }

.app-dialog__message {
  margin: 0 0 var(--s-4);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--text2);
  white-space: pre-line;
}

.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4) var(--s-4);
}

.app-dialog__btn {
  padding: var(--s-2) var(--s-3);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  line-height: 1.4;
}

.app-dialog__btn:active { transform: scale(0.97); }
.app-dialog__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-dialog__btn--cancel {
  background: var(--surface2);
  color: var(--text);
}
.app-dialog__btn--cancel:hover {
  background: var(--border);
}

.app-dialog__btn--confirm {
  background: var(--cta-bg);
  color: var(--cta-text);
}
.app-dialog__btn--confirm:hover {
  opacity: 0.88;
}

/* Danger variant */
.app-dialog--danger .app-dialog__message {
  color: var(--text);
}

.app-dialog__btn--danger {
  background: var(--danger);
  color: #fff;
}
.app-dialog__btn--danger:hover {
  opacity: 0.88;
}

/* ── Dialog dark mode ── */
[data-theme="dark"] .app-dialog {
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .app-dialog__btn--cancel {
  background: var(--surface2);
}
[data-theme="dark"] .app-dialog__btn--cancel:hover {
  background: var(--border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-dialog {
    background: var(--surface);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 8px 24px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }
  :root:not([data-theme="light"]) .app-dialog__btn--cancel {
    background: var(--surface2);
  }
  :root:not([data-theme="light"]) .app-dialog__btn--cancel:hover {
    background: var(--border);
  }
}

