:root {
  color-scheme: dark;

  --background: #09030d;
  --background-soft: #16091c;

  --surface: rgba(29, 13, 40, 0.84);
  --surface-strong: rgba(43, 18, 55, 0.94);

  --ink: #f7f0f5;
  --muted: #bba9bd;
  --dim: #837185;

  /* Primary — purple */
  --accent: #9b4dcc;
  --accent-strong: #742c9d;
  --accent-soft: rgba(155, 77, 204, 0.17);

  /* Secondary — passion red */
  --passion: #d14a55;
  --passion-strong: #ae3342;
  --passion-soft: rgba(209, 74, 85, 0.16);

  /* Tertiary — dusk blue, a quiet cool counterpoint to plum and berry. */
  --dusk: #6e92c4;
  --dusk-soft: rgba(110, 146, 196, 0.14);

  /* A restrained organic note for depth, not a primary interface color. */
  --verdant: #5f9b82;
  --verdant-soft: rgba(95, 155, 130, 0.19);

  /* Warm literary highlight */
  --gold: #c9a66b;
  --gold-soft: rgba(201, 166, 107, 0.13);

  --line: rgba(223, 184, 255, 0.20);
  --line-strong: rgba(223, 184, 255, 0.32);

  --focus: #c99ae5;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-y: scroll;
}

body {
  min-height: 100vh;
  margin: 0;

  background:
    radial-gradient(
      circle at 17% 8%,
      rgba(139, 48, 220, 0.42),
      transparent 35%
    ),
    radial-gradient(
      circle at 84% 20%,
      rgba(133, 54, 178, 0.31),
      transparent 32%
    ),
    radial-gradient(
      circle at 18% 104%,
      rgba(192, 62, 115, 0.31),
      transparent 42%
    ),
    radial-gradient(
      circle at 86% 96%,
      rgba(111, 61, 166, 0.32),
      transparent 43%
    ),
    radial-gradient(
      circle at 82% 62%,
      rgba(110, 146, 196, 0.23),
      transparent 31%
    ),
    radial-gradient(
      circle at 9% 62%,
      rgba(95, 155, 130, 0.25),
      transparent 36%
    ),
    radial-gradient(
      circle at 52% 76%,
      rgba(190, 62, 84, 0.16),
      transparent 36%
    ),
    radial-gradient(
      ellipse at 52% 43%,
      rgba(102, 58, 142, 0.24),
      transparent 47%
    ),
    linear-gradient(
      140deg,
      #08030e 0%,
      #160a20 42%,
      #251033 72%,
      #301333 100%
    );

  background-attachment: fixed;
  color: var(--ink);
}

.backend-wake-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(9, 3, 13, 0.88);
  backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 180ms ease;
}

.backend-wake-overlay.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.backend-wake-dialog {
  width: min(100%, 27rem);
  padding: 2.25rem;
  text-align: center;
  background: linear-gradient(145deg, rgba(43, 18, 55, 0.98), rgba(20, 8, 29, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.45);
}

.backend-wake-mark {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  margin-bottom: 1rem;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--passion));
  border-radius: 50%;
}

.backend-wake-dialog h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.65rem;
}

.backend-wake-dialog p {
  margin: 0.7rem 0 1.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.backend-wake-progress {
  height: 0.45rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
}

.backend-wake-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--passion), var(--gold));
  border-radius: inherit;
  animation: backend-wake-progress 1.35s ease-in-out infinite;
}

@keyframes backend-wake-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";

  /*
  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px
    );
  */

  background-size: 54px 54px;

  mask-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.78),
      transparent 72%
    );
}

/* =========================================================
   TYPE
   ========================================================= */

a {
  color: var(--focus);
  font-weight: 750;
  text-decoration: none;
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

a:hover {
  color: #ffffff;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 26px;
  font-size: 2rem;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  position: relative;
  z-index: 2;

  width: min(1240px, calc(100% - 32px));
  min-height: 96px;

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
  padding: 26px 0;
}

.brand {
  color: var(--ink);

  display: inline-flex;
  align-items: center;

  gap: 12px;
  min-width: max-content;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;

  border-radius: 10px;
  object-fit: contain;
  object-position: center;

  filter:
    drop-shadow(0 0 10px rgba(155, 77, 204, 0.42))
    drop-shadow(0 0 22px rgba(155, 77, 204, 0.14));
}

.brand-wordmark {
  width: 128px;
  height: auto;
  display: block;

  filter:
    drop-shadow(0 0 9px rgba(155, 77, 204, 0.30));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-cta,
.button-link,
.ghost-link,
button {
  min-height: 46px;

  border-radius: 8px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;
}

.nav-cta,
.button-link,
button {
  border: 1px solid rgba(216, 180, 254, 0.34);

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-strong)
    );

  color: #ffffff;

  box-shadow:
    0 14px 32px rgba(116, 44, 157, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.ghost-link {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.nav-cta:hover,
.button-link:hover,
button:hover {
  background:
    linear-gradient(
      135deg,
      #b363d7,
      #8537a8
    );

  color: #ffffff;
  text-decoration: none;

  transform: translateY(-1px);

  box-shadow:
    0 18px 40px rgba(116, 44, 157, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ghost-link:hover {
  border-color: var(--line-strong);
  color: #ffffff;
  text-decoration: none;
}

/* =========================================================
   HOME / LANDING
   ========================================================= */

.home-shell,
.auth-shell {
  position: relative;
  z-index: 1;

  width: min(1240px, calc(100% - 32px));

  margin: 0 auto;
}

.home-shell {
  min-height: calc(100vh - 98px);

  display: grid;
  grid-template-columns:
    minmax(0, 1.05fr)
    minmax(320px, 0.85fr);

  align-items: center;

  gap: 56px;
  padding: 34px 0 70px;
}

.hero {
  max-width: 720px;
}

.hero-copy,
.auth-intro p {
  max-width: 620px;

  color: var(--muted);

  font-size: 1.1rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;

  margin-top: 34px;
}

.eyebrow {
  margin: 0 0 14px;

  color: #c99ae5;

  font-size: 0.77rem;
  font-weight: 850;

  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* A subtle red emotional note */
.hero .eyebrow::before {
  content: "◆";
  margin-right: 8px;

  color: var(--passion);
  font-size: 0.62rem;

  text-shadow:
    0 0 10px rgba(209, 74, 85, 0.55);
}

/* =========================================================
   CONSTELLATION / IMMERSIVE PANEL
   ========================================================= */

.constellation-panel {
  position: relative;

  min-height: 500px;

  border: 1px solid var(--line);
  border-radius: 8px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 72% 22%,
      rgba(155, 77, 204, 0.18),
      transparent 32%
    ),
    radial-gradient(
      circle at 88% 76%,
      var(--dusk-soft),
      transparent 30%
    ),
    radial-gradient(
      circle at 16% 58%,
      var(--verdant-soft),
      transparent 30%
    ),
    radial-gradient(
      circle at 24% 78%,
      rgba(209, 74, 85, 0.08),
      transparent 28%
    ),
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.055),
      rgba(255, 255, 255, 0.012)
    ),
    rgba(10, 4, 18, 0.70);

  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);

  padding: 28px;
}

.constellation-panel::before {
  position: absolute;

  inset: 28px;

  border: 1px solid rgba(216, 180, 254, 0.10);
  border-radius: 50%;

  content: "";
}

.constellation-panel::after {
  position: absolute;

  width: 260px;
  height: 260px;

  right: -100px;
  bottom: -130px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(209, 74, 85, 0.11),
      transparent 68%
    );

  content: "";

  pointer-events: none;
}

.orb {
  position: absolute;

  border-radius: 50%;

  filter: blur(2px);
}

.orb-one {
  width: 180px;
  height: 180px;

  top: 64px;
  right: 52px;

  background:
    radial-gradient(
      circle,
      rgba(155, 77, 204, 0.32),
      rgba(116, 44, 157, 0.10) 60%,
      transparent 72%
    );
}

.orb-two {
  width: 96px;
  height: 96px;

  left: 44px;
  bottom: 72px;

  background:
    radial-gradient(
      circle,
      rgba(216, 180, 254, 0.18),
      transparent 70%
    );
}

.focus-card {
  position: relative;
  z-index: 1;

  width: min(100%, 320px);

  border: 1px solid var(--line);
  border-radius: 8px;

  background:
    linear-gradient(
      135deg,
      rgba(38, 17, 48, 0.70),
      rgba(10, 4, 18, 0.76)
    );

  backdrop-filter: blur(18px);

  padding: 20px;

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.22);
}

