:root {
  --bg: #0a080c;
  --bg-2: #100c12;
  --panel: #161118f2;
  --ink: #f3eaf5;
  --muted: #9a879e;
  --ember: #b894c4;
  --gold: #cbb6d2;
  --star: #e8c878;
  --star-empty: #4a3f58;
  --line: #2a2230;
  --field: #0d0a10;
  --chrome: #0a080cee;
  --wash: #0e0b10;
  --tabbar: #0a080c;
  --hover: #1c1620;
  --mal: #3d6ad6;
  --anilist: #1aa5b8;
  --rose: #d4a0b8;
  --rose-line: #4a3340;
  --rose-wash: #1a1218;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Outfit, sans-serif;
  -webkit-tap-highlight-color: transparent;
  color-scheme: dark;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 8% -10%, rgba(129, 140, 248, 0.07), transparent 44%),
    radial-gradient(ellipse at 94% 8%, rgba(180, 140, 176, 0.06), transparent 40%),
    radial-gradient(ellipse at 80% 100%, rgba(140, 70, 130, 0.08), transparent 48%);
  box-shadow: inset 0 0 140px 48px rgba(0, 0, 0, 0.38);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

body.theme-dark {
  --bg: #0a080c;
  --bg-2: #100c12;
  --panel: #161118f2;
  --ink: #f3eaf5;
  --muted: #9a879e;
  --ember: #b894c4;
  --gold: #cbb6d2;
  --star: #e8c878;
  --star-empty: #4a3f58;
  --line: #2a2230;
  --field: #0d0a10;
  --chrome: #0a080cee;
  --wash: #0e0b10;
  --tabbar: #0a080c;
  --hover: #1c1620;
  --rose: #d4a0b8;
  --rose-line: #4a3340;
  --rose-wash: #1a1218;
  color-scheme: dark;
  background:
    linear-gradient(155deg, #0c0910 0%, #0e0a11 34%, #120c14 64%, #0a080c 100%);
}

body.theme-light {
  --bg: #edd8ee;
  --bg-2: #f6e4ee;
  --panel: #fff8fb;
  --ink: #2a1536;
  --muted: #53405f;
  --ember: #8b5aa7;
  --gold: #6b3d8f;
  --star: #c9a24a;
  --star-empty: #c5b3cc;
  --line: #d2bcd8;
  --field: #fffafd;
  --chrome: #f0e4f4f5;
  --wash: #f3e4ef;
  --tabbar: #eedceef0;
  --hover: #edd4ea;
  --rose: #a24d6e;
  --rose-line: #e0b4c4;
  --rose-wash: #f8e4ec;
  color-scheme: light;
  background:
    linear-gradient(180deg, #e4cff2 0%, #ecd6ee 38%, #f3dce8 70%, #f8e6ee 100%);
}

body.theme-light .avatar {
  background: #efe6dc;
  color: #5b2d78;
  box-shadow: inset 0 0 0 2px #8b5aa7;
}

body.theme-light .atmosphere {
  background:
    linear-gradient(180deg, rgba(168, 140, 220, 0.22) 0%, rgba(216, 168, 204, 0.10) 46%, rgba(244, 186, 208, 0.20) 100%);
  box-shadow: none;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-size: 180px 180px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.theme-light .atmosphere::after {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

.shell { position: relative; z-index: 1; min-height: 100vh; display: block; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  padding: 34px 24px;
  background: var(--chrome);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: Outfit, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #c084c8, #8b5aa7);
  font-family: Outfit, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.main-nav { margin-top: 64px; display: grid; gap: 6px; }
.main-nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.main-nav a.active,
.main-nav a:hover {
  background: var(--hover);
  color: var(--gold);
}

.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.profile-button {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.profile-button > span:last-child { margin-left: auto; color: var(--muted); }
.profile-button strong,
.profile-button small { display: block; font-size: 12px; }
.profile-button small { margin-top: 2px; color: var(--muted); }

main { width: 100%; overflow: hidden; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.topbar {
  height: 64px;
  padding: 10px 7.5%;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--chrome);
  backdrop-filter: blur(14px);
}
.topbar .brand { flex: none; }
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex: none;
  min-width: 0;
}
.account-chip small { display: none; }
.account-chip strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
}

.search {
  margin-right: auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--gold);
  cursor: pointer;
}
.search-icon {
  display: flex;
  flex: none;
}
.search-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search input {
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 16px Outfit, sans-serif;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.search:focus-within {
  flex: 1 1 auto;
  width: auto;
  max-width: 390px;
  min-width: 140px;
  height: 42px;
  padding: 0 14px;
  justify-content: flex-start;
  gap: 10px;
  overflow: visible;
  background: var(--field);
  border-color: var(--line);
  color: var(--muted);
  cursor: text;
}
.search:focus-within input {
  width: 100%;
  max-width: none;
  opacity: 1;
  pointer-events: auto;
}
.search[hidden] { display: none; }
.topbar:has(.search[hidden]) .notify-wrap:not([hidden]) { margin-left: auto; }
.topbar:has(.search[hidden]) .notify-wrap[hidden] ~ .account-chip { margin-left: auto; }

.icon-button,
.mobile-menu {
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--gold);
  cursor: pointer;
  position: relative;
}
.icon-button i {
  width: 6px;
  height: 6px;
  background: var(--ember);
  border-radius: 50%;
  position: absolute;
  right: 1px;
  top: 2px;
}
.icon-button svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notify-wrap { flex: none; }
.notify-wrap[hidden] { display: none; }
.notify-button { padding: 6px; }
.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 7.5%;
  left: auto;
  width: min(360px, calc(100% - 15%));
  max-height: min(420px, 70vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 40px #0006;
  z-index: 12;
}
.notify-panel[hidden] { display: none; }
.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
  position: sticky;
  top: 0;
  background: var(--panel);
}
.notify-head p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.notify-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}
.notify-item.is-unread { background: color-mix(in srgb, var(--ember) 10%, transparent); }
.notify-item strong,
.notify-item small {
  display: block;
}
.notify-item strong { font-size: 13px; line-height: 1.35; }
.notify-item small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.notify-empty { margin: 0; padding: 18px 14px 20px; color: var(--muted); font-size: 13px; }
.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 16px 40px #0005;
}
.install-banner[hidden] { display: none; }
.install-banner strong { display: block; font-size: 14px; }
.install-banner p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.install-banner .button { flex: none; }
.install-banner .text-button { flex: none; }
.mobile-menu { display: none; }