.focus-card + .focus-card {
  margin-top: 18px;
}

.focus-card:nth-of-type(3) {
  margin-left: auto;
}

.focus-card span {
  display: block;

  margin-bottom: 8px;

  color: var(--dim);

  font-size: 0.8rem;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-card strong {
  display: block;

  color: var(--ink);

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 1.35rem;
  line-height: 1.25;
}

/* =========================================================
   AUTH
   ========================================================= */

.auth-shell {
  min-height: calc(100vh - 96px);

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(320px, 430px);

  align-items: center;

  gap: 54px;

  padding: 30px 0 68px;
}

.auth-intro {
  max-width: 650px;

  position: relative;
  overflow: hidden;

  padding-top: 18px;
}

.auth-intro > :not(.auth-mark) {
  position: relative;
  z-index: 1;
}

.auth-mark {
  position: absolute;

  width: min(360px, 72vw);

  top: -34px;
  right: 0;

  opacity: 0.14;

  pointer-events: none;

  filter:
    blur(0.2px)
    drop-shadow(0 0 30px rgba(155, 77, 204, 0.42))
    drop-shadow(0 0 48px rgba(209, 74, 85, 0.10));

  transform: translateX(16%);
}

.auth-panel {
  width: 100%;

  border: 1px solid var(--line);
  border-radius: 8px;

  background:
    linear-gradient(
      145deg,
      rgba(34, 15, 45, 0.84),
      rgba(13, 6, 22, 0.82)
    );

  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);

  backdrop-filter: blur(22px);

  padding: 34px;
}

.auth-header h2 {
  margin-bottom: 28px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  color: var(--ink);

  font-size: 0.93rem;
  font-weight: 760;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  min-height: 50px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: rgba(4, 2, 9, 0.72);

  color: var(--ink);

  font: inherit;

  padding: 0 14px;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.auth-form input::placeholder {
  color: #746682;
}

.auth-form input:focus {
  border-color: var(--focus);

  box-shadow:
    0 0 0 4px rgba(155, 77, 204, 0.15),
    0 0 22px rgba(155, 77, 204, 0.08);

  outline: none;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  margin: 6px 0 10px;

  color: var(--muted);

  font-size: 0.92rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);
}

.checkbox-label input {
  width: 16px;
  height: 16px;

  accent-color: var(--accent);
}

button {
  width: 100%;

  border: 0;

  cursor: pointer;

  font: inherit;
  font-weight: 850;
}

.auth-error {
  margin: 4px 0;

  border-left: 3px solid var(--passion);
  border-radius: 4px;

  background: var(--passion-soft);

  color: #f5c4c9;

  font-size: 0.9rem;
  line-height: 1.5;

  padding: 10px 12px;
}

.auth-error.is-hidden {
  display: none;
}

.auth-switch {
  margin: 22px 0 0;

  color: var(--muted);

  text-align: center;
}

/* =========================================================
   APPLICATION HEADER
   ========================================================= */

.home-header {
  gap: 18px;
}

.reader-nav {
  flex: 0 1 auto;
  justify-content: flex-start;
}

.account-nav {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.guest-actions,
.user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-actions.is-hidden,
.guest-actions.is-hidden {
  display: none;
}

.user-greeting {
  color: var(--ink);

  font-weight: 800;

  white-space: nowrap;
}

.account-nav .logout-button {
  width: auto;

  min-height: 42px;

  padding: 0 14px;
}

/* =========================================================
   READER HOME
   ========================================================= */

.reader-home {
  position: relative;
  z-index: 1;

  width: min(1240px, calc(100% - 32px));

  margin: 0 auto;

  padding: 28px 0 72px;
}

.reader-hero {
  position: relative;
  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 8px;

  display: grid;

  grid-template-columns: minmax(0, 1fr);

  gap: 36px;

  align-items: end;

  background:
    radial-gradient(
      circle at 78% 18%,
      rgba(155, 77, 204, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at 22% 88%,
      rgba(209, 74, 85, 0.07),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      rgba(27, 12, 37, 0.90),
      rgba(5, 2, 10, 0.94)
    );

  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.38);

  padding: 42px;
}

.reader-hero > :not(.hero-constellation) {
  position: relative;
  z-index: 1;
}

.hero-constellation {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: clamp(46px, 9vw, 170px);

  width: clamp(190px, 22vw, 320px);
  aspect-ratio: 1;

  transform: translateY(-48%);

  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(155, 77, 204, 0.20), transparent 31%),
    radial-gradient(circle at 66% 72%, var(--verdant-soft), transparent 20%);

  filter: drop-shadow(0 0 34px rgba(155, 77, 204, 0.18));
  pointer-events: none;
}

.hero-constellation::before,
.hero-constellation::after {
  position: absolute;
  inset: 14%;

  border: 1px solid rgba(216, 180, 254, 0.26);
  border-radius: 50%;

  content: "";
}

.hero-constellation::before {
  transform: rotate(45deg) scaleX(1.55);
}

.hero-constellation::after {
  border-color: rgba(95, 155, 130, 0.38);

  transform: rotate(-45deg) scaleX(1.55);
}

.hero-constellation img {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 33%;
  height: auto;

  transform: translate(-50%, -50%);

  filter: drop-shadow(0 0 16px rgba(216, 180, 254, 0.52));
  opacity: 0.9;
}

.hero-constellation-orbit {
  position: absolute;
  inset: 4%;

  border: 1px solid rgba(216, 180, 254, 0.17);
  border-radius: 50%;
}

.hero-constellation-orbit-one {
  transform: rotate(24deg) scaleX(1.32);
}

.hero-constellation-orbit-two {
  inset: 27%;

  border-color: rgba(110, 146, 196, 0.4);

  transform: rotate(-30deg) scaleX(1.6);
}

.hero-constellation-orbit-three {
  inset: 38%;

  border-color: rgba(95, 155, 130, 0.42);

  transform: rotate(68deg) scaleX(1.95);
}

.hero-constellation-star {
  position: absolute;

  width: 7px;
  aspect-ratio: 1;

  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 15px rgba(216, 180, 254, 0.9);
}

.hero-constellation-star-one {
  top: 11%;
  right: 23%;
}

.hero-constellation-star-two {
  bottom: 18%;
  left: 18%;

  width: 5px;

  background: var(--verdant);
  box-shadow: 0 0 13px rgba(95, 155, 130, 0.8);
}

.reader-hero h1 {
  max-width: 760px;

  font-size:
    clamp(
      3.2rem,
      6vw,
      5.8rem
    );
}

/* =========================================================
   SEARCH
   ========================================================= */

.search-form {
  border: 1px solid var(--line);
  border-radius: 8px;

  background: rgba(5, 2, 10, 0.58);

  padding: 18px;
}

.top-search-form {
  flex: 1 1 300px;

  max-width: 430px;
  min-width: 260px;

  padding: 8px;
}

.search-form label {
  display: block;

  margin-bottom: 10px;

  color: var(--focus);

  font-size: 0.82rem;
  font-weight: 850;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-search-form label {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: -1px;

  overflow: hidden;

  clip: rect(0 0 0 0);
}

.search-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 10px;
}

.search-row input {
  min-height: 50px;
  min-width: 0;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: rgba(3, 1, 8, 0.72);

  color: var(--ink);

  font: inherit;

  padding: 0 14px;
}

.top-search-form .search-row input {
  min-height: 42px;
}

.top-search-form .search-row button {
  min-height: 42px;

  padding: 0 14px;
}

.search-row input::placeholder {
  color: #83708f;
}

.search-row input:focus {
  border-color: var(--focus);

  box-shadow:
    0 0 0 4px rgba(155, 77, 204, 0.15);

  outline: none;
}

.search-row button {
  width: auto;
}

/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quick-actions {
  grid-column: 1 / -1;

  display: flex;
  flex-wrap: wrap;

  gap: 12px;
}

.quick-actions a {
  border: 1px solid var(--line);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.035);

  color: var(--ink);

  padding: 10px 16px;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.quick-actions a:hover {
  border-color: rgba(216, 180, 254, 0.48);

  background: var(--accent-soft);

  transform: translateY(-1px);

  text-decoration: none;
}

/* =========================================================
   CONTENT GRID
   ========================================================= */

.home-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.08fr)
    minmax(300px, 0.82fr);

  gap: 28px;

  margin-top: 30px;
}

.featured-novel,
.updates-panel,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;

  background:
    linear-gradient(
      145deg,
      rgba(23, 11, 32, 0.78),
      rgba(9, 4, 16, 0.76)
    );

  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.28);

  backdrop-filter: blur(18px);
}

.featured-novel {
  min-height: 360px;

  display: grid;

  grid-template-columns:
    minmax(170px, 230px)
    minmax(0, 1fr);

  gap: 30px;

  align-items: center;

  overflow: hidden;

  padding: 30px;
}

.featured-copy h2 {
  margin-bottom: 16px;

  font-size:
    clamp(
      2rem,
      4vw,
      3.4rem
    );

  line-height: 1;
}

.featured-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.featured-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 22px;
}

.featured-meta-row .meta-row {
  margin-top: 0;
}

.featured-novel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(82%, 188px);
  min-height: 38px;
  border: 1px solid rgba(110, 146, 196, .60);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(110, 146, 196, .22), rgba(116, 44, 157, .20));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--ink);
  font-size: .78rem;
  padding: 0 11px;
}

.featured-cover-column {
  display: grid;
  gap: 18px;
  justify-items: center;
  width: 100%;
}

.featured-cover-column .featured-cover {
  width: 100%;
}

.featured-novel-link:hover {
  border-color: var(--dusk);
  background: linear-gradient(135deg, rgba(110, 146, 196, .34), rgba(116, 44, 157, .30));
  color: #fff;
}

.under-construction-page {
  width: min(680px, calc(100% - 32px));
  min-height: calc(100vh - 160px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  margin: 0 auto;
  padding: 72px 0;
}

.under-construction-page h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
}

.under-construction-page p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.about-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 90px;
}