.search-results {
  position: fixed;
  z-index: 10;
  top: 66px;
  left: 7.5%;
  width: min(430px, calc(100vw - 40px));
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  box-shadow: 0 20px 50px #0008;
}
.search-results:empty { display: none; }
#search-results .friend-row { padding: 11px 13px; }
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.search-result:last-child { border-bottom: 0; }
.result-cover {
  width: 34px;
  height: auto;
  aspect-ratio: 2 / 3;
  flex: none;
  border-radius: 4px;
  background: #2a2220;
  background-size: cover;
  background-position: center top;
}
.search-result div { min-width: 0; flex: 1; }
.search-result strong,
.search-result small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result strong { font-size: 12px; }
.search-result small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.search-heading {
  margin: 0;
  padding: 10px 13px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
a.search-result { color: inherit; text-decoration: none; }
.result-portrait {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: #2a2220 center/cover no-repeat;
}
.creator-search { max-width: 360px; margin: 0 0 28px; }
.search-result .shelf-tag { margin-top: 5px; }
.rail-card .title-tags { margin-top: 2px; }
.search-result button {
  border: 0;
  border-radius: 6px;
  padding: 7px 9px;
  background: var(--gold);
  color: #fff;
  font: 700 10px Outfit, sans-serif;
  cursor: pointer;
}
.search-note { padding: 14px; color: var(--muted); font-size: 12px; }
.search-note strong { color: var(--ink); }
.search-note a { color: var(--gold); }
.search-request {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.search-request[hidden] { display: none; }
.search-request p { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.45; white-space: normal; word-spacing: normal; }
.search-request p strong { color: var(--ink); }
.search-request form { display: grid; gap: 8px; }
.search-request label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.search-request label span { display: block; white-space: normal; }
.search-request input,
.search-request textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
  font: 14px Outfit, sans-serif;
}
.search-request textarea { resize: vertical; min-height: 52px; }
.search-request .button { justify-self: start; }
.search-request-toggle {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 11px 13px;
  color: var(--ember);
  font: 600 12px Outfit, sans-serif;
  text-align: left;
  cursor: pointer;
}

.toast {
  position: relative;
  z-index: 20;
  margin: 0 7.5% 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--gold);
  font-size: 13px;
}
.toast a { color: #ddd6fe; }
.toast[hidden] { display: none; }

.hero {
  min-height: 460px;
  padding: 78px 7.5% 88px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(129, 140, 248, 0.08), transparent 58%),
    linear-gradient(120deg, transparent 24%, rgba(140, 70, 130, 0.08) 100%);
}
body.theme-light .hero {
  background:
    linear-gradient(180deg, rgba(168, 140, 220, 0.16), rgba(244, 186, 208, 0.10) 100%);
}
body.theme-light .hero h1 em {
  color: #6b3d8f;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}
.hero h1,
.section h2 {
  margin: 0;
  font-family: Outfit, sans-serif;
  letter-spacing: 0;
  word-spacing: 0.04em;
}
.hero h1 {
  font-size: 56px;
  line-height: 1.08;
  font-weight: 700;
  position: relative;
  z-index: 1;
  max-width: 11ch;
}
.hero h1 em {
  font-weight: 700;
  font-style: normal;
  color: #e9d5ff;
}
.hero-copy {
  max-width: 430px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.hero-actions { display: flex; gap: 12px; position: relative; z-index: 1; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  border-radius: 999px;
  padding: 13px 18px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.primary {
  border: 0;
  background: linear-gradient(180deg, #c084c8, #8b5aa7);
  color: #fff;
  cursor: pointer;
}
body.theme-light .primary {
  background: linear-gradient(180deg, #b07ec8, #8b5aa7);
  color: #fff;
}
.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero-art {
  position: absolute;
  right: 6%;
  bottom: 36px;
  width: 420px;
  height: 340px;
}
.hero-covers {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-covers img {
  position: absolute;
  bottom: 0;
  width: 132px;
  height: 198px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 18px 40px #0008;
  border: 1px solid #3b2d66;
}
.hero-covers img:nth-child(1) { right: 210px; transform: rotate(-14deg); z-index: 1; }
.hero-covers img:nth-child(2) { right: 140px; transform: rotate(-6deg); z-index: 2; }
.hero-covers img:nth-child(3) { right: 72px; transform: rotate(3deg); z-index: 4; }
.hero-covers img:nth-child(4) { right: 8px; transform: rotate(11deg); z-index: 3; }
.hero-covers img:nth-child(5) { right: 176px; bottom: 18px; transform: rotate(-2deg); z-index: 5; width: 118px; height: 176px; }

.section { padding: 64px 7.5%; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
}
.section h2 { font-size: 38px; font-weight: 500; }
.section-heading > a,
.text-button {
  border: 0;
  background: transparent;
  color: var(--gold);
  text-decoration: none;
  font: 600 13px Outfit, sans-serif;
  cursor: pointer;
}

.continue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.library-shelf { margin-top: 28px; }
.library-shelf:first-child { margin-top: 0; }
.shelf-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: inherit;
  text-decoration: none;
}
.shelf-heading span:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.shelf-heading h3 { margin: 0; font: 600 18px Outfit, sans-serif; }
.shelf-heading small { color: var(--muted); font-size: 13px; }
.shelf-open { color: var(--gold); font: 600 13px Outfit, sans-serif; flex: none; }
.shelf-heading:hover .shelf-open { text-decoration: underline; }
.shelf-more { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.shelf-page { padding: 48px 7.5% 80px; }
.shelf-page h1 { margin: 0; font-size: 40px; font-weight: 700; }
.shelf-count { margin: 8px 0 28px; color: var(--muted); font-size: 15px; }
.shelf-toolbar { margin: -10px 0 22px; }
.shelf-toolbar .filter-label { margin-bottom: 8px; }
.shelf-toolbar .filters { padding-bottom: 0; }
.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.browse-toolbar .filters { margin: 0; }
.browse-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}
.browse-filters .filter-wrap + .filter-wrap {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.browse-sort {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font: 700 10px Outfit, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.browse-sort select {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 12px;
  font: 600 13px Outfit, sans-serif;
}
.continue-grid.shelf-full-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: visible;
  margin: 0;
  padding: 0;
}
.continue-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.continue-card .cover {
  width: 72px;
  align-self: start;
}
.continue-card:hover,
.title-card:hover {
  transform: translateY(-3px);
  border-color: #6d28d9;
}

.lists-block { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
#library.physical-first { display: flex; flex-direction: column; }
#library.physical-first .lists-block { order: -1; margin-top: 0; margin-bottom: 28px; padding-top: 0; border-top: 0; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.reading-list.is-physical { border-color: color-mix(in srgb, var(--ember) 35%, var(--line)); }
.lists-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.lists-heading h3 { margin: 4px 0 6px; font: 600 20px Outfit, sans-serif; }
.lists-heading .account-note { max-width: 52ch; }
.lists-heading .button { flex: none; }
.reading-list {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.list-head h4 { margin: 0; font: 600 17px Outfit, sans-serif; }
.list-head small { color: var(--muted); font-size: 12px; }
.list-actions { display: flex; gap: 12px; flex: none; }
.list-pill {
  margin-left: 6px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--ember) 12%, var(--panel));
  padding: 3px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.list-pill.is-public { background: color-mix(in srgb, var(--ember) 28%, var(--panel)); color: var(--ink); }
.list-description { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.list-items { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.list-item { display: flex; align-items: center; gap: 10px; }
.list-rank {
  flex: none;
  width: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}
.list-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 6px 8px;
  color: var(--ink);
  font: 500 14px Outfit, sans-serif;
  text-align: left;
  cursor: pointer;
}
.list-open:hover { border-color: var(--line); background: var(--wash); }
.list-open span { min-width: 0; }
.list-open strong,
.list-open small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-open small { color: var(--muted); font-size: 11px; font-weight: 500; }
.list-open .shelf-tag,
.feed-title .shelf-tag,
.started-reading-title .shelf-tag,
.continue-card .shelf-tag,
.discussion-hero .shelf-tag {
  margin-top: 5px;
}
.list-tools { flex: none; display: flex; gap: 4px; }
.list-move,
.list-remove {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.list-move:hover { color: var(--ink); border-color: #6d28d9; }
.list-remove:hover { color: #e08a7a; border-color: #5a3330; }
.list-picker {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.list-add { display: flex; align-items: flex-end; gap: 10px; }
.list-add label { flex: 1; display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.list-add .button { flex: none; }
.list-chips { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.list-chip {
  margin: 0 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  padding: 4px 9px;
  color: var(--gold);
  font: 600 11px Outfit, sans-serif;
  cursor: pointer;
}
.list-chip:hover { color: #e08a7a; border-color: #5a3330; }
.public-lists { margin-top: 22px; }
.public-lists-heading {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end center;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: var(--wash);
  color: #fff;
  font: 600 11px Outfit, sans-serif;
  letter-spacing: 0.03em;
  text-align: center;
  text-shadow: 0 1px 8px #000a;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.cover span {
  position: relative;
  z-index: 1;
  background: #0006;
  border-radius: 3px;
  padding: 2px 5px;
}
.continue-card h3,
.title-card h3 {
  margin: 4px 0;
  font-size: 16px;
  font-family: Outfit, sans-serif;
  font-weight: 600;
  line-height: 1.25;
}
.continue-card p,
.title-card p { margin: 0; color: var(--muted); font-size: 11px; }
.pub-tag {
  display: inline;
  font: inherit;
  color: inherit;
}
.pub-tag.is-ongoing { color: #a5b4fc; }
.pub-tag.is-hiatus { color: #e0b07a; }
.pub-tag.is-completed { color: #c4b5fd; }
body.theme-light .pub-tag.is-ongoing { color: #4f46e5; }
body.theme-light .pub-tag.is-hiatus { color: #8a5a28; }
body.theme-light .pub-tag.is-completed { color: #6b3d8f; }
.card-rate {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--hover);
  color: var(--gold);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0;
  line-height: 1;
  user-select: none;
}
.star-rating .star {
  position: relative;
  display: inline-block;
  color: var(--star-empty);
  font-size: 18px;
  line-height: 1;
}
.star-rating .star.is-filled,
.star-rating .star.is-half::before {
  color: var(--star);
}
.star-rating .star.is-half { color: var(--star-empty); }
.star-rating .star.is-half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
}
.star-rating.is-interactive { margin-top: 4px; }
.star-rating.is-interactive .star {
  border: 0;
  margin: 0;
  padding: 6px 4px;
  background: transparent;
  color: var(--star-empty);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.star-rating.is-interactive .star.is-filled { color: var(--star); }
.star-rating.is-interactive:hover .star.is-filled { color: var(--star-empty); }
.star-rating.is-interactive:hover .star:hover,
.star-rating.is-interactive:hover .star:has(~ .star:hover) {
  color: var(--star);
}
.star-rating.is-interactive.is-saving { pointer-events: none; opacity: 0.7; }
.card-controls .star-rating.is-interactive { margin-top: 0; }
.card-controls .star-rating.is-interactive .star {
  padding: 4px 3px;
  font-size: 22px;
}
.library-form .star-rating.is-interactive .star {
  padding: 8px 7px;
  font-size: 30px;
}
.rail-card .star-rating { display: flex; }
.rail-card .star-rating .star { font-size: 12px; color: var(--star-empty); }
.rail-card .star-rating .star.is-filled { color: var(--star); }
.rail-card .star-rating .star.is-half { color: var(--star-empty); }
.card-chapter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--hover);
  color: var(--gold);
  font: 600 12px Outfit, sans-serif;
}
.card-chapter input {
  width: 5ch;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 600 12px Outfit, sans-serif;
}
.card-chapter .chapter-total {
  color: var(--gold);
}
.card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.card-controls .card-rate,
.card-controls .card-chapter,
.card-controls .card-caught-up,
.card-controls .star-rating { margin-top: 0; }
.card-caught-up {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--ember) 22%, var(--panel));
  color: var(--ink);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.card-rate-mark {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--hover);
  color: var(--gold);
  font: 600 12px Outfit, sans-serif;
}

.discovery { padding-bottom: 80px; }
.explore-panel[hidden] { display: none; }
.rail-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px;
}
.rail-heading-row .rail-lead { flex: 1; margin: 0; }
.explore-panel .creator-search { margin: 8px 0 16px; }
.explore-panel .creator-more { margin: 16px 0 0; }
.explore-panel .title-grid > .empty-library,
.explore-panel .creator-grid > .empty-library { grid-column: 1 / -1; }
.explore-panel .rail-lead { margin-bottom: 16px; }
.filters { display: flex; gap: 10px; overflow: auto; padding-bottom: 20px; }
.filters button {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 13px 22px;
  color: var(--muted);
  font: 600 17px Outfit, sans-serif;
  cursor: pointer;
}
.filters button.selected {
  border-color: #8b5cf6;
  background: color-mix(in srgb, var(--ember) 22%, var(--panel));
  color: var(--ink);
}

.explore-rail { margin-bottom: 46px; }
.rail-heading { margin-bottom: 16px; }
.rail-heading h3 { font: 500 24px Outfit, sans-serif; }
.rail-heading .shelf-heading { margin-bottom: 0; }
.rail-heading .shelf-heading h3 { font: 500 24px Outfit, sans-serif; }
.rail-lead { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 62ch; }
.popular-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0 0 16px;
}
.popular-filter-button {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  padding: 8px 14px;
  color: var(--ink);
  font: 600 13px Outfit, sans-serif;
  cursor: pointer;
}
.popular-filter-button.is-active {
  border-color: #8b5cf6;
  background: color-mix(in srgb, var(--ember) 22%, var(--panel));
}
.popular-active {
  min-width: 0;
  color: var(--muted);
  font: 600 13px Outfit, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popular-filters { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.filter-row { min-width: 0; }
.filter-label {
  margin: 0 0 6px;
  color: var(--muted);
  font: 700 10px Outfit, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.popular-filters .filters { padding-bottom: 8px; }
.filters.filter-wrap {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 4px;
}
.shelf-page .popular-bar { margin: -10px 0 24px; }
#popular-filter-modal { width: min(640px, 92vw); }
#popular-filter-modal .form-switch { margin-top: 8px; }
.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.rail-track:has(> .empty-library) {
  display: block;
}
.rail-track::-webkit-scrollbar { height: 6px; }
.rail-track::-webkit-scrollbar-thumb { border-radius: 6px; background: var(--line); }
.rail-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
  cursor: pointer;
}
.rail-card:hover .rail-cover { transform: translateY(-3px); }
.rail-card strong { font: 600 14px Outfit, sans-serif; line-height: 1.3; }
.rail-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.rail-kind { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rail-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: var(--wash);
  background-size: cover;
  background-position: center top;
  transition: transform 0.2s;
}
.rail-cover.empty span { padding: 10px; color: #f4e9ff; font-size: 13px; text-align: center; }
.creator-track { grid-auto-columns: 180px; }
.creator-card-rail { cursor: default; gap: 8px; }
.rail-portrait {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--field);
  background-size: cover;
  background-position: center;
}
.rail-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.button.small { gap: 8px; padding: 8px 14px; font-size: 12px; border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; }
.button.small.ghost { background: transparent; color: var(--muted); }

.update-card .update-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ember) 30%, var(--panel));
  color: var(--gold);
  font-size: 15px;
}

.title-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.title-card { position: relative; cursor: pointer; transition: transform 0.2s; }
.title-card .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; margin-bottom: 10px; font-size: 18px; align-items: center; }
.pop-meter {
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
  overflow: hidden;
}
.pop-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5aa7, #c084c8);
}
body.theme-light .pop-meter span {
  background: linear-gradient(90deg, #8b5aa7, #b07ec8);
}
.rail-card .pop-meter { margin-top: 6px; }
.search-result .pop-meter { margin-top: 6px; max-width: 92px; }
[data-story-details] .pop-meter {
  display: inline-block;
  width: 88px;
  margin: 0 0 2px;
  vertical-align: middle;
}
.pop-score { color: var(--muted); font-weight: 600; }
.title-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.title-tags .badge { margin-top: 0; }
.shelf-tag {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
}
.shelf-tag.is-read,
.shelf-tag.is-reading,
.shelf-tag.is-want {
  background: #3b2170;
  color: #e9d5ff;
}
.shelf-tag.is-dropped {
  background: #3a2428;
  color: #e8c4c4;
}
.badge {
  display: inline-block;
  margin-top: 6px;
  border-radius: 20px;
  background: #2a1848;
  padding: 3px 8px;
  color: #e9d5ff;
  font-size: 10px;
  font-weight: 600;
}
.shelf-pop {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 8px;
  background: #2a2214;
  color: #f3d9a8;
  font-size: 10px;
  font-weight: 600;
}
.rank-mark {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  border-radius: 999px;
  padding: 3px 7px;
  background: color-mix(in srgb, #120c10 78%, transparent);
  color: #f6e7c8;
  font: 700 11px Outfit, sans-serif;
  letter-spacing: 0.02em;
  text-shadow: none;
}
.rail-cover { position: relative; overflow: hidden; }
.rail-cover .rank-mark,
.continue-card .rank-mark { top: 6px; left: 6px; padding: 2px 6px; font-size: 10px; }
.search-result .result-cover { position: relative; overflow: hidden; }
.search-result .rank-mark { top: 3px; left: 3px; padding: 1px 5px; font-size: 9px; }
.search-result .title-tags { margin-top: 5px; }
.search-result .shelf-tag { margin-top: 0; }
body.theme-light .badge,
body.theme-light .shelf-tag.is-read,
body.theme-light .shelf-tag.is-reading,
body.theme-light .shelf-tag.is-want {
  background: #e4c8ef;
  color: #4a2566;
}
body.theme-light .shelf-pop {
  background: #f3e6c8;
  color: #6a4d16;
}
body.theme-light .rank-mark {
  background: color-mix(in srgb, #fff8e8 82%, transparent);
  color: #6a4d16;
}
body.theme-light .shelf-tag.is-dropped {
  background: #f3d8d8;
  color: #7a3030;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #efe6dc;
  color: var(--gold);
  box-shadow: inset 0 0 0 2px #b894c4;
  font: 600 14px Outfit, sans-serif;
  line-height: 1;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.small { width: 30px; height: 30px; font-size: 16px; }
.avatar.is-private {
  color: #c5d4ff;
}

#creators { display: none; }
body.page-creators #creators,
body.page-creator #creators { display: block; }
#discussion { display: none; }
body.page-discussion #discussion { display: block; }
#shelf { display: none; }
body.page-shelf #shelf { display: block; }
body.page-shelf .hero,
body.page-shelf #library,
body.page-shelf #discover,
body.page-shelf #feed,
body.page-shelf #friends,
body.page-shelf #account,
body.page-shelf #creators,
body.page-shelf #discussion,
body.page-shelf #popular,
body.page-shelf #for-you { display: none; }
#popular { display: none; }
body.page-popular #popular { display: block; }
body.page-popular .hero,
body.page-popular #library,
body.page-popular #discover,
body.page-popular #feed,
body.page-popular #friends,
body.page-popular #account,
body.page-popular #creators,
body.page-popular #discussion,
body.page-popular #shelf,
body.page-popular #serial,
body.page-popular #for-you { display: none; }
#for-you { display: none; }
body.page-for-you #for-you { display: block; }
body.page-for-you .hero,
body.page-for-you #library,
body.page-for-you #discover,
body.page-for-you #feed,
body.page-for-you #friends,
body.page-for-you #account,
body.page-for-you #creators,
body.page-for-you #discussion,
body.page-for-you #shelf,
body.page-for-you #serial,
body.page-for-you #popular { display: none; }
#serial { display: none; }
body.page-serial #serial { display: block; }
body.page-serial .hero,
body.page-serial #library,
body.page-serial #discover,
body.page-serial #feed,
body.page-serial #friends,
body.page-serial #account,
body.page-serial #creators,
body.page-serial #discussion,
body.page-serial #shelf,
body.page-serial #popular,
body.page-serial #for-you { display: none; }
/* Importing is a page of its own, reached from the library, so it never trails a tab. */
#import { display: none; }
body.page-import #import { display: block; }
body.page-import .hero,
body.page-import #library,
body.page-import #discover,
body.page-import #feed,
body.page-import #friends,
body.page-import #account,
body.page-import #creators,
body.page-import #popular,
body.page-import #for-you { display: none; }
body.page-home .hero,
body.page-home #creators { display: none; }
#friends { display: none; }
body.page-home.tab-friends #friends { display: block; }
body.page-home.tab-account .search,
body.page-import .search { display: none; }
body.page-home.tab-feed #search-results,
body.page-home.tab-account #search-results,
body.page-import #search-results { display: none; }
body.page-home.tab-library #discover,
body.page-home.tab-library #feed,
body.page-home.tab-library #friends,
body.page-home.tab-library #account { display: none; }
body.page-home.tab-explore #library,
body.page-home.tab-explore #feed,
body.page-home.tab-explore #friends,
body.page-home.tab-explore #account { display: none; }
body.page-home.tab-feed #library,
body.page-home.tab-feed #discover,
body.page-home.tab-feed #friends,
body.page-home.tab-feed #account { display: none; }
body.page-home.tab-friends #library,
body.page-home.tab-friends #discover,
body.page-home.tab-friends #feed,
body.page-home.tab-friends #account { display: none; }
body.page-home.tab-account #library,
body.page-home.tab-account #discover,
body.page-home.tab-account #feed,
body.page-home.tab-account #friends { display: none; }
body.page-creator .hero,
body.page-creator #library,
body.page-creator #discover,
body.page-creator #feed,
body.page-creator #friends,
body.page-creator #account,
body.page-creators .hero,
body.page-creators #library,
body.page-creators #discover,
body.page-creators #feed,
body.page-creators #friends,
body.page-creators #account,
body.page-discussion .hero,
body.page-discussion #library,
body.page-discussion #discover,
body.page-discussion #feed,
body.page-discussion #friends,
body.page-discussion #account,
body.page-discussion #creators,
body.page-creator #popular,
body.page-creators #popular,
body.page-discussion #popular,
body.page-creator #for-you,
body.page-creators #for-you,
body.page-discussion #for-you { display: none; }
body.page-creator .creator-section,
body.page-creators .creator-section,
body.page-discussion .creator-section,
body.page-shelf .creator-section,
body.page-popular .creator-section,
body.page-for-you .creator-section,
body.page-serial .creator-section { min-height: calc(100vh - 79px); padding: 0; }
.creator-section { background: transparent; }
.creator-index { padding: 48px 7.5% 80px; }
.creator-index h1,
.creator-hero h1 { margin: 0; font-size: 48px; font-weight: 700; letter-spacing: 0; }
.creator-lead { max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.6; margin: 12px 0 32px; }
.creator-back {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
button.creator-back {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}
.creator-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.creator-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.creator-card img {
  width: 56px;
  height: 56px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #efe6dc;
}
.creator-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #efe6dc;
}
.creator-card span { padding: 0; }
.creator-card strong { display: block; font-size: 18px; }
.creator-card small { color: var(--muted); font-size: 12px; }
.creator-more { display: block; width: min(240px, 100%); margin: 22px auto 0; }
.creator-hero {
  position: relative;
  min-height: 360px;
  padding: 36px 7.5% 40px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
}
.creator-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.2);
  transform: scale(1.08);
  opacity: 0.35;
}
.creator-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 67%, transparent) 0%, var(--bg) 88%);
}
.creator-hero .creator-back,
.creator-hero-inner { position: relative; z-index: 1; }
.creator-hero-inner {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 28px;
  align-items: end;
}
.creator-portrait {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #5b4b8a;
  box-shadow: 0 18px 40px #0008;
  background: #efe6dc;
}
.creator-meta { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.creator-follow {
  margin-top: 16px;
  gap: 8px;
  padding: 14px 24px;
  font-size: 17px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  cursor: pointer;
}
.creator-follow.ghost {
  background: transparent;
  color: var(--muted);
}
.creator-body { padding: 8px 7.5% 80px; }
.creator-works h2 { margin: 0 0 8px; font-size: 22px; }
.creator-works .browse-count { margin: 0 0 16px; }
.creator-works .shelf-toolbar { margin: 0 0 18px; }
.import-section { background: var(--wash); padding-top: 40px; padding-bottom: 80px; min-height: calc(100vh - 79px); }
.import-section h2 { margin: 0; }
.import-section > p:not(.eyebrow) {
  max-width: 560px;
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.import-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.source-card {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.source-card:hover { border-color: #6d28d9; }
.source-card strong {
  font-family: Outfit, sans-serif;
  font-size: 24px;
  font-weight: 600;
}
.source-card small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.source-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.source-mark.mal { background: #1d2c55; color: #9db4ff; }
.source-mark.anilist { background: #12353a; color: #8fe0ea; }
.source-mark.list { background: #2a2438; color: #d4c4f5; }
.source-mark.sheet { background: #1d3a28; color: #9fe7b8; }
.sheet-file-name {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.sheet-file-name:empty { display: none; }
.account-dialog input[type="file"] {
  padding: 10px;
  font-weight: 500;
}

dialog {
  width: min(600px, 92vw);
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px #000b;
}
dialog::backdrop { background: #070508cc; }
.close-modal {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 9px;
  border: 0;
  background: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--ink);
}
.modal-hero {
  min-height: 180px;
  padding: 29px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: start;
}
.modal-hero .creator-back {
  color: #fff;
  text-shadow: 0 1px 6px #0008;
  margin-bottom: 14px;
}
.modal-hero .eyebrow { color: #f3e8ff; }
.modal-hero .hero-proof {
  margin: 4px 0 8px;
  color: #f3e8ff;
  font-size: 13px;
  font-weight: 600;
}
.modal-hero h2 {
  margin: 0;
  font: 34px Outfit, sans-serif;
  text-shadow: 0 1px 12px #0008;
}
.modal-hero-head,
.discussion-hero-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.modal-hero-head h2,
.discussion-hero-head h1 { flex: 1; min-width: 0; }
.share-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #000 28%, transparent);
  color: #fff;
  cursor: pointer;
}
.share-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.discussion-hero-head .share-button {
  background: var(--wash);
  color: var(--gold);
  border-color: var(--line);
}
body.theme-light .discussion-hero-head .share-button {
  background: #f4e8f6;
}
dialog:has(.modal-hero) .close-modal {
  color: #fff;
  text-shadow: 0 1px 6px #0008;
}
.modal-body { padding: 28px; }
.meta { display: flex; gap: 7px; flex-wrap: wrap; }
.meta span,
.meta a {
  background: var(--hover);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 11px;
  color: var(--ink);
  text-decoration: none;
}
.meta a:hover {
  filter: brightness(1.18);
}
body.theme-light .meta span,
body.theme-light .meta a {
  background: #edd6f3;
  color: #4a2566;
}
body.theme-light .meta a:hover {
  filter: brightness(0.96);
}
.modal-body h3 { margin: 28px 0 8px; font: 22px Outfit, sans-serif; }
.modal-body p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-body p a { color: var(--gold); font-weight: 600; text-decoration: none; }
.modal-body p a:hover { text-decoration: underline; }
.title-synopsis {
  margin: 0 0 16px;
  max-width: 42rem;
}
.title-synopsis p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.title-synopsis .synopsis-credit,
.title-synopsis .synopsis-credit a {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.title-synopsis .synopsis-credit a,
.title-synopsis .synopsis-credit button {
  font-weight: 600;
}
.title-synopsis .synopsis-credit button {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
}
.title-synopsis .synopsis-credit button:hover {
  text-decoration: underline;
}
.title-synopsis .synopsis-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.synopsis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 2px 0 0;
}
.synopsis-votes {
  display: flex;
  align-items: center;
  gap: 4px;
}
.synopsis-votes .vote-button:disabled {
  cursor: default;
  opacity: 0.45;
}
.synopsis-more {
  margin: 0 0 16px;
  max-width: 42rem;
}
.synopsis-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.synopsis-more .title-synopsis {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.synopsis-prompt {
  margin: 0 0 16px;
}
.synopsis-form {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  max-width: 42rem;
}
.synopsis-compose {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.synopsis-invite {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.synopsis-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.synopsis-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
  resize: vertical;
  min-height: 120px;
}
.synopsis-form .synopsis-actions {
  margin: 0;
}
.synopsis-form .button { justify-self: start; }
.external-link {
  display: inline-block;
  margin-top: -13px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.link-list { display: flex; flex-wrap: wrap; gap: 7px; }
.link-list a {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 9px;
  color: var(--gold);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.missing-data { margin: 0; color: var(--muted); font-size: 11px; }
.library-form input,
.library-form select,
.library-form textarea,
.account-dialog input,
.account-dialog select,
.account-dialog textarea,
.list-add select,
.privacy-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 25px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.privacy-row strong,
.privacy-row small { display: block; }
.privacy-row strong { font-size: 12px; }
.privacy-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.privacy-row select { width: auto; }
.modal-actions { display: flex; gap: 9px; margin-top: 23px; }
.modal-actions button {
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
  background: var(--gold);
  color: #fff;
}
.modal-actions button + button {
  background: var(--hover);
  color: var(--ink);
}
.modal-actions button.danger {
  background: transparent;
  color: #e08a7a;
  box-shadow: inset 0 0 0 1px #5a3330;
}
.discussion-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--gold);
  font: 600 14px Outfit, sans-serif;
  text-decoration: none;
  background: var(--wash);
}
.discussion-link strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}
body.theme-light .discussion-link {
  background: #f4e8f6;
}
.discussion-link:hover {
  border-color: #8b5cf6;
  background: var(--hover);
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}
.share-actions .button {
  justify-content: center;
  cursor: pointer;
}
#share-modal .ghost {
  border: 1px solid var(--line);
}
.share-friends-label {
  margin: 18px 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
#share-friends { margin-top: 4px; }
#share-friends .friend-row .button { margin-left: auto; }
#share-modal { width: min(480px, 92vw); }
.discussion-page {
  padding: 36px 7.5% 80px;
}
.discussion-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: end;
  margin: 8px 0 28px;
}
.discussion-hero .cover {
  width: 88px;
  height: auto;
  aspect-ratio: 2 / 3;
}
.discussion-hero h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
}
.discussion-hero .creator-lead {
  margin: 8px 0 0;
}
.discussion-hero .title-synopsis,
.discussion-hero .synopsis-prompt,
.discussion-hero .synopsis-form,
.discussion-hero .synopsis-more {
  margin: 12px 0 0;
}
.title-synopsis-block {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}
.title-synopsis-block .title-synopsis {
  margin-bottom: 16px;
}
.title-synopsis-block .synopsis-compose {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.title-synopsis-block [data-title-synopsis-featured]:not(:empty) + [data-title-synopsis-compose] .synopsis-compose {
  margin-top: 8px;
}
.title-synopsis-block .synopsis-more {
  margin: 12px 0 0;
}
.discussion-hero .text-button {
  margin-top: 10px;
}
.discussion-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.discussion-hero .discussion-tools .text-button {
  margin-top: 0;
}
.text-button.is-saved {
  color: var(--ink);
}
.friends-reading-strip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.friends-reading-name {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.friends-reading-name:hover {
  color: var(--ink);
}
.discussion-hero .friends-reading-strip {
  margin-top: 8px;
}
.title-tabs,
.discussion-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.discussion-tabs .discussion-search-toggle {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.discussion-tabs .discussion-search-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.discussion-tabs .discussion-search-toggle:hover,
.discussion-tabs .discussion-search-toggle.is-open,
.discussion-tabs .discussion-search-toggle.has-query {
  border-color: #8b5cf6;
  color: #e9d5ff;
}
.discussion-tabs + .discussion-search {
  flex: none;
  width: 100%;
  margin: -8px 0 18px;
}
.title-tabs button,
.discussion-tabs button:not(.discussion-search-toggle) {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 13px 22px;
  color: var(--muted);
  font: 600 17px Outfit, sans-serif;
  cursor: pointer;
}
.title-tabs button.selected,
.discussion-tabs button.selected {
  border-color: #8b5cf6;
  background: #2a1848;
  color: #e9d5ff;
}
body.theme-light .title-tabs button.selected,
body.theme-light .discussion-tabs button.selected {
  border-color: #8b5aa7;
  background: #edd6f3;
  color: #5b2d78;
}
.modal-body .title-tabs {
  margin: 0 0 18px;
}
.modal-body .title-tabs button,
.modal-body .discussion-tabs button:not(.discussion-search-toggle) {
  padding: 10px 16px;
  font-size: 14px;
}
.modal-body .title-comments {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.modal-body .library-form { margin-top: 0; }
.discussion-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}
.discussion-search {
  flex: 1 1 180px;
  min-width: 0;
}
.discussion-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
.discussion-sort {
  display: flex;
  gap: 10px;
}
.discussion-sort button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 13px 22px;
  color: var(--muted);
  font: 600 17px Outfit, sans-serif;
  cursor: pointer;
}
.discussion-sort button.selected {
  border-color: #8b5cf6;
  background: #2a1848;
  color: #e9d5ff;
}
body.theme-light .discussion-sort button.selected {
  border-color: #8b5aa7;
  background: #edd6f3;
  color: #5b2d78;
}
.discussion-page .title-comments {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.title-comments {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.title-comments h3 { margin: 0 0 6px; }
.comments-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.comments-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  font-size: 13px;
}
.comment {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.comment:last-child { border-bottom: 0; }
.comment-main { min-width: 0; display: grid; gap: 8px; }
.comment header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.comment header div { min-width: 0; }
.comment strong {
  display: block;
  font-size: 13px;
}
.comment time {
  color: var(--muted);
  font-size: 11px;
}
.comment-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-body .mention {
  display: inline;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.comment-form .mention-menu {
  margin-top: -2px;
}
.comment-votes {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  padding-top: 4px;
}
.vote-button {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: #8b7aa8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.vote-button.active { color: var(--gold); }
.vote-button.down.active { color: #e08a7a; }
.comment-score {
  color: var(--ink);
  font: 600 12px Outfit, sans-serif;
}
.comment-body .inline-spoiler {
  display: inline;
  margin: 0;
  border: 0;
  padding: 0 .18em;
  border-radius: 4px;
  background: var(--ink);
  color: transparent;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  vertical-align: baseline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  user-select: none;
  white-space: pre-wrap;
}
.comment-body .inline-spoiler:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
.comment-body .inline-spoiler:not(.is-open):hover {
  background: color-mix(in srgb, var(--ink) 82%, var(--rose));
}
.comment-body .inline-spoiler:not(.is-open) * {
  color: transparent !important;
  pointer-events: none;
}
.comment-body .inline-spoiler.is-open {
  background: color-mix(in srgb, var(--rose) 16%, var(--field));
  color: inherit;
  cursor: text;
  user-select: text;
}
.spoiler-badge {
  color: var(--rose);
  font-size: 12px;
  font-weight: 600;
}
.only-you {
  display: inline-block;
  margin-left: 6px;
  color: #8aa0d4;
  font-size: 11px;
  font-weight: 600;
}
.spoiler-mask {
  border: 1px dashed var(--rose-line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--rose-wash);
  color: var(--rose);
  font: 600 12px Outfit, sans-serif;
  text-align: left;
  cursor: pointer;
}
.spoiler-mask:hover {
  border-color: color-mix(in srgb, var(--rose) 55%, var(--line));
  background: color-mix(in srgb, var(--rose) 16%, var(--field));
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.comment-actions .text-button { padding: 0; font-size: 12px; }
.comment-actions .text-button.danger { color: var(--rose); }
.comment-marks {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-action svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-action:hover { color: var(--ink); }
.icon-action.is-saved,
.icon-action.is-flagged,
.icon-action.danger { color: var(--rose); }
.icon-action.is-saved svg { fill: currentColor; }
.icon-action.is-saved:hover,
.icon-action.is-flagged:hover,
.icon-action.danger:hover { color: var(--rose); }
.comment-replies {
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.comment.is-reply { padding: 12px 0 0; border-bottom: 0; }
.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.comment-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
  resize: vertical;
  min-height: 84px;
}
.comment-form .button { justify-self: start; }
.reply-form {
  margin: 8px 0 0;
}
.reply-form textarea { min-height: 64px; }
.chapter-comment-picker {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.chapter-comment-picker label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.chapter-comment-picker input {
  width: 8ch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
.chapter-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapter-hot:empty { display: none; }
.chapter-hot-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font: 600 11px Outfit, sans-serif;
  cursor: pointer;
}
.chapter-hot-chip.selected,
.chapter-hot-chip:hover {
  border-color: #8b5cf6;
  background: #2a1848;
  color: #e9d5ff;
}
body.theme-light .chapter-hot-chip.selected,
body.theme-light .chapter-hot-chip:hover {
  border-color: #8b5aa7;
  background: #edd6f3;
  color: #5b2d78;
}

.welcome-choices { display: grid; gap: 10px; margin-top: 22px; }
.welcome-choices .source-card { padding: 16px; }
.welcome-shelf-use { margin-top: 18px; }
.welcome-shelf-use .age-choices { margin: 8px 0 6px; flex-wrap: wrap; }
.welcome-shelf-use .age-choices button { flex: 1; min-width: 7.5rem; }
.welcome-profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.welcome-profile-actions .button { justify-content: center; text-decoration: none; }
.account-dialog { padding: 33px; }
.account-dialog h2 { margin: 0; font: 34px Outfit, sans-serif; }
.account-dialog > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.55; }
.account-dialog form { display: grid; gap: 14px; margin-top: 22px; }
.account-dialog label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.account-dialog textarea { min-height: 140px; resize: vertical; }
.account-dialog .button { justify-content: center; border: 0; cursor: pointer; }
.form-switch {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.form-error { min-height: 16px; margin: 0; color: #e08a7a; font-size: 11px; }
.modal-body h3:first-child,
[data-story-details] h3:first-child { margin-top: 0; }
[data-story-details] a { color: var(--gold); font-weight: 600; text-decoration: none; }
[data-story-details] a:hover { text-decoration: underline; }
[data-story-details] p { margin-bottom: 0; }
.alt-titles {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
[data-story-details] p + .alt-titles { margin-top: 0; }
.alt-titles .text-button {
  padding: 0;
  font-size: 13px;
  vertical-align: baseline;
}
.alt-titles-extra,
.alt-titles-less { display: none; }
.alt-titles.is-expanded .alt-titles-extra { display: inline; }
.alt-titles.is-expanded .alt-titles-more { display: none; }
.alt-titles.is-expanded .alt-titles-less { display: inline; }
.library-form { display: grid; gap: 12px; margin: 18px 0; }
.library-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.library-form textarea { min-height: 90px; resize: vertical; }
.library-form .personal-note textarea {
  min-height: 58px;
  font-weight: 500;
}
.library-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chapter-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chapter-progress input,
.library-form .chapter-progress input {
  flex: 1;
  width: auto;
  min-width: 0;
}
.chapter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chapter-row > label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.title-caught-up {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
  background: var(--gold);
  color: #fff;
  white-space: nowrap;
}
.chapter-total {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.empty-library {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}
.feed-empty {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}
.feed-empty p {
  margin: 0 auto;
  max-width: 42ch;
  line-height: 1.6;
}
.feed-lead,
.account-note,
.composer-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.feed-lead { margin: -8px 0 22px; }
.composer-hint { margin: 8px 0 0; }
.composer-hint code {
  color: var(--gold);
  font-family: Outfit, sans-serif;
  font-weight: 600;
}
.composer-hint .hint-action {
  display: inline;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.composer-hint .hint-action:hover { text-decoration: underline; }
.account-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.account-profile .avatar { width: 56px; height: 56px; font-size: 28px; }
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
}
.avatar-picker button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #efe6dc;
  color: inherit;
  cursor: pointer;
}
.avatar-picker button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-picker button.selected {
  border-color: #8b5cf6;
  background: color-mix(in srgb, var(--ember) 22%, var(--panel));
  box-shadow: inset 0 0 0 2px #8b5cf6;
}
body.theme-light .avatar-picker button.selected {
  border-color: #8b5aa7;
  box-shadow: inset 0 0 0 2px #8b5aa7;
}
.avatar-launch {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.avatar-launch .avatar {
  width: 48px;
  height: 48px;
}
.avatar-launch strong,
.avatar-launch small { display: block; }
.avatar-launch strong { font-size: 14px; }
.avatar-launch small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
#avatar-modal { width: min(440px, 92vw); }
.avatar-studio-preview {
  display: grid;
  place-items: center;
  margin: 18px 0 16px;
  padding: 16px;
  border-radius: 22px;
  background: #efe6dc;
}
.avatar-studio-preview img {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  background: #efe6dc;
  box-shadow: inset 0 0 0 3px #b894c4;
}
body.theme-light .avatar-studio-preview {
  background: #ead4f0;
}
body.theme-light .avatar-studio-preview img {
  background: #ead4f0;
  box-shadow: inset 0 0 0 3px #8b5aa7;
}
.avatar-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
}
.avatar-step > span {
  font-size: 14px;
  font-weight: 600;
}
.avatar-step > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-step strong {
  min-width: 72px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.avatar-step button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--field);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.avatar-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
}
.avatar-color-row > span {
  font-size: 14px;
  font-weight: 600;
}
.avatar-colors {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.avatar-colors button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #0003;
  cursor: pointer;
}
.avatar-colors button.selected {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 35%, transparent);
}
body.theme-light .avatar-colors button.selected {
  border-color: #8b5aa7;
}
.avatar-extras { flex-wrap: wrap; }
.avatar-studio-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.avatar-studio-actions .button {
  flex: 1;
  justify-content: center;
  cursor: pointer;
}
.avatar-studio-actions .ghost {
  border: 1px solid var(--line);
}
.avatar-studio .form-error { margin-top: 10px; }
.profile-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-profile h2 { margin: 0; font-size: 28px; }
.account-mode {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
}
.account-profile .account-note { margin: 2px 0 0; }
.account-profile .button { margin-left: auto; }
.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 8px;
}
.account-settings-link {
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.legal-note {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.legal-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}
#account-settings h2 { margin: 4px 0 18px; font-size: 28px; }
.settings-block {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.settings-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
}
.settings-row > span {
  font-size: 14px;
  font-weight: 600;
}
.settings-row .age-choices { margin: 0; }
.settings-fold {
  margin: 10px 0 0;
}
.settings-fold summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}
.settings-fold .avatar-picker,
.settings-fold #feedback-form { margin-top: 12px; }
#account-settings .account-note { margin: 6px 0 0; font-size: 12px; }
.account-posts-block { margin-bottom: 8px; }
.account-posts-block .eyebrow { margin-bottom: 12px; }
#account-home[hidden],
#account-settings[hidden],
#account-journal[hidden],
#account-comments-block[hidden],
#account-synopses-block[hidden],
#account-notes-block[hidden],
#account-saved-block[hidden],
#account-moderation-block[hidden] { display: none; }
.account-block { margin: 22px 0 0; }
.account-block h3 { margin: 0 0 10px; font-size: 16px; }
#account-journal { margin-top: 18px; }
#account-filters { padding-bottom: 8px; }
#account-filters [hidden] { display: none; }
#account-journal-lead { margin: 0 0 14px; }
#account-journal .account-block { margin-top: 0; }
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.account-stats:has(.account-stat:nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.account-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
a.account-stat {
  cursor: pointer;
}
a.account-stat:hover,
a.account-stat:focus-visible {
  border-color: var(--text);
}
.account-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}
.account-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
#account-moderation,
#account-notes,
#account-saved,
#account-synopses,
#account-comments {
  display: grid;
  gap: 8px;
}
.account-note-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.account-note-row:hover,
.account-note-row:focus-visible {
  border-color: var(--text);
}
.account-note-row span:last-child { min-width: 0; flex: 1; }
.account-note-row strong {
  display: block;
  font-size: 14px;
}
.account-note-row small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap;
}
.feedback-panel { margin-top: 28px; }
.feedback-panel form { display: grid; gap: 14px; margin-top: 16px; }
.feedback-panel label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.feedback-panel input,
.feedback-panel textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
.feedback-panel textarea { min-height: 110px; resize: vertical; }
.feedback-panel .button { justify-self: start; }
.feedback-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-kinds button {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  padding: 8px 14px;
  color: var(--muted);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.feedback-kinds button.selected {
  border-color: #8b5cf6;
  background: #2a1848;
  color: #e9d5ff;
}
body.theme-light .feedback-kinds button.selected {
  border-color: #8b5aa7;
  background: #edd6f3;
  color: #5b2d78;
}
#feedback-title-wrap[hidden] { display: none; }
#account-settings .button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 8px;
  text-decoration: none;
}
.friends-panel {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
#friend-requests { margin-bottom: 18px; }
.age-choices { display: flex; gap: 8px; margin: 14px 0 10px; }
.age-choices button {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  padding: 8px 14px;
  color: var(--muted);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.age-choices button.selected {
  border-color: #8b5cf6;
  background: color-mix(in srgb, var(--ember) 22%, var(--panel));
  color: var(--ink);
}
.profile-card {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.profile-card:last-child { border-bottom: 0; }
.profile-card strong { display: block; }
.profile-card small { color: var(--muted); }
.profile-card .age-choices { margin: 4px 0 0; flex-wrap: wrap; }
.profile-setting small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-card .account-note { margin: 4px 0 0; }
#profile-list > .account-note { margin: 8px 0 0; }
#account-details-panel .settings-row strong {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
#account-details-panel .settings-subhead {
  margin: 4px 0 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
#account-details-panel[hidden],
#account-admin-request[hidden],
#account-admin-request-status-row[hidden],
#admin-request-form[hidden] { display: none; }
#admin-request-form {
  display: grid;
  gap: 10px;
  margin: 8px 0 4px;
}
#admin-request-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
#admin-request-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
  resize: vertical;
}
#admin-request-form .button { justify-self: start; }
.admin-request-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.admin-request-card header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-request-card header div { min-width: 0; }
.admin-request-card strong { display: block; }
.admin-request-card time,
.admin-request-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.admin-request-card .account-note { margin: 0; }
.admin-request-card .comment-actions { margin-top: 2px; }
.admin-work-block { display: grid; gap: 8px; }
.admin-work-block + .admin-work-block { margin-top: 18px; }
.admin-work-block h3 {
  margin: 0 0 2px;
  font-size: 16px;
}
#add-profile-form,
#password-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
#password-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
#password-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 12px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
#gate-forgot,
#gate-forgot-back { margin-top: 2px; justify-self: start; }
#add-profile-form[hidden] { display: none; }
.age-status { margin: 0; }
.friends-panel h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.friends-search {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
}
.friends-search input,
.friends-search select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 15px Outfit, sans-serif;
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.friend-row:last-child { border-bottom: 0; }
.friend-open {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.friend-open strong { display: block; font-size: 14px; }
.friend-open small { color: var(--muted); font-size: 11px; }
.friend-open:hover strong { color: var(--gold); }
.friend-row strong { display: block; font-size: 14px; }
.friend-row small { color: var(--muted); font-size: 11px; }
.friend-row .friend-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.friend-row .button {
  padding: 6px 10px;
  font-size: 12px;
}
.friend-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
#friends-locked {
  max-width: 520px;
}
#friends-locked .button { margin-top: 18px; }
#friends-home[hidden],
#friends-thread[hidden],
#friends-locked[hidden],
#friends-reading[hidden],
#friends-messages[hidden],
#friends-people[hidden] { display: none; }
.friends-messages-head {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}
.friends-reading-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.friends-reading-grid:has(> .friend-empty) { display: block; }
.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.conversation-row:last-child { border-bottom: 0; }
.conversation-row strong { display: block; font-size: 15px; }
.conversation-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.conversation-row.is-unread strong { color: var(--ink); }
.conversation-unread {
  margin-left: auto;
  min-width: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--ember) 28%, var(--panel));
  color: var(--ink);
  font: 700 11px Outfit, sans-serif;
  text-align: center;
}
body.page-home.tab-friends.chat-open #friends.friends-section {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.chat-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100dvh - 150px);
}
.chat-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.chat-head h2 { margin: 4px 0 0; font-size: 26px; }
.chat-members {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.chat-log {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 160px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}
.chat-message {
  display: grid;
  gap: 8px;
  width: min(420px, 88%);
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: var(--panel);
}
.chat-message.mine {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: color-mix(in srgb, var(--ember) 16%, var(--panel));
}
.chat-share {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--field);
  color: inherit;
  text-align: left;
  font: inherit;
}
button.chat-share { cursor: pointer; }
.chat-share strong { display: block; font-size: 14px; }
.chat-share small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.chat-share .result-cover {
  width: 34px;
  height: auto;
  aspect-ratio: 2 / 3;
  flex: none;
}
.chat-message header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.chat-message header strong { font-size: 12px; }
.chat-message header time { color: var(--muted); font-size: 11px; }
.chat-message p { margin: 0; font-size: 15px; line-height: 1.45; }
.chat-composer {
  display: grid;
  gap: 10px;
  position: sticky;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 6;
  margin: 0 -4px;
  padding: 10px 4px 8px;
  background: var(--wash);
}
.chat-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
  resize: vertical;
  min-height: 64px;
}
.chat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chat-title-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.chat-title-chip .chat-share {
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.chat-title-chip[hidden],
.chat-title-search[hidden] { display: none; }
.group-picks {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  max-height: 240px;
  overflow: auto;
}
.group-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.friends-section #friends-reading .friends-reading-grid {
  margin-top: 8px;
}
.activity-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.activity-card .comment-body { margin: 10px 0 0; }
.activity-card .comment-actions { margin-top: 10px; }
.activity-card .edit-form,
.activity-card .reply-form { margin-top: 10px; }
.activity-card .reply-form .composer-hint { margin: 0 0 8px; }
.feed-post-quote {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--field);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.feed-post-quote:hover { border-color: #6d28d9; }
.feed-post-quote-by {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.feed-post-quote .post-body {
  margin: 0;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-post-quote small {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.feed-post-quote.is-missing { color: var(--muted); font-size: 13px; cursor: default; }
.avatar.tiny { width: 22px; height: 22px; font-size: 12px; }
#post-modal { width: min(640px, 94vw); }
#post-modal .post-card { margin: 0; border: 0; background: transparent; padding: 0; }
.feed-title,
.started-reading-title {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--field);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.feed-title strong,
.started-reading-title strong { display: block; font-size: 14px; }
.feed-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.feed-title .result-cover,
.started-reading-title .result-cover {
  width: 40px;
  height: auto;
  aspect-ratio: 2 / 3;
  flex: none;
  border-radius: 6px;
  background-size: cover;
  background-position: center top;
  background-color: var(--hover);
}
.post-composer {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.post-composer label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.post-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
  resize: vertical;
  min-height: 96px;
}
.post-composer .button { justify-self: start; }
.mention-menu {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.mention-menu[hidden] { display: none; }
.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 600 13px Outfit, sans-serif;
}
.mention-option:last-child { border-bottom: 0; }
.mention-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
.mention-option:hover,
.mention-option.active { background: var(--hover); }
.post-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  margin-bottom: 14px;
}
.post-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-card header div { min-width: 0; flex: 1; }
.post-card strong { display: block; font-size: 13px; }
.post-card time { color: var(--muted); font-size: 11px; }
.post-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.post-card .comment-form { margin-top: 12px; }
.post-card .comment-form textarea { min-height: 64px; }
.reading-nudge {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.reading-nudge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reading-nudge-bar input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--field);
  color: var(--ink);
  font: 14px Outfit, sans-serif;
}
.reading-nudge-bar .button {
  flex: none;
  padding: 8px 14px;
}
.reading-nudge .form-error:empty { display: none; }
.reading-nudge-hint,
.reading-nudge-sent {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.reading-nudge-gate {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  justify-items: start;
}
.reading-nudge-sent { margin-top: 12px; }

@media (max-width: 800px) {
  .avatar-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .topbar {
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    height: calc(58px + env(safe-area-inset-top));
    gap: 10px;
  }
  .topbar .brand span:last-child { display: none; }
  .account-chip .account-meta { display: block; }
  .account-chip strong { font-size: 12px; }
  .notify-panel {
    left: auto;
    right: 16px;
    width: min(360px, calc(100% - 32px));
  }
  .search { width: 40px; min-width: 40px; }
  .search:focus-within {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .search-results {
    top: calc(58px + env(safe-area-inset-top));
    left: 12px;
    width: calc(100vw - 24px);
  }
  .hero { padding: 36px 20px 48px; min-height: 0; }
  .hero h1 { font-size: 34px; max-width: 12ch; }
  .hero-copy { font-size: 15px; margin: 16px 0 22px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-art { opacity: 0.4; right: -48px; width: 220px; height: 220px; bottom: 12px; }
  .hero-covers img { width: 86px; height: 128px; }
  .section { padding: 36px 20px; }
  .library-form .form-row { grid-template-columns: 1fr; }
  .card-controls .star-rating.is-interactive .star {
    padding: 8px 5px;
    font-size: 24px;
  }
  .continue-grid:not(.shelf-full-grid) {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin: 0 -20px;
    padding: 0 20px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .continue-grid:not(.shelf-full-grid) .continue-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .continue-grid.shelf-full-grid { grid-template-columns: 1fr; }
  #public-shelf-list .continue-grid:not(.shelf-full-grid) {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  #public-shelf-list .continue-grid:not(.shelf-full-grid) .continue-card { flex: none; }
  .shelf-page { padding: 24px 20px 80px; }
  .shelf-page h1 { font-size: 28px; }
  .import-cards { grid-template-columns: 1fr; }
  .title-grid,
  .friends-reading-grid,
  .creator-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .creator-card { padding: 12px; }
  .creator-card img { width: 44px; height: 44px; border-radius: 10px; }
  .explore-rail { margin-bottom: 34px; }
  .rail-heading h3 { font-size: 20px; }
  .rail-track { grid-auto-columns: 132px; gap: 12px; }
  .rail-cover { height: auto; }
  .creator-track { grid-auto-columns: 150px; }
  .creator-hero-inner { grid-template-columns: 1fr; }
  .creator-portrait { width: 120px; height: 120px; }
  .creator-index,
  .creator-hero,
  .creator-body { padding-left: 20px; padding-right: 20px; }
  .discussion-page { padding: 24px 20px 80px; }
  .discussion-hero h1 { font-size: 28px; }
  .creator-index h1,
  .creator-hero h1 { font-size: 32px; }
  .title-card .cover { height: auto; }
  .section h2 { font-size: 26px; }
  .account-profile { flex-wrap: wrap; }
  .account-profile .button { margin-left: 0; }
  .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gate { place-items: start center; }
  .gate-card {
    padding: 26px 20px 22px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
  }
  .gate-card h1 { font-size: 28px; }
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  .modal-hero { padding-top: calc(48px + env(safe-area-inset-top)); }
  .account-dialog { padding: calc(36px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
  .account-dialog h2,
  .modal-hero h2 { font-size: 28px; }
  #avatar-modal,
  #share-modal {
    width: 100%;
    max-width: 100%;
  }
  .avatar-studio-preview img {
    width: 140px;
    height: 140px;
  }
  .toast { margin: 0 16px; }
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.gate[hidden] { display: none; }
body.signed-out .shell,
body.signed-out .app-tabs { display: none; }

.gate-card {
  width: min(400px, 100%);
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 16px 48px color-mix(in srgb, #000 22%, transparent);
}
.gate-card .brand { font-size: 18px; }
.gate-card .eyebrow { margin: 28px 0 8px; }
.gate-card h1 {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.gate-copy { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.gate-tabs {
  display: flex;
  gap: 18px;
  margin: 26px 0 22px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.gate-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  padding: 10px 0 11px;
  background: transparent;
  color: var(--muted);
  font: 500 13px Outfit, sans-serif;
  cursor: pointer;
}
.gate-tabs button.active {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--ember);
}

#gate-form { display: grid; gap: 14px; }
#gate-credentials,
#gate-names { display: grid; gap: 14px; }
.gate-age { display: grid; gap: 8px; }
.gate-age-label { margin: 4px 0 0; font-size: 12px; font-weight: 600; }
#gate-age-choices { margin: 0; }
#gate-age-choices button { flex: 1; }
.gate .age-choices button.selected {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  background: color-mix(in srgb, var(--ember) 18%, var(--panel));
  color: var(--ink);
}
.gate #gate-submit,
.gate .primary {
  border-radius: 10px;
  background: var(--ember);
  color: #1a101c;
}
body.theme-light .gate #gate-submit,
body.theme-light .gate .primary {
  background: var(--ember);
  color: #fff8fb;
}
#public-shelf-modal {
  width: min(1040px, 96vw);
  max-height: min(92vh, 960px);
}
#public-shelf-modal .account-dialog { padding: 28px 28px 36px; }
#public-shelf-profile .profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
#public-shelf-profile .profile-head .avatar {
  width: 56px;
  height: 56px;
  flex: none;
}
#public-shelf-profile h2 { margin: 0; font-size: 28px; }
#public-shelf-profile .account-note { margin: 6px 0 0; }
#public-shelf-profile .account-stats { margin: 0; }
#public-shelf-profile .profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}
#public-shelf-activity { margin-top: 28px; }
#public-shelf-activity .profile-activity { display: grid; gap: 12px; }
#public-shelf-activity .lists-heading { margin-bottom: 4px; }
#public-shelf-activity .post-card { margin: 0; }
#public-shelf-synopses { margin-top: 28px; }
#public-shelf-synopses .profile-activity { display: grid; gap: 12px; }
#public-shelf-synopses .lists-heading { margin-bottom: 4px; }
#public-shelf-synopses .account-note { margin: 0 0 4px; }
#public-shelf-synopses .post-card { margin: 0; }
#public-shelf-synopses .title-synopsis { margin: 0; }
#account-synopses .title-synopsis { margin: 0; }
#public-shelf-activity .reading-nudge,
#public-shelf-activity .reading-nudge-gate { display: none; }
#public-shelf-list { margin-top: 22px; }
#public-shelf-list .continue-grid { grid-template-columns: repeat(2, 1fr); }
#public-shelf-list .public-lists { margin-top: 36px; }
#public-shelf-list .shelf-heading { cursor: default; }
#gate-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
#gate-form [hidden] { display: none !important; }
#gate-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 12px;
  background: var(--field);
  color: var(--ink);
  font: 16px Outfit, sans-serif;
}
#gate-form input:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 24%, transparent);
}
#gate-form .button { justify-content: center; margin-top: 4px; padding: 14px 18px; border: 0; cursor: pointer; }

.password-field,
.prefix-field { position: relative; display: block; }
.password-field input { padding-right: 66px; }
.prefix-field input { padding-left: 30px; }
.prefix-field .prefix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
.optional { color: var(--muted); font-size: 11px; font-weight: 400; text-transform: none; }
.field-hint.bad { color: #e08a7a; }
.field-hint.good { color: #8fd39a; }
.reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--hover);
  color: var(--gold);
  font: 600 11px Outfit, sans-serif;
  cursor: pointer;
}

.strength { display: grid; gap: 6px; }
.strength[hidden] { display: none; }
.strength-bar {
  height: 4px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}
.gate .strength-bar { background: var(--line); }
.strength-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e08a7a;
  transition: width 0.2s, background 0.2s;
}
.strength small { color: var(--muted); font-size: 11px; }
.gate-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.app-tabs {
  display: grid;
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--tabbar);
  border-top: 1px solid var(--line);
}
body.profile-personal .app-tabs { grid-template-columns: repeat(4, 1fr); }
body.profile-personal .app-tabs a[data-tab="friends"] { display: none; }
.app-tabs a {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: 600 10px Outfit, sans-serif;
  cursor: pointer;
}
.app-tabs a i {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
}
.app-tabs a i[hidden] { display: none; }
.app-tabs svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-tabs a.active {
  color: var(--gold);
  background: color-mix(in srgb, var(--ember) 24%, transparent);
  border-radius: 12px;
}
.app-tabs a.active svg { stroke-width: 2.3; }

.physical-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
  font: 600 13px Outfit, sans-serif;
  cursor: pointer;
}
.physical-toggle input { margin-top: 2px; accent-color: var(--ember); }
.physical-toggle small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.physical-owned { margin-top: 14px; }
.physical-owned h3 { margin: 0 0 8px; font: 600 14px Outfit, sans-serif; }
.physical-owned-meta { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.physical-through {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.physical-through label { flex: 1; display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.physical-through input { width: 100%; }
.physical-gaps { margin-top: 10px; }
.physical-volume-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.physical-volume {
  min-width: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 6px 8px;
  color: var(--muted);
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
}
.physical-volume.owned,
.physical-volume.selected {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  background: color-mix(in srgb, var(--ember) 18%, var(--panel));
  color: var(--ink);
}
.physical-tag {
  display: inline-block;
  margin-top: 6px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--ember) 16%, var(--panel));
  padding: 2px 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
}
.continue-card .physical-tag { margin-right: 6px; }
.physical-add-volume {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.physical-add-volume input { width: 4rem; }