.about-heading { max-width: 720px; margin-bottom: 42px; }
.about-heading h1 { margin-bottom: 18px; font-size: clamp(2.8rem, 6vw, 5rem); }
.about-heading > p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.about-articles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.about-articles article { scroll-margin-top: 100px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(38, 19, 52, .76), rgba(12, 6, 22, .86)); padding: 26px; }
.about-articles h2 { margin: 0 0 12px; font-size: 1.65rem; }
.about-articles p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.info-back-link { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 30px; color: var(--dusk); font-size: .85rem; }
.info-articles { display: grid; gap: 18px; max-width: 820px; }
.info-articles article { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(38, 19, 52, .76), rgba(12, 6, 22, .86)); padding: 28px; }
.info-articles h2 { margin: 0 0 14px; font-size: clamp(1.55rem, 3vw, 2rem); }
.info-articles p:last-child { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
.longform-article { max-width: 760px; color: var(--muted); font-size: 1.06rem; line-height: 1.8; }
.longform-article p { margin: 0 0 24px; }
.longform-article .longform-lead { border-left: 2px solid var(--dusk); color: var(--ink); font-size: 1.26rem; line-height: 1.65; padding-left: 20px; }
.longform-article h2 { margin: 42px 0 12px; color: var(--ink); font-size: clamp(1.65rem, 3vw, 2.2rem); }
.info-page .about-heading { max-width: 1040px; margin-right: auto; margin-left: auto; }
.info-page .info-back-link { display: flex; width: min(1040px, 100%); margin-right: auto; margin-left: auto; }
.info-page .longform-article { width: min(1040px, 100%); max-width: none; margin-right: auto; margin-left: auto; }
.team-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 48px; border-top: 1px solid var(--line); padding-top: 28px; }
.team-member { display: flex; align-items: center; gap: 14px; min-width: 0; padding-right: 24px; }
.team-member + .team-member { border-left: 1px solid var(--line); padding-right: 0; padding-left: 24px; }
.team-avatar { width: 58px; height: 58px; flex: 0 0 58px; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(110, 146, 196, .55); border-radius: 50%; background: linear-gradient(145deg, #6b3b73, #273957); color: var(--ink); font: 700 1.2rem Georgia, serif; }
.team-avatar-generic { background: linear-gradient(145deg, #31505f, #203042); }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-member-name { display: flex; align-items: center; gap: 8px; }
.team-member h3 { margin: 0 0 3px; color: var(--ink); font-size: 1rem; }
.team-member p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
@media (max-width: 600px) { .team-members { grid-template-columns: 1fr; gap: 20px; } .team-member, .team-member + .team-member { border-left: 0; padding: 0; } }
@media (max-width: 680px) { .about-page { padding-top: 32px; } .about-articles { grid-template-columns: 1fr; } }

/* Team page: a founder note set like a small newspaper feature. */
.team-page .team-heading {
  margin-bottom: 24px;
}

.team-page .team-members {
  width: min(1040px, 100%);
  margin: 0 auto 58px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 28px;
}

.team-feature {
  border-top: 3px double var(--line-strong);
  color: var(--muted);
  padding-top: 24px;
}

.team-feature-masthead {
  max-width: 760px;
  margin: 0 auto 32px;
  color: var(--ink);
  text-align: center;
}

.team-feature-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.longform-article .team-feature-masthead h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.team-feature-dek {
  max-width: 580px;
  margin: 14px auto 16px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.13rem;
  font-style: italic;
  line-height: 1.55;
}

.team-feature-byline {
  display: flex;
  justify-content: center;
  gap: 9px;
  color: var(--dim);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.team-feature-copy {
  column-count: 2;
  column-gap: 52px;
  column-rule: 1px solid var(--line);
}

.team-feature-copy p,
.team-feature-copy h3 {
  break-inside: avoid;
}

.team-feature-copy p {
  margin: 0 0 1.25rem;
}

.team-feature-copy .team-feature-lead {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.58;
}

.team-feature-copy .team-feature-lead::first-letter {
  float: left;
  margin: .06em .12em 0 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.25em;
  font-weight: 700;
  line-height: .78;
}

.team-feature-copy h3 {
  margin: .35rem 0 .7rem;
  color: var(--ink);
  font-size: 1.38rem;
}

@media (max-width: 720px) {
  .team-page .team-members { margin-bottom: 42px; }
  .team-feature-copy { column-count: 1; column-rule: 0; }
}

/* Axiom-styled founder feature: editorial structure without leaving the site palette. */
.team-page {
  width: min(1120px, calc(100% - 32px));
  padding: 48px 0 84px;
}

.team-page .info-back-link {
  width: 100%;
  margin-bottom: 26px;
}

.team-page .team-heading {
  max-width: none;
  margin-right: auto;
  margin-bottom: 24px;
  margin-left: auto;
  text-align: left;
}

.team-page .team-heading > p:last-of-type {
  max-width: 720px;
  margin: 0 0 18px;
}

.team-page .team-feature-byline {
  justify-content: flex-start;
  color: var(--dim);
}

.team-page .team-members {
  width: 100%;
  margin: 46px auto 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.team-page .team-feature {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  border-top-color: var(--line-strong);
}

.team-page .team-feature-copy {
  column-count: 1;
  column-rule: 0;
}

@media (max-width: 680px) {
  .team-page { width: min(100% - 32px, 1120px); padding-top: 32px; }
}

.meta-row {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 22px;
}

.meta-row span {
  border: 1px solid var(--line);
  border-radius: 999px;

  color: var(--focus);

  font-size: 0.82rem;
  font-weight: 750;

  padding: 7px 10px;
}

.updates-panel {
  padding: 28px;
}

.updates-panel h2 {
  border-bottom: 1px solid var(--line);

  margin-bottom: 6px;

  padding-bottom: 18px;
}

.updates-panel a {
  border-bottom: 1px solid var(--line);

  display: grid;

  gap: 8px;

  padding: 18px 0;
}

.updates-panel strong {
  color: var(--ink);

  font-size: 1.05rem;
}

.updates-panel span {
  color: var(--muted);

  line-height: 1.5;
}

/* =========================================================
   SECTION BLOCKS
   ========================================================= */

.section-block {
  margin-top: 30px;

  padding: 28px;
}

.section-heading {
  border-bottom: 1px solid var(--line);

  display: flex;
  align-items: end;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 22px;

  padding-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.book-row {
  display: grid;

  grid-template-columns:
    repeat(
      5,
      minmax(130px, 1fr)
    );

  gap: 18px;
}

.book-card h3 {
  margin: 14px 0 7px;

  color: var(--ink);

  font-size: 1rem;
  line-height: 1.25;
}

.book-card p {
  margin-bottom: 0;

  color: var(--muted);

  font-size: 0.92rem;
  line-height: 1.45;
}

/* =========================================================
   BOOK COVERS
   ========================================================= */

.book-cover {
  min-height: 230px;

  border: 1px solid rgba(216, 180, 254, 0.24);
  border-radius: 8px;

  display: flex;
  align-items: flex-end;

  overflow: hidden;

  position: relative;

  background:
    linear-gradient(
      145deg,
      #241031,
      #5c2782
    );

  box-shadow:
    inset 0 -70px 80px rgba(0, 0, 0, 0.58),
    0 12px 30px rgba(0, 0, 0, 0.20);

  padding: 16px;
}

.book-cover-image {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;

  display: block;
}

.book-cover::before {
  position: absolute;

  inset: 16px 18px auto auto;

  width: 44px;
  height: 44px;

  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;

  content: "";
}

.book-cover span {
  position: relative;

  color: #ffffff;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 1.2rem;
  font-weight: 800;

  line-height: 1.05;

  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.8);
}

.featured-cover {
  min-height: 300px;

  background:
    radial-gradient(
      circle at 65% 22%,
      rgba(216, 180, 254, 0.34),
      transparent 28%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(209, 74, 85, 0.16),
      transparent 32%
    ),
    linear-gradient(
      160deg,
      #090311,
      #31204e 42%,
      #702b8e
    );
}

.featured-cover span {
  font-size: 1.55rem;
}

/* Purple + red should coexist naturally on covers */
.cover-one {
  background:
    linear-gradient(
      145deg,
      #18070d,
      #711f2b 45%,
      #4c1d70
    );
}

.cover-two {
  background:
    linear-gradient(
      145deg,
      #0d130b,
      #365314 48%,
      #682d83
    );
}

.cover-three {
  background:
    linear-gradient(
      145deg,
      #0c090b,
      #3f303e 45%,
      #5a2575
    );
}

.cover-four {
  background:
    linear-gradient(
      145deg,
      #06111c,
      #263d79 48%,
      #64297e
    );
}

.cover-five {
  background:
    linear-gradient(
      145deg,
      #180819,
      #762f62 44%,
      #6d287d
    );
}

/* =========================================================
   SERIES FINDER / SEARCH RESULTS
   ========================================================= */

.finder-page,
.search-results-page {
  position: relative;
  z-index: 1;

  width: min(1120px, calc(100% - 32px));

  margin: 0 auto;

  padding: 38px 0 80px;
}

.finder-heading,
.search-results-heading {
  max-width: 760px;

  margin-bottom: 34px;
}

.finder-heading h1,
.search-results-heading h1 {
  margin-bottom: 16px;

  font-size:
    clamp(
      3rem,
      7vw,
      5.4rem
    );
}

.finder-heading > p:last-child,
.search-results-heading > p:last-child {
  color: var(--muted);

  font-size: 1.08rem;

  line-height: 1.65;
}

.finder-form {
  border: 1px solid var(--line);
  border-radius: 8px;

  overflow: hidden;

  background:
    linear-gradient(
      145deg,
      rgba(23, 11, 32, 0.76),
      rgba(7, 3, 11, 0.80)
    );

  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.36);
}

.finder-section {
  padding: 30px 34px 34px;
}

.finder-section + .finder-section {
  border-top: 1px solid var(--line);
}

.finder-section-title {
  display: grid;

  grid-template-columns: 42px 1fr;

  gap: 14px;

  margin-bottom: 24px;
}

.finder-section-title > span {
  color: var(--accent);

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 1.2rem;
}

.finder-section-title h2 {
  margin: 0 0 5px;

  font-size: 1.55rem;
}

.finder-section-title p {
  margin: 0;

  color: var(--muted);
}

.finder-fields.two-column {
  display: grid;

  grid-template-columns:
    2fr
    1fr;

  gap: 18px;
}

.finder-fields label,
.range-inputs label {
  color: var(--ink);

  font-size: 0.85rem;
  font-weight: 800;
}

.finder-fields input,
.finder-fields select,
.range-inputs input {
  width: 100%;
  min-height: 48px;

  margin-top: 8px;

  border: 1px solid var(--line);
  border-radius: 6px;

  background: rgba(3, 1, 8, 0.80);

  color: var(--ink);

  font: inherit;

  padding: 0 13px;
}

.finder-fields input:focus,
.finder-fields select:focus,
.range-inputs input:focus {
  border-color: var(--focus);

  outline: 3px solid rgba(155, 77, 204, 0.14);
}

/* =========================================================
   TAGS
   ========================================================= */

.tag-legend {
  display: flex;
  flex-wrap: wrap;

  gap: 18px;

  margin: -4px 0 18px 56px;

  color: var(--dim);

  font-size: 0.8rem;
}

.tag-legend span {
  display: inline-flex;
  align-items: center;

  gap: 6px;
}

.tag-legend i {
  width: 8px;
  height: 8px;

  border-radius: 50%;
}

.include-dot {
  background: #c084fc;
}

.exclude-dot {
  background: var(--passion);
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;

  gap: 9px;

  margin-left: 56px;
}

.tag-choice {
  width: auto;
  min-height: 38px;

  padding: 0 13px;

  border: 1px solid var(--line);
  border-radius: 5px;

  background: rgba(255, 255, 255, 0.035);

  box-shadow: none;

  color: var(--muted);

  font-size: 0.84rem;
}

.tag-choice:hover {
  border-color: var(--focus);

  background: var(--accent-soft);
}

.tag-choice[data-state="include"] {
  border-color: #b66ad7;

  background:
    rgba(155, 77, 204, 0.21);

  color: #ffffff;
}

.tag-choice[data-state="include"]::before {
  content: "+ ";
}

.tag-choice[data-state="exclude"] {
  border-color: var(--passion);

  background:
    var(--passion-soft);

  color: #f5c4c9;

  text-decoration: line-through;
}

.tag-choice[data-state="exclude"]::before {
  content: "− ";
}

/* =========================================================
   PROFILE FILTERS
   ========================================================= */

.profile-filter-grid {
  border: 1px solid var(--line);
  border-radius: 8px;

  display: block;

  overflow: hidden;

  margin-left: 56px;

  background: rgba(255, 255, 255, 0.018);
}

.profile-filter-header,
.profile-filter {
  display: grid;

  grid-template-columns:
    minmax(190px, 1fr)
    minmax(240px, 1.2fr);

  gap: 20px;

  align-items: center;
}

.profile-filter-header {
  background:
    rgba(155, 77, 204, 0.075);

  color: var(--dim);

  font-size: 0.7rem;
  font-weight: 850;

  letter-spacing: 0.08em;

  padding: 10px 14px;

  text-transform: uppercase;
}

.profile-filter-header span:not(:first-child) {
  text-align: center;
}

.profile-filter {
  min-width: 0;

  margin: 0;

  border: 0;
  border-radius: 0;

  background: transparent;

  padding: 10px 14px;
}

.profile-filter + .profile-filter {
  border-top: 1px solid rgba(216, 180, 254, 0.11);
}

.profile-filter-name {
  min-width: 0;
}

.profile-filter-name strong {
  display: block;

  color: var(--ink);

  font-size: 0.9rem;
}

.profile-filter-name span {
  display: block;

  margin-top: 3px;

  color: var(--dim);

  font-size: 0.7rem;
}

.profile-filter-name i {
  color: var(--accent);

  font-style: normal;

  padding: 0 3px;
}

/* =========================================================
   RANGE CONTROLS
   ========================================================= */

.profile-range {
  position: relative;

  min-width: 0;

  height: 44px;
}

.profile-range-values {
  display: flex;

  align-items: center;
  justify-content: space-between;

  color: var(--dim);

  font-size: 0.68rem;
}

.profile-range-values output {
  min-width: 30px;

  color: var(--ink);

  font-weight: 800;

  text-align: center;
}

.profile-range-values span {
  color: var(--dim);
}

.profile-range-track {
  position: absolute;
  z-index: 0;

  left: 8px;
  right: 8px;
  bottom: 8px;

  height: 4px;

  border-radius: 99px;

  background:
    linear-gradient(
      to right,
      rgba(216, 180, 254, 0.13) 0 var(--range-min),
      var(--accent) var(--range-min) var(--range-max),
      rgba(216, 180, 254, 0.13) var(--range-max) 100%
    );
}

.profile-range-input {
  appearance: none;
  -webkit-appearance: none;

  position: absolute;
  z-index: 1;

  left: 0;
  bottom: 0;

  width: 100%;
  height: 20px;

  margin: 0;
  padding: 0;

  border: 0;
  outline: 0;

  background: transparent;

  pointer-events: none;
}

.profile-range-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.profile-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;

  width: 16px;
  height: 16px;

  margin-top: -6px;

  border: 2px solid #f4eaff;
  border-radius: 50%;

  background: var(--accent);

  box-shadow:
    0 0 0 3px rgba(155, 77, 204, 0.16),
    0 0 10px rgba(155, 77, 204, 0.16);

  cursor: grab;

  pointer-events: auto;
}

.profile-range-input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.profile-range-input::-moz-range-thumb {
  width: 13px;
  height: 13px;

  border: 2px solid #f4eaff;
  border-radius: 50%;

  background: var(--accent);

  box-shadow:
    0 0 0 3px rgba(155, 77, 204, 0.16),
    0 0 10px rgba(155, 77, 204, 0.16);

  cursor: grab;

  pointer-events: auto;
}

.profile-range-input:focus-visible::-webkit-slider-thumb {
  outline: 3px solid rgba(216, 180, 254, 0.40);
  outline-offset: 2px;
}

.profile-range-input:focus-visible::-moz-range-thumb {
  outline: 3px solid rgba(216, 180, 254, 0.40);
  outline-offset: 2px;
}

/* =========================================================
   PROFILE TOGGLES
   ========================================================= */

.profile-filter-toggle {
  display: flex;
  align-items: center;

  gap: 11px;

  min-width: 0;

  cursor: pointer;
}

.profile-filter-checkbox {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;

  pointer-events: none;
}

.profile-checkbox-box {
  position: relative;

  flex: 0 0 auto;

  width: 20px;
  height: 20px;

  border: 1px solid rgba(216, 180, 254, 0.35);
  border-radius: 5px;

  background: rgba(3, 1, 8, 0.72);

  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.35);

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.profile-checkbox-box::after {
  position: absolute;

  top: 3px;
  left: 6px;

  width: 5px;
  height: 9px;

  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;

  content: "";

  opacity: 0;

  transform:
    rotate(45deg)
    scale(0.7);

  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.profile-filter-toggle:hover .profile-checkbox-box {
  border-color: rgba(216, 180, 254, 0.68);

  background:
    rgba(155, 77, 204, 0.10);

  transform: translateY(-1px);
}

.profile-filter-checkbox:focus-visible + .profile-checkbox-box {
  border-color: var(--focus);

  box-shadow:
    0 0 0 3px rgba(155, 77, 204, 0.18),
    0 0 18px rgba(155, 77, 204, 0.14);
}

.profile-filter-checkbox:checked + .profile-checkbox-box {
  border-color: #b66ad7;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-strong)
    );

  box-shadow:
    0 0 0 3px rgba(155, 77, 204, 0.12),
    0 0 16px rgba(155, 77, 204, 0.18);
}

.profile-filter-checkbox:checked + .profile-checkbox-box::after {
  opacity: 1;

  transform:
    rotate(45deg)
    scale(1);
}

.profile-filter-label {
  min-width: 0;

  display: block;
}

.profile-filter-label strong {
  display: block;

  color: var(--ink);

  font-size: 0.9rem;
  line-height: 1.25;

  transition: color 0.18s ease;
}

.profile-filter-label small {
  display: block;

  margin-top: 3px;

  color: var(--dim);

  font-size: 0.7rem;
  line-height: 1.3;
}

.profile-filter-label i {
  color: var(--accent);

  font-style: normal;

  padding: 0 3px;
}

.profile-filter.is-enabled {
  background:
    rgba(155, 77, 204, 0.035);
}

.profile-filter.is-enabled .profile-filter-label strong {
  color: #ffffff;
}

.profile-filter:not(.is-enabled) .profile-filter-label strong {
  color: var(--muted);
}

/* =========================================================
   DISABLED RANGES
   ========================================================= */

.profile-range.is-disabled {
  opacity: 0.42;
}

.profile-range.is-disabled .profile-range-track {
  background:
    rgba(216, 180, 254, 0.11);
}

.profile-range.is-disabled .profile-range-values output {
  color: var(--dim);
}

.profile-range.is-disabled .profile-range-input::-webkit-slider-thumb {
  border-color: rgba(216, 180, 254, 0.45);

  background: #4b3a5b;

  box-shadow: none;

  cursor: pointer;
}

.profile-range.is-disabled .profile-range-input::-moz-range-thumb {
  border-color: rgba(216, 180, 254, 0.45);

  background: #4b3a5b;

  box-shadow: none;

  cursor: pointer;
}

/* =========================================================
   TAG COMBOBOX
   ========================================================= */

.tag-mode {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 10px 18px;

  margin: 0 0 18px 56px;

  color: var(--muted);

  font-size: 0.85rem;
}

.tag-mode > span {
  color: var(--ink);

  font-weight: 800;
}

.tag-mode label {
  display: inline-flex;
  align-items: center;

  gap: 7px;

  cursor: pointer;
}

.tag-mode input {
  accent-color: var(--accent);
}

.tag-combobox {
  position: relative;

  max-width: 620px;

  margin-left: 56px;
}

.tag-combobox > label {
  display: block;

  margin-bottom: 8px;

  color: var(--ink);

  font-size: 0.85rem;
  font-weight: 800;
}

.tag-combobox > input {
  width: 100%;
  min-height: 50px;

  border: 1px solid var(--line);
  border-radius: 6px;

  background: rgba(3, 1, 8, 0.80);

  color: var(--ink);

  font: inherit;

  padding: 0 14px;
}

.tag-combobox > input:focus {
  border-color: var(--focus);

  outline: 3px solid rgba(155, 77, 204, 0.14);
}

.tag-suggestions {
  position: absolute;
  z-index: 10;

  top: 100%;
  right: 0;
  left: 0;

  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;

  overflow: hidden;

  background:
    #100718;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.50);
}

.tag-suggestions button {
  width: 100%;
  min-height: 42px;

  border: 0;
  border-radius: 0;

  justify-content: flex-start;

  background: transparent;

  box-shadow: none;

  color: var(--ink);

  padding: 0 14px;

  text-align: left;
}

.tag-suggestions button:hover,
.tag-suggestions button:focus {
  background: var(--accent-soft);

  outline: none;
}

.tag-suggestions p {
  margin: 0;

  color: var(--dim);

  padding: 13px 14px;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;

  gap: 9px;

  margin: 18px 0 0 56px;
}

.selected-tags > p {
  margin: 0;

  color: var(--dim);

  font-size: 0.85rem;
}

.selected-tag {
  border: 1px solid #b66ad7;
  border-radius: 6px;

  display: inline-flex;
  align-items: center;

  overflow: hidden;

  background:
    rgba(155, 77, 204, 0.16);

  color: #ffffff;
}

.selected-tag > span {
  padding: 7px 9px;

  font-size: 0.85rem;
  font-weight: 750;
}

.selected-tag button {
  width: auto;
  min-height: 34px;

  border: 0;
  border-left: 1px solid rgba(216, 180, 254, 0.23);
  border-radius: 0;

  background: transparent;

  box-shadow: none;

  color: inherit;

  padding: 0 8px;

  font-size: 0.72rem;
}

.selected-tag .tag-remove {
  font-size: 1.1rem;
}

.selected-tag[data-state="exclude"] {
  border-color: var(--passion);

  background:
    var(--passion-soft);

  color: #f5c4c9;
}

.tag-help {
  margin: 12px 0 0 56px;

  color: var(--dim);

  font-size: 0.78rem;
}

/* =========================================================
   DISCLOSURES
   ========================================================= */

.profile-disclosures {
  display: grid;

  gap: 9px;

  margin-left: 56px;
}

.profile-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;

  overflow: hidden;

  background:
    rgba(255, 255, 255, 0.018);
}

.profile-disclosure > summary {
  min-height: 62px;

  display: flex;
  align-items: center;

  gap: 18px;

  cursor: pointer;

  list-style: none;

  padding: 10px 16px;
}

.profile-disclosure > summary::-webkit-details-marker {
  display: none;
}

.profile-disclosure > summary::after {
  content: "⌄";

  color: var(--focus);

  font-size: 1.2rem;

  transition:
    transform 0.2s;
}

.profile-disclosure[open] > summary::after {
  transform: rotate(180deg);
}

.profile-disclosure > summary:hover {
  background:
    rgba(155, 77, 204, 0.07);
}

.profile-disclosure > summary > span {
  min-width: 0;

  display: grid;

  gap: 3px;

  margin-right: auto;
}

.profile-disclosure > summary strong {
  color: var(--ink);

  font-size: 0.94rem;
}

.profile-disclosure > summary small {
  color: var(--dim);

  font-size: 0.75rem;
}

.profile-disclosure > summary i {
  border: 1px solid var(--line);
  border-radius: 99px;

  color: var(--muted);

  font-size: 0.68rem;
  font-style: normal;

  padding: 4px 8px;

  white-space: nowrap;
}

.profile-disclosure .profile-filter-grid {
  margin: 0;

  border: 0;
  border-top: 1px solid var(--line);

  border-radius: 0;
}

/* =========================================================
   FINDER ACTIONS
   ========================================================= */

.finder-actions {
  border-top: 1px solid var(--line);

  display: flex;

  justify-content: flex-end;

  gap: 12px;

  background:
    linear-gradient(
      90deg,
      rgba(155, 77, 204, 0.025),
      rgba(209, 74, 85, 0.045)
    );

  padding: 22px 34px;
}

.finder-actions button {
  width: auto;
}

.clear-filters {
  border: 1px solid var(--line);

  background: transparent;

  box-shadow: none;

  color: var(--muted);
}

/* =========================================================
   RESULTS
   ========================================================= */

.results-layout {
  display: grid;

  grid-template-columns:
    220px
    minmax(0, 1fr);

  gap: 28px;

  align-items: start;
}

.active-filters {
  position: sticky;

  top: 18px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: var(--surface);

  padding: 20px;
}

.active-filters strong {
  display: block;

  margin-bottom: 14px;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 1.2rem;
}

.active-filters [data-filter-chips] {
  display: grid;

  gap: 8px;

  margin-bottom: 18px;
}

.active-filters [data-filter-chips] span {
  border-left: 2px solid var(--accent);

  color: var(--muted);

  font-size: 0.82rem;
  line-height: 1.35;

  padding: 5px 0 5px 9px;
}

.series-results {
  display: grid;

  gap: 14px;
}

.series-result {
  border: 1px solid var(--line);
  border-radius: 8px;

  display: grid;

  grid-template-columns:
    92px
    minmax(0, 1fr);

  gap: 16px;

  align-items: start;

  min-height: 164px;

  overflow: hidden;

  background:
    rgba(12, 6, 22, 0.74);

  color: inherit;

  padding: 14px;

  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.series-result:hover {
  border-color:
    rgba(216, 180, 254, 0.48);

  color: inherit;

  transform: translateY(-2px);

  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.20);
}

.result-cover {
  width: 92px;
  height: 136px;

  min-height: 0;

  align-self: start;

  border-radius: 5px;

  display: flex;
  align-items: flex-end;

  overflow: hidden;

  color: #ffffff;

  font-family:
    Georgia,
    serif;

  font-weight: 800;

  line-height: 1.05;

  padding: 9px;

  background:
    linear-gradient(
      145deg,
      #21102e,
      #6f287e
    );

  box-shadow:
    inset 0 -40px 45px rgba(0, 0, 0, 0.45);
}

.result-cover img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.result-title-row {
  display: flex;

  justify-content: space-between;

  gap: 18px;
}

.result-title-row h3 {
  margin: 1px 0 5px;

  color: var(--ink);

  font-family:
    Georgia,
    serif;

  font-size: 1.25rem;

  line-height: 1.2;
}

.result-author {
  margin: 0;

  color: var(--dim);

  font-size: 0.85rem;
}

.result-status {
  align-self: start;

  border: 1px solid var(--line);
  border-radius: 99px;

  color: var(--focus);

  font-size: 0.72rem;

  padding: 5px 9px;

  text-transform: capitalize;
}

.result-synopsis {
  display: -webkit-box;

  overflow: hidden;

  margin: 12px 0;

  color: var(--muted);

  font-size: 0.9rem;

  line-height: 1.45;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;

  gap: 5px;
}

.result-tags span {
  border: 1px solid var(--line);
  border-radius: 4px;

  color: var(--focus);

  font-size: 0.68rem;

  padding: 3px 6px;
}

.result-tags .more-tags {
  border-style: dashed;

  color: var(--muted);
}

.search-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;

  color: var(--muted);

  padding: 28px;
}

/* =========================================================
   COMPACT APPLICATION HEADER
   ========================================================= */

.site-header.home-header {
  position: relative;
  width: 100%;

  min-height: 76px;

  margin: 0;

  border-bottom: 1px solid rgba(177, 139, 220, 0.30);

  background:
    linear-gradient(100deg, rgba(16, 7, 27, 0.96), rgba(9, 4, 17, 0.90) 48%, rgba(17, 8, 27, 0.95));

  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.025);

  padding:
    12px
    max(24px, calc((100% - 1240px) / 2));
}

.home-header .brand {
  gap: 9px;
}

.home-header .brand-logo {
  width: 40px;
  height: 40px;

  border-radius: 9px;
}

.home-header .brand-wordmark {
  width: 112px;

  filter: drop-shadow(0 0 10px rgba(201, 154, 229, 0.16));
}

.home-header .reader-nav {
  gap: 4px;
}

.home-header .reader-nav a {
  min-height: 42px;

  border-radius: 7px;

  display: inline-flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);

  padding: 0 12px;

  white-space: nowrap;
}

.home-header .reader-nav a::before {
  color: var(--focus);

  font-size: 0.9rem;
}

.home-header .reader-nav a[href*="finder"]::before {
  content: "◇";
}

.home-header .reader-nav a[href*="readers"]::before {
  content: "♧";
}

.home-header .reader-nav a[href*="popular"]::before {
  content: "▤";
}

.account-special-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 22px;
  border: 1px solid rgba(201, 166, 107, 0.52);
  border-radius: 999px;
  background: rgba(201, 166, 107, 0.12);
  color: #e7c785;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  padding: 0 8px;
}

/* Keep role badges out of the layout unless the API explicitly enables them. */
.account-special-badge[hidden] {
  display: none;
}

.home-header .reader-nav a:hover,
.home-header .reader-nav a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(155, 77, 204, 0.25), rgba(110, 146, 196, 0.13));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  color: #ffffff;
}


.home-header .top-search-form {
  flex: 0 1 400px;

  min-width: 300px;

  margin-left: auto;

  border: 0;
  border-radius: 24px;

  background: transparent;

  padding: 0;
}

.home-header .top-search-form .search-row {
  grid-template-columns:
    minmax(0, 1fr)
    42px;

  gap: 0;

  border: 1px solid var(--line);
  border-radius: 23px;

  overflow: hidden;

  background:
    rgba(3, 1, 8, 0.72);
}

.home-header .top-search-form .search-row input {
  min-height: 42px;

  border: 0;
  border-radius: 0;

  background: transparent;

  padding-left: 16px;
}

.home-header .top-search-form .search-row input:focus {
  box-shadow: none;
}

.home-header
  .top-search-form
  .search-row:focus-within {
  border-color: var(--focus);

  box-shadow:
    0 0 0 3px rgba(155, 77, 204, 0.13);
}

.home-header .top-search-form .search-row button {
  position: relative;

  width: 42px;
  min-height: 42px;

  border: 0;
  border-radius: 50%;

  overflow: hidden;

  background: transparent;

  box-shadow: none;

  color: transparent;

  padding: 0;
}

.home-header
  .top-search-form
  .search-row
  button::before {
  position: absolute;

  top: 12px;
  left: 12px;

  width: 12px;
  height: 12px;

  border: 2px solid var(--focus);
  border-radius: 50%;

  content: "";
}

.home-header
  .top-search-form
  .search-row
  button::after {
  position: absolute;

  top: 25px;
  left: 25px;

  width: 8px;
  height: 2px;

  border-radius: 2px;

  background: var(--focus);

  content: "";

  transform: rotate(45deg);

  transform-origin: left center;
}

.home-header
  .top-search-form
  .search-row
  button:hover {
  background: var(--accent-soft);
}

.home-header .account-nav {
  min-width: max-content;
}

.home-header .guest-actions,
.home-header .user-actions {
  gap: 8px;
}

.home-header .guest-actions > a:first-child {
  padding: 10px 12px;
}

.home-header .nav-cta {
  min-height: 42px;

  border-radius: 22px;

  padding: 0 17px;
}

.home-header .my-lists-link {
  min-height: 42px;

  display: inline-flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);

  padding: 0 10px;

  white-space: nowrap;
}

.home-header .my-lists-icon {
  width: 21px;
  height: 21px;

  flex: 0 0 auto;

  overflow: visible;

  fill: rgba(155, 77, 204, 0.14);

  stroke: var(--focus);

  stroke-width: 1.45;

  stroke-linecap: round;
  stroke-linejoin: round;

  filter:
    drop-shadow(0 0 5px rgba(155, 77, 204, 0.30));

  transition:
    filter 0.18s ease,
    transform 0.18s ease;
}

.home-header
  .my-lists-icon
  .book-detail {
  fill: none;

  stroke: rgba(244, 234, 255, 0.82);

  stroke-width: 1.15;
}

.home-header
  .my-lists-link:hover
  .my-lists-icon {
  filter:
    drop-shadow(0 0 8px rgba(192, 132, 252, 0.55));

  transform: translateY(-1px);
}

.home-header .my-lists-link:hover {
  color: #ffffff;
}

/* Inbox is added to signed-in headers by script.js, including the Admin hub.
   These belong in the shared header stylesheet rather than a page stylesheet
   so the icon and label keep the same alignment everywhere. */
.home-header .inbox-link {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 0 10px;
  white-space: nowrap;
}

.inbox-icon-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.home-header .inbox-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  overflow: visible;
  fill: rgba(155, 77, 204, 0.14);
  stroke: var(--focus);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(155, 77, 204, 0.30));
  transition: filter 0.18s ease, transform 0.18s ease;
}

.home-header .inbox-link:hover .inbox-icon {
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.55));
  transform: translateY(-1px);
}

.home-header .inbox-link:hover {
  color: #ffffff;
}

.inbox-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--passion);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 4px;
  box-shadow: 0 0 0 2px rgba(7, 3, 13, 0.86);
}

.inbox-badge.is-hidden {
  display: none;
}

/* =========================================================
   ACCOUNT MENU
   ========================================================= */

.account-menu {
  position: relative;
}

.account-trigger {
  width: 40px;
  height: 40px;

  border: 1px solid rgba(216, 180, 254, 0.34);
  border-radius: 50%;

  display: grid;
  place-items: center;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-strong)
    );

  color: #ffffff;

  cursor: pointer;

  font-weight: 850;

  list-style: none;

  box-shadow:
    0 10px 24px rgba(116, 44, 157, 0.22);
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.account-popover {
  position: absolute;
  z-index: 20;

  top: calc(100% + 10px);
  right: 0;

  width: 240px;

  border: 1px solid var(--line);
  border-radius: 8px;

  display: grid;

  gap: 12px;

  background:
    #100718;

  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.50);

  padding: 16px;
}

.account-popover .user-greeting {
  overflow: hidden;

  color: var(--muted);

  font-size: 0.82rem;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.account-popover-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.account-popover-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Slightly zoomed in, per the request, rather than showing the whole
     circular avatar at its normal crop. */
  transform: scale(1.18);
}

.account-popover .account-popover-username {
  overflow: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-link {
  display: block;

  color: var(--muted);

  font-size: 0.85rem;

  padding: 8px 2px;

  border-bottom: 1px solid var(--line);
}

.account-popover-link:hover {
  color: #ffffff;

  text-decoration: none;
}

.home-header
  .account-popover
  .logout-button {
  width: 100%;

  min-height: 40px;
}

/* =========================================================
   CONTENT RAIL ALIGNMENT
   ========================================================= */

.finder-fields.two-column {
  width: calc(100% - 56px);

  margin-left: 56px;
}

.active-filters[hidden]
  + .series-results {
  grid-column: 1 / -1;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
  .site-header.home-header {
    flex-wrap: wrap;
  }

  .home-header .top-search-form {
    order: 3;

    flex-basis: 100%;

    max-width: none;
  }

  .home-header .reader-nav {
    margin-right: auto;
  }
}

@media (max-width: 880px) {
  .hero-constellation {
    display: none;
  }

  .home-shell,
  .auth-shell {
    grid-template-columns: 1fr;

    gap: 32px;

    align-items: start;

    padding-top: 20px;
  }

  h1 {
    font-size:
      clamp(
        2.8rem,
        13vw,
        4.7rem
      );
  }

  .constellation-panel {
    min-height: 380px;
  }

  .home-header,
  .reader-nav {
    align-items: flex-start;
  }

  .home-header {
    flex-wrap: wrap;
  }

  .reader-nav {
    order: 3;

    width: auto;

    justify-content: flex-start;

    overflow-x: auto;

    padding-bottom: 4px;
  }

  .top-search-form {
    order: 2;

    max-width: none;

    min-width: min(100%, 360px);
  }

  .account-nav {
    order: 1;
  }

  .reader-hero,
  .home-grid,
  .featured-novel {
    grid-template-columns: 1fr;
  }

  .book-row {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .profile-filter-grid {
    grid-template-columns: 1fr;
  }

  .results-layout {
    grid-template-columns: 1fr;
  }

  .active-filters {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-header.home-header {
    align-items: center;

    flex-direction: row;

    gap: 8px;

    padding: 12px 16px;
  }

  .home-header .brand-wordmark {
    width: 98px;
  }

  .home-header .reader-nav {
    order: 3;

    width: 100%;

    overflow-x: auto;
  }

  .home-header .top-search-form {
    order: 4;

    width: 100%;

    min-width: 100%;
  }

  .home-header .account-nav {
    margin-left: auto;

    width: auto;
  }

  .home-header .my-lists-link {
    font-size: 0;
  }

  .home-header .inbox-link {
    font-size: 0;
    padding: 0 8px;
  }

  .home-header :is(.my-lists-icon, .inbox-icon) {
    width: 21px;
    height: 21px;
  }

  .profile-filter-grid {
    margin-left: 0;
  }

  .profile-filter-header {
    display: none;
  }

  .profile-filter {
    grid-template-columns:
      minmax(125px, 0.8fr)
      minmax(170px, 1.2fr);

    gap: 12px;

    padding: 10px;
  }

  .profile-disclosures {
    margin-left: 0;
  }

  .profile-disclosure > summary {
    min-height: 58px;

    padding: 9px 12px;
  }

  .profile-disclosure > summary i {
    display: none;
  }

  .tag-mode,
  .tag-combobox,
  .selected-tags,
  .tag-help {
    margin-left: 0;
  }

  .finder-fields.two-column {
    width: 100%;

    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;

    flex-direction: column;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-wordmark {
    width: 118px;
  }

  .nav-links {
    width: 100%;

    justify-content: space-between;
  }

  .guest-actions,
  .user-actions {
    width: 100%;

    justify-content: space-between;
  }

  .home-header {
    gap: 14px;
  }

  .reader-nav,
  .account-nav,
  .top-search-form {
    order: initial;

    width: 100%;
  }

  .reader-nav {
    justify-content: flex-start;
  }

  .auth-panel {
    padding: 26px;
  }

  .form-row {
    align-items: flex-start;

    flex-direction: column;

    gap: 10px;
  }

  .hero-actions,
  .button-link,
  .ghost-link {
    width: 100%;
  }

  .reader-home {
    padding-top: 10px;
  }

  .reader-hero,
  .featured-novel,
  .updates-panel,
  .section-block {
    padding: 22px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    width: 100%;
  }

  .book-row {
    grid-template-columns: 1fr;
  }

  .book-cover {
    min-height: 260px;
  }

  .finder-section {
    padding: 24px 20px;
  }

  .finder-fields.two-column {
    grid-template-columns: 1fr;
  }

  .tag-legend,
  .tag-picker,
  .profile-filter-grid {
    margin-left: 0;
  }

  .finder-actions {
    align-items: stretch;

    flex-direction: column;

    padding: 20px;
  }

  .finder-actions button {
    width: 100%;
  }

  .series-result {
    grid-template-columns:
      70px
      minmax(0, 1fr);

    min-height: 126px;
  }

  .result-cover {
    width: 70px;
    height: 104px;
  }

  .result-title-row {
    display: block;
  }

  .result-status {
    display: inline-block;

    margin-top: 9px;
  }

  .result-synopsis {
    margin: 9px 0;

    -webkit-line-clamp: 2;
  }
}

@media (max-width: 430px) {
  .profile-filter {
    grid-template-columns: 1fr;

    gap: 7px;
  }
}

.finder-fields.three-column {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr);
  align-items: end;
  gap: 18px;
  width: calc(100% - 56px);
  margin-left: 56px;
}

.finder-fields.three-column > label,
.finder-rating-field { min-width: 0; }

.finder-rating-field {
  grid-column: 1 / -1;
  display: block;
  min-height: 34px;
}

.finder-field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 800;
}

.finder-star-filter {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 34px;
}

.finder-stars { display: flex; flex: 0 0 auto; outline: none; touch-action: none; user-select: none; }
.finder-stars:focus-visible { border-radius: 4px; outline: 3px solid rgba(155, 77, 204, .28); outline-offset: 3px; }
.finder-stars button { width: 27px; min-height: 30px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.finder-stars button span { display: block; color: #5c5660; font-size: 1.45rem; line-height: 1; transition: transform .14s ease; }
.finder-stars button[data-fill="full"] span { color: #f2b84b; }
.finder-stars button[data-fill="half"] span { color: transparent; background: linear-gradient(90deg, #f2b84b 50%, #5c5660 50%); background-clip: text; -webkit-background-clip: text; }
.finder-stars button:hover span { transform: translateY(-1px); }

.finder-rating-copy { display: flex; align-items: center; gap: 9px; min-width: 72px; }
.finder-rating-copy output { color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.finder-rating-copy output.is-preview { color: var(--ink); }
.finder-rating-clear { min-height: auto; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: .68rem; cursor: pointer; }
.finder-rating-clear[hidden] { display: none; }

.result-rating {
  min-height: 20px;
  margin-top: 7px;
  color: #d6a94c;
  font-size: .82rem;
  font-weight: 700;
}

.result-stats {
  margin-top: 4px;
  color: var(--dim);
  font-size: .78rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .finder-fields.three-column { grid-template-columns: 1fr; width: 100%; margin-left: 0; }
}

/* Paired tag searches keep selections under their respective field. */
.finder-tag-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-left: 56px;
}
.finder-tag-fields > div { min-width: 0; }
.finder-tag-fields .tag-combobox { max-width: none; margin-left: 0; }
.finder-tag-fields .selected-tags { margin: 12px 0 0; }
.finder-tag-fields .selected-tags:empty { display: none; }
.finder-tag-fields .selected-tag { max-width: 100%; }
.finder-tag-fields .selected-tag > span { overflow-wrap: anywhere; min-width: 0; }
.finder-tag-fields .tag-remove { flex-shrink: 0; }
@media (max-width: 700px) {
  .finder-tag-fields { grid-template-columns: 1fr; gap: 20px; margin-left: 0; }
}

/* Three-state genre checklist in the series finder. */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; }
.genre-choice { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; user-select: none; }
.genre-choice:hover { background: var(--gold-soft); }
.genre-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.genre-check { display: grid; place-items: center; flex: 0 0 19px; height: 19px; border: 1px solid var(--line-strong); border-radius: 4px; font-weight: 700; }
.genre-choice[data-state="include"] { color: var(--ink); }
.genre-choice[data-state="include"] .genre-check { background: var(--gold); border-color: var(--gold); color: var(--bg, #100a17); }
.genre-choice[data-state="exclude"] { color: #f2c7ce; }
.genre-choice[data-state="exclude"] .genre-check { background: #702b39; border-color: #c87586; color: #fff; }
.country-combobox, .consistent-select { position: relative; }
.country-combobox::after, .consistent-select::after {
  content: "\25BE";
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--muted);
  pointer-events: none;
}
.country-combobox #country-search { padding-right: 36px; }
.country-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(3, 1, 8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.country-options [role="option"], .country-options p { padding: 12px 13px; margin: 0; }
.country-options [role="option"] { cursor: pointer; }
.country-options [role="option"]:hover,
.country-options [aria-selected="true"] { background: rgba(168, 85, 247, 0.2); }
#country-help { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
