:root {
  --bg: #f6f6f9;
  --card: #fff;
  --accent: #7c4dff;
  --accent-light: #ece9ff;
  --text: #1f2030;
  --muted: #6d6f82;
  --border: #e6e7ee;
  --warning: #dc2626;
  --success: #16a34a;
}

.nb-read-confirmation {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #d8d9e8;
  border-radius: 12px;
  background: #f8f8ff;
}

.nb-read-confirmation-copy {
  display: grid;
  gap: 3px;
  color: #2f3142;
}

.nb-read-confirmation-copy span {
  color: #666a7d;
  font-size: 12px;
  line-height: 1.5;
}

.nb-read-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.nb-read-confirmation-error {
  margin: 8px 0 0;
  color: #a53b45;
  font-size: 12px;
}

/* NextBook homepage redesign */
body.home-page {
  min-width: 1180px;
  background:
    radial-gradient(circle at 48% 8%, rgba(124, 77, 255, 0.12), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(17, 189, 232, 0.1), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #12172b;
}

body.home-page.reading-sources-page {
  min-width: 0;
  overflow-x: hidden;
}

.home-shell {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding-bottom: 2rem;
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 1.25rem;
  height: 64px;
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr) auto minmax(210px, 330px) minmax(0, max-content);
  align-items: center;
  column-gap: clamp(0.75rem, 1.2vw, 1.15rem);
  min-width: 0;
  border-bottom: 1px solid #e6ebf5;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.home-nav.no-nav-search {
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr) auto minmax(0, max-content);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 170px;
  color: #12172b;
  text-decoration: none;
}

.home-logo {
  border-radius: 12px;
  object-fit: contain;
}

.home-brand strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 950;
  line-height: 1.05;
}

.home-brand small {
  display: block;
  color: #687086;
  font-size: 0.64rem;
  font-weight: 750;
  margin-top: 0.12rem;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.member-badge,
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.member-badge {
  color: #7c2d12;
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.level-badge {
  color: #4f46e5;
  border: 1px solid rgba(124, 77, 255, 0.2);
  background: #f1efff;
}

.home-links {
  display: flex;
  align-items: center;
  gap: clamp(0.72rem, 1.3vw, 1.35rem);
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.home-links a {
  position: relative;
  color: #26324f;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 850;
  white-space: nowrap;
}

.home-links a.active {
  color: var(--accent);
}

.home-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.home-nav-search {
  width: 100%;
  max-width: 330px;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid #dbe3f1;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.9rem;
}

.home-nav-search::before {
  content: "⌕";
  color: #94a3b8;
  margin-right: 0.45rem;
}

.home-nav-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #12172b;
  font-size: 0.82rem;
}

.home-nav-search input::placeholder {
  color: #9aa5ba;
}

.home-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 36px;
  min-width: 0;
  max-width: 225px;
  border: 1px solid #dde5f3;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.home-nav-user a {
  flex: 0 0 auto;
  color: var(--accent);
  text-decoration: none;
}

.home-nav-user #currentUserLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-locale-field {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  border: 1px solid #dde5f3;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.75rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: #26324f;
  white-space: nowrap;
}

.site-locale-field select {
  min-width: 82px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #12172b;
  font: inherit;
}

.home-bell {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef174c;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
}

.home-main {
  padding-top: 0.75rem;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 430px;
  gap: 0.75rem;
}

.home-panel,
.home-section {
  border: 1px solid #dfe7f6;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(31, 55, 120, 0.07);
}

.reader-card {
  padding: 1rem;
}

.reader-profile {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 1rem;
  align-items: center;
}

.reader-avatar {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffe4d6 0%, #a5d8ff 48%, #7c4dff 100%);
  color: #fff;
  font-size: 2.4rem;
  font-weight: 950;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
}

.reader-avatar.large {
  width: 94px;
  height: 94px;
  border: 6px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px #cbd8ff, 0 16px 36px rgba(109, 76, 255, 0.24);
}

.reader-profile h1 {
  font-size: 1.55rem;
  line-height: 1.05;
  margin: 0;
}

.reader-profile p {
  color: #536079;
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.reader-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  min-height: 34px;
  border: 1px solid #cbd8ff;
  border-radius: 999px;
  color: #2563eb;
  background: #fff;
  padding: 0.16rem 0.85rem 0.16rem 0.28rem;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.reader-switch-avatars {
  display: inline-flex;
  align-items: center;
  padding-left: 0.1rem;
}

.reader-switch-avatars span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, #ff8a3d, #7c4dff);
  font-size: 0.62rem;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.16);
}

.reader-switch-avatars span + span {
  margin-left: -0.45rem;
  background: linear-gradient(145deg, #00a6c8, #7c4dff);
}

.reader-target-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}

.reader-language-control,
.reader-target,
.reader-target-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f0ecff;
  color: var(--accent);
  font-weight: 900;
  font-size: 0.82rem;
}

.reader-language-control {
  background: #fff;
  border: 1px solid #d9e2ff;
  color: #536079;
}

.reader-target-control {
  padding-right: 0.5rem;
}

.reader-language-control select,
.reader-target-control select {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 950;
  outline: none;
}

.reader-target-control select:disabled,
.ngb-select:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.reader-target-hint {
  color: #8b93a7;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.reader-target b {
  font: inherit;
  color: inherit;
}

.reader-overview {
  margin-top: 1.2rem;
  border: 1px solid #e6ebf5;
  border-radius: 10px;
  padding: 0.8rem;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.reader-overview-head,
.reader-stat {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.reader-overview-head {
  margin-bottom: 0.5rem;
}

.reader-overview-head a {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.reader-stat {
  padding: 0.45rem 0;
  border-top: 1px solid #edf1f7;
  color: #536079;
  font-size: 0.84rem;
}

.reader-stat > span {
  white-space: nowrap;
}

.reader-stat b {
  color: #12172b;
  font-size: 0.95rem;
}

.reader-stat.language-split b {
  color: #12172b;
  font-size: 0.95rem;
}

.reader-stat.language-split b span {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #f3f0ff;
  white-space: nowrap;
}

.reading-galaxy {
  position: relative;
  min-height: 348px;
  padding: 1rem 1.1rem 0.9rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 53% 50%, rgba(124, 77, 255, 0.14), transparent 26%),
    radial-gradient(circle at 64% 28%, rgba(17, 189, 232, 0.12), transparent 26%),
    #fff;
}

.galaxy-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.galaxy-title p {
  color: #768198;
  font-size: 0.8rem;
  margin-top: 0.18rem;
}

.galaxy-stage {
  position: absolute;
  inset: 48px 24px 56px;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 46%, rgba(124, 77, 255, 0.12), transparent 28%),
    radial-gradient(circle at 78% 22%, rgba(34, 211, 238, 0.09), transparent 19%),
    radial-gradient(circle at 18% 72%, rgba(255, 91, 32, 0.08), transparent 20%);
}

.orbit {
  position: absolute;
  left: 11%;
  right: 8%;
  top: 8%;
  bottom: 4%;
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  border-radius: 50%;
  transform: rotate(-10deg);
  z-index: 1;
}

.orbit-b {
  transform: rotate(16deg) scale(0.86);
  border-style: dashed;
  border-color: rgba(17, 189, 232, 0.42);
}

.orbit-c {
  transform: rotate(-34deg) scale(0.66);
  border-color: rgba(124, 77, 255, 0.42);
}

.orbit-d {
  left: 24%;
  right: 22%;
  top: -13%;
  bottom: -16%;
  border-color: rgba(124, 77, 255, 0.22);
  transform: rotate(42deg);
}

.orbit-e {
  left: 3%;
  right: 3%;
  top: 29%;
  bottom: 24%;
  border-color: rgba(37, 99, 235, 0.2);
  border-style: dotted;
  transform: rotate(-27deg);
}

.star-map-line {
  position: absolute;
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, rgba(124, 77, 255, 0.44), rgba(56, 189, 248, 0.22), transparent);
  z-index: 2;
}

.star-map-line.line-a {
  left: 18%;
  top: 58%;
  width: 50%;
  transform: rotate(-24deg);
}

.star-map-line.line-b {
  left: 31%;
  top: 76%;
  width: 46%;
  transform: rotate(13deg);
}

.star-map-line.line-c {
  left: 50%;
  top: 42%;
  width: 39%;
  transform: rotate(27deg);
}

.star-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12), 0 0 16px rgba(124, 77, 255, 0.46);
  z-index: 3;
}

.star-dot.dot-a { left: 20%; top: 70%; }
.star-dot.dot-b { left: 37%; top: 45%; }
.star-dot.dot-c { left: 58%; top: 28%; }
.star-dot.dot-d { left: 73%; top: 62%; }
.star-dot.dot-e { left: 85%; top: 38%; }

.book-node {
  position: absolute;
  width: 58px;
  height: 82px;
  border-radius: 8px;
  overflow: visible;
  background:
    linear-gradient(145deg, rgba(20, 28, 62, 0.82), rgba(124, 77, 255, 0.75)),
    linear-gradient(90deg, #fff 0 16%, transparent 16% 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
  z-index: 5;
}

.book-node img {
  width: 58px;
  height: 82px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.book-node.book-node-missing {
  background:
    linear-gradient(145deg, rgba(20, 28, 62, 0.82), rgba(124, 77, 255, 0.75)),
    linear-gradient(90deg, #fff 0 16%, transparent 16% 100%);
}

.book-node span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  text-align: center;
  color: #26324f;
  font-size: 0.72rem;
  font-weight: 900;
}

.node-a { left: 4%; top: 42%; }
.node-b { left: 25%; top: 61%; background: linear-gradient(145deg, #fd6b34, #532b8a); }
.node-c { right: 17%; top: 5%; background: linear-gradient(145deg, #0f766e, #101827); }
.node-d { right: 4%; top: 38%; background: linear-gradient(145deg, #9a3412, #44200d); }

.galaxy-child {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.galaxy-child strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
}

.galaxy-child span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  margin-top: 0.25rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 0.72rem;
}

.galaxy-filter-row {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.galaxy-filter-row span,
.galaxy-filter-row b {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.72rem;
  border-radius: 999px;
  background: #f2f5ff;
  color: #5964d9;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
}

.galaxy-filter-row b {
  color: #2563eb;
  background: #fff;
  border: 1px solid #dfe7f6;
  font-size: 0.92rem;
  min-height: 32px;
}

.vocab-card {
  padding: 1rem;
}

.vocab-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.vocab-card-head .reader-target-row {
  margin: 0;
}

.vocab-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.vocab-card-head h2 > span {
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  color: var(--accent);
  background: #f5f3ff;
  padding: 0.18rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 850;
}

.vocab-snapshot {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 1rem;
  align-items: center;
}

.vocab-donut {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#2563eb 0 358deg, #e9eefb 358deg);
  position: relative;
}

.vocab-donut::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #fff;
  z-index: 0;
}

.vocab-donut strong,
.vocab-donut span {
  position: relative;
  z-index: 1;
  grid-column: 1;
}

.vocab-donut strong {
  font-size: 1.38rem;
  font-weight: 950;
  align-self: end;
}

.vocab-donut span {
  color: #637089;
  font-size: 0.72rem;
  font-weight: 850;
  align-self: start;
}

.vocab-numbers {
  border-left: 1px solid #e6ebf5;
  padding-left: 1rem;
}

.vocab-numbers .reader-stat:first-child {
  border-top: 0;
}

.vocab-numbers .reader-stat b {
  font-size: 0.95rem;
}

.vocab-success {
  margin: 0.8rem 0;
  border: 1px solid #cdebdc;
  background: #f4fdf8;
  color: #14a260;
  border-radius: 9px;
  height: 34px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.8rem;
}

.vocab-trend {
  margin-top: 0.7rem;
  padding: 0.55rem 0.65rem 0.62rem;
  border: 1px solid #e5eafa;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.trend-head,
.trend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.trend-head strong,
.trend-head b {
  color: #111827;
  font-size: 0.74rem;
  font-weight: 900;
}

.trend-head span,
.trend-foot span {
  color: #687086;
  font-size: 0.68rem;
  font-weight: 800;
}

.trend-chart {
  display: block;
  width: 100%;
  height: 108px;
  margin: 0.18rem 0 0.02rem;
  overflow: visible;
}

.trend-empty {
  color: #1f2937;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.55;
  padding: 0.42rem 0 0.25rem;
}

.trend-grid {
  fill: none;
  stroke: #edf2fb;
  stroke-width: 1;
}

.trend-area {
  fill: rgba(37, 99, 235, 0.1);
}

.trend-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot-group circle {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 3;
}

.trend-labels text {
  fill: #12172b;
  font-size: 9px;
  font-weight: 850;
  text-anchor: middle;
}

.vocab-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.vocab-actions a,
.primary-mini {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid #dbe4f4;
  background: #fff;
  color: #2563eb;
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: none;
}

.primary-mini {
  border-color: transparent;
  background: linear-gradient(135deg, #ff5b20, #ff8b1f);
  color: #fff;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.24);
}

.home-section {
  margin-top: 0.75rem;
  padding: 0.85rem;
}

.recommend-section {
  padding: 0.75rem 0.85rem 0.85rem;
}

.home-recommend-body.next-great-book {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}

.home-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.home-section-head.compact {
  align-items: center;
  margin-bottom: 0.6rem;
}

.home-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.home-section-head p {
  color: #687086;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.home-help-link {
  border: 0;
  background: transparent;
  color: #687086;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.home-help-link::after {
  content: " ?";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: #64748b;
  font-size: 0.68rem;
}

.home-page .topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  color: #687086;
  font-size: 0.8rem;
}

.home-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #edf1f7;
}

.booklist-entry-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 100%;
}

.booklist-entry-row.expanded {
  align-items: flex-start;
  gap: 0.55rem 0.75rem;
}

.filter-chip-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-group-label {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.commercial-select-field {
  flex-wrap: nowrap;
}

.booklist-entry {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe5f1;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.booklist-entry:hover {
  border-color: #c4b5fd;
  color: #6d28d9;
}

.booklist-entry.active {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.18);
}

.home-select-field,
.home-search-field,
.home-page .lexile-bands-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.home-search-field {
  flex: 1 1 290px;
  min-width: 260px;
}

.home-filter-search {
  width: 100%;
  height: 34px;
  border: 1px solid #dfe5f1;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  outline: none;
}

.home-filter-search:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12);
}

.home-filter-select {
  height: 34px;
  min-width: 112px;
  border: 1px solid #dfe5f1;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  padding: 0 2rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 850;
}

.home-filter-select.lexile-select {
  min-width: 148px;
}

.home-page .lang-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
}

.home-page .lang-tab {
  height: 32px;
  border-radius: 9px;
  border: 1px solid #dfe5f1;
  background: #fff;
  color: #49536b;
  padding: 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 850;
}

.home-page .lang-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(124, 77, 255, 0.2);
}

.home-page .filter-label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.home-page .lexile-bands {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.home-page .lexile-band-btn {
  height: 28px;
  border: 1px solid #dfe5f1;
  border-radius: 999px;
  background: #fff;
  color: #49536b;
  padding: 0 0.68rem;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.home-page .lexile-band-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.home-page .btn.primary {
  width: auto;
  margin: 0;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.home-page .btn.linkish {
  width: auto;
  margin: 0;
  background: #fff;
}

body[data-page="home"] .masonry:not(.list-mode) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 4px;
  row-gap: 0;
  column-gap: 0.85rem;
}

body[data-page="home"] .masonry:not(.list-mode) > .book-card,
body[data-page="home"] .masonry:not(.list-mode) > .nb-entity-card {
  display: block;
  width: 100%;
  margin: 0;
}

body[data-page="home"] .masonry:not(.list-mode) .commercial-series-card {
  border-color: rgba(107, 78, 255, 0.34);
}

@media (min-width: 1320px) {
  body[data-page="home"] .masonry:not(.list-mode) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  body[data-page="home"] .masonry:not(.list-mode) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-page="home"] .masonry:not(.list-mode) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-page .ngb-head {
  display: none;
}

.home-page .ngb-body {
  display: block;
}

.home-page .ngb-books {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.home-page .ngb-locked-card {
  min-height: 18rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--muted);
  text-align: center;
  padding: 1.25rem;
}

.home-page .ngb-locked-card strong {
  color: var(--text);
}

.membership-learn-more {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.membership-learn-more:hover,
.membership-learn-more:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.home-page .ngb-locked-badge {
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
}

.home-page .ngb-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.home-page .ngb-panel:first-child {
  display: none;
}

.home-page .ngb-rec-panel .ngb-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.book-card .card-top-right {
  gap: 0.3rem;
}

.book-card .card-top-right .book-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.2;
}

.nb-entity-card .book-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.2;
}

.nb-entity-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.nb-entity-count {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.15;
}

.book-card .card-top-right .book-author {
  display: flex;
  align-items: baseline;
  gap: 0.36rem;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.2;
}

.nb-entity-card .book-author {
  margin: 0;
  color: #6b7280;
  font-size: 0.84rem;
  line-height: 1.2;
  font-weight: 760;
}

.book-card .card-top-right .book-series {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin: -0.08rem 0 0;
  font-size: 0.76rem;
  line-height: 1.2;
}

.book-card .book-identity-label {
  flex: 0 0 3.2rem;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-transform: uppercase;
}

.book-card .book-identity-label::after {
  content: ":";
}

.book-card .book-signal-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
  padding: 0;
  margin: 0.08rem 0 0;
}

.book-card .signal-row {
  width: auto;
  max-width: 100%;
  grid-template-columns: auto minmax(0, auto);
  border: 1px solid #e2e8f6;
  border-radius: 999px;
  background: #fff;
  color: #344055;
  font-size: 0.66rem;
  line-height: 1.2;
  padding: 0.2rem 0.42rem;
}

.nb-source-chip-book-award {
  border-color: #f6d58f;
  background: #fffaf0;
  color: #9a650f;
}

.nb-source-chip-author-award,
.nb-source-chip-author-awarded-work {
  border-color: #e8c56a;
  background: #fff8db;
  color: #8a5a05;
}

.nb-source-chip-curated-list {
  border-color: #c7dcff;
  background: #f3f7ff;
  color: #1d4ed8;
}

.nb-source-chip-reading-data {
  border-color: #bde8cf;
  background: #f1fff7;
  color: #16814b;
}

.book-card .nb-source-chip-book-award .signal-icon,
.nb-source-chip-book-award > span[aria-hidden="true"] {
  color: #d99b16;
}

.book-card .nb-source-chip-author-award .signal-icon,
.nb-source-chip-author-award > span[aria-hidden="true"],
.nb-source-chip-author-awarded-work > span[aria-hidden="true"] {
  color: #b77908;
}

.book-card .nb-source-chip-curated-list .signal-icon,
.nb-source-chip-curated-list > span[aria-hidden="true"] {
  color: #2563eb;
}

.book-card .nb-source-chip-reading-data .signal-icon,
.nb-source-chip-reading-data > span[aria-hidden="true"] {
  color: #16a34a;
}

.book-card .signal-icon {
  font-size: 0.74rem;
}

.book-card .nb-book-metric-grid {
  margin-top: 0.12rem;
}

.nb-book-type-label {
  margin: 0 auto 0.32rem;
}

.nb-book-metric b,
.nb-entity-metric b {
  font-size: 0.78rem;
  line-height: 1.18;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.nb-book-metric span,
.nb-entity-metric span {
  font-size: 0.62rem;
  line-height: 1.18;
}

.nb-coverage-all-trigger {
  font-size: 0.68rem;
  line-height: 1.18;
}

.coverage-all-panel {
  grid-column: 1 / -1;
}

.home-page .ngb-rec-reason {
  min-height: 0;
  margin: 0.35rem 0 0.45rem;
  padding: 0.36rem 0.5rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff7ed, #fff);
  color: #344054;
  font-size: 0.76rem;
  line-height: 1.35;
  border: 1px solid #fed7aa;
}

@media (min-width: 1181px) and (max-width: 1320px) {
  .home-nav {
    height: auto;
    min-height: 64px;
    grid-template-columns: minmax(145px, max-content) minmax(0, 1fr) minmax(190px, 300px) minmax(0, max-content);
    row-gap: 0.45rem;
    padding: 0.45rem 0;
  }
  .home-links {
    grid-column: 2 / 5;
    grid-row: 2;
  }
  .site-locale-field {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .home-nav-search {
    grid-column: 3;
    grid-row: 1;
  }
  .home-nav-user {
    grid-column: 4;
    grid-row: 1;
  }
  .home-links a.active::after {
    bottom: -10px;
  }
  .home-nav.no-nav-search {
    height: 64px;
    grid-template-columns: minmax(145px, max-content) minmax(0, 1fr) auto minmax(0, max-content);
    padding: 0;
  }
  .home-nav.no-nav-search .home-links,
  .home-nav.no-nav-search .site-locale-field,
  .home-nav.no-nav-search .home-nav-user {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 1180px) {
  body.home-page {
    min-width: 0;
  }
  .home-shell {
    width: min(100% - 20px, 980px);
  }
  .home-nav {
    margin: 0;
    height: auto;
    min-height: 64px;
    grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
    padding: 0.55rem 0;
    row-gap: 0.55rem;
  }
  .site-locale-field,
  .home-nav-search,
  .home-nav-user {
    justify-self: stretch;
  }
  .site-locale-field {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .home-nav-search {
    grid-column: 1 / 3;
    grid-row: 2;
    max-width: none;
  }
  .home-nav-user {
    grid-column: 1 / 3;
    grid-row: 3;
    max-width: none;
  }
  .home-links {
    grid-column: 1 / 3;
    grid-row: 4;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .home-links a.active::after {
    display: none;
  }
  .home-nav.no-nav-search .site-locale-field {
    grid-column: 2;
    grid-row: 1;
  }
  .home-nav.no-nav-search .home-nav-user {
    grid-column: 1 / 3;
    grid-row: 2;
    max-width: none;
  }
  .home-nav.no-nav-search .home-links {
    grid-column: 1 / 3;
    grid-row: 3;
  }
  .home-nav-search {
    flex: 1;
    width: auto;
  }
  .home-hero-grid,
  .home-page .ngb-body {
    grid-template-columns: 1fr;
  }
  .reading-galaxy {
    min-height: 330px;
  }
  .home-page .ngb-books {
    grid-template-columns: 1fr;
  }
}

.next-great-book {
  margin-bottom: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
}
.ngb-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.ngb-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 0.15rem;
}
.ngb-title {
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0;
}
.ngb-sub {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.25rem;
}
.ngb-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}
.ngb-select,
.ngb-chip,
.ngb-action {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
}
.ngb-select { min-width: 92px; }
.ngb-chip,
.ngb-action { cursor: pointer; }
.ngb-chip.active,
.ngb-action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ngb-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.ngb-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  background: #faf9ff;
}
.ngb-stat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.ngb-stat-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
}
.ngb-stat-num {
  display: block;
  font-size: 1rem;
  font-weight: 750;
}
.ngb-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
}
.ngb-steps {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ngb-step {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: #374151;
  font-size: 0.84rem;
}
.ngb-step-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ngb-books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.ngb-section-title {
  font-weight: 750;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}
.ngb-gap-access {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.85rem;
  padding-top: 0.7rem;
}
.ngb-inline-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  margin-left: 0.35rem;
  padding: 0;
}
.ngb-inline-action:disabled {
  cursor: wait;
  opacity: 0.65;
}
.ngb-gap-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.ngb-gap-word-list[hidden] {
  display: none;
}
.ngb-gap-word-list .chip-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  white-space: normal;
}
.ngb-rec-card {
  margin-bottom: 0;
}
.ngb-rec-reason {
  margin: 0.25rem 0 0.35rem;
  color: #374151;
  font-size: 0.82rem;
  line-height: 1.4;
}
.ngb-swap-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.42rem 0.6rem;
}
.ngb-empty,
.ngb-loading {
  color: var(--muted);
  font-size: 0.86rem;
}
@media (max-width: 900px) {
  .ngb-head,
  .ngb-body { grid-template-columns: 1fr; display: grid; }
  .ngb-books { grid-template-columns: 1fr; }
  .ngb-controls { justify-content: flex-start; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Login / member pick */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e8e0ff 0%, #f4f2fb 45%, #ddd6fe 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(107, 78, 255, 0.15);
  text-align: center;
}
.login-logo { font-size: 2.5rem; margin-bottom: 0.5rem; }
.login-logo-img {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  object-fit: contain;
}
.login-card h1 { color: var(--accent); font-size: 1.75rem; margin-bottom: 0.25rem; }
.login-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.login-hint { color: var(--muted); font-size: 0.8rem; margin-bottom: 1.5rem; }
.member-pick { display: flex; flex-direction: column; gap: 0.75rem; }
.member-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.member-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.member-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.member-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.member-role { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

.current-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 1rem;
  background: var(--accent-light);
  border-radius: 10px;
  font-size: 0.85rem;
}
.current-user-bar a { color: var(--accent); text-decoration: none; font-size: 0.8rem; }
.reader-status.me { font-weight: 600; }
.reader-status.readonly { opacity: 0.55; }
.icon-btn:disabled { cursor: not-allowed; opacity: 0.4; }

/* Profile */
.profile-page {
  background: var(--bg);
  min-height: 100vh;
}
.profile-main {
  box-sizing: border-box;
  width: 100%;
  padding: 1.25rem 0 2rem;
}
.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-reader-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  min-width: 0;
}
.profile-back {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.profile-reader-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.profile-reader-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.profile-reader-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.profile-hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 0.2rem;
}
.profile-hero h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0;
}
.profile-hero p {
  color: var(--muted);
  margin-top: 0.3rem;
}
.profile-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
.profile-hero-actions .btn {
  width: auto;
  min-width: 7rem;
}
.profile-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 0.6rem;
  min-width: 360px;
}
.profile-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf9ff;
  padding: 0.75rem;
}
.profile-stat strong {
  display: block;
  font-size: 1.35rem;
}
.profile-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
}
.profile-section-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}
.profile-section-nav a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.48rem 0.68rem;
  text-decoration: none;
}
.profile-section-nav a:hover,
.profile-section-nav a:focus-visible {
  background: var(--accent-light);
  color: var(--accent);
  outline: none;
}
.profile-anchor-target,
.profile-want-panel,
.profile-section-heading,
.profile-recent-panel {
  scroll-margin-top: 1rem;
}
.profile-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 0.7rem;
}
.profile-section-heading h2 {
  font-size: 1.15rem;
  line-height: 1.25;
}
.profile-section-heading > p {
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}
.profile-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.profile-vocab-panel {
  grid-row: span 2;
}
.profile-member-value-panel {
  margin-bottom: 1rem;
}

.profile-want-panel {
  margin-bottom: 1rem;
}

.profile-security-panel {
  margin-top: 1rem;
  scroll-margin-top: 1rem;
}
.profile-session-list {
  display: grid;
  gap: 0;
  margin-top: 0.8rem;
}
.profile-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}
.profile-session-row:first-child { border-top: 0; }
.profile-session-row > div { display: grid; gap: 0.16rem; min-width: 0; }
.profile-session-row span,
.profile-security-empty,
.profile-security-status { color: var(--muted); font-size: 0.78rem; }
.profile-security-status { min-height: 1.2rem; margin-top: 0.5rem; }
.profile-security-status.ok { color: var(--success); }
.profile-security-status.bad { color: var(--warning); }
.profile-security-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.55rem; }
.profile-credential-actions { margin-top: 0.65rem; }
.profile-credential-binding {
  display: grid;
  gap: 0.45rem;
  max-width: 28rem;
  margin-top: 0.7rem;
}
.profile-credential-binding input,
.profile-credential-binding select { min-width: 0; }
.profile-credential-binding > div { display: grid; gap: 0.45rem; }
.profile-credential-binding[hidden],
.profile-credential-binding > [hidden] { display: none; }

.profile-want-panel .panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.profile-want-item {
  min-width: 0;
}

.profile-want-reaction,
.profile-want-history {
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf9ff;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-want-reaction button {
  margin-left: 0.35rem;
}

.profile-want-history > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  margin-top: 0.55rem;
}
.profile-member-value-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 0.85rem;
}
.profile-member-value-list div {
  border-left: 1px solid var(--border);
  padding: 0.2rem 0.9rem;
}
.profile-member-value-list div:first-child {
  border-left: 0;
  padding-left: 0;
}
.profile-member-value-list strong,
.profile-member-value-list span {
  display: block;
}
.profile-member-value-list strong {
  font-size: 0.86rem;
  margin-bottom: 0.3rem;
}
.profile-member-value-list span,
.profile-member-value-message {
  color: var(--muted);
  font-size: 0.78rem;
}
.profile-member-value-message {
  margin-top: 0.55rem;
}
.profile-member-value-message[hidden] {
  display: none;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.panel-head h2 {
  font-size: 1rem;
}
.panel-head span {
  color: var(--muted);
  font-size: 0.78rem;
}
.profile-vocab-list {
  display: grid;
  gap: 0.65rem;
}
.profile-vocab-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1fr) 52px;
  align-items: center;
  gap: 0.75rem;
}
.profile-vocab-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.profile-vocab-main span,
.profile-vocab-row em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}
.profile-vocab-action {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
}
.profile-vocab-action summary,
.profile-gap-btn {
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
.profile-gap-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
}
.profile-gap-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}
.profile-gap-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.profile-gap-words[hidden] {
  display: none;
}
.profile-gap-words span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem 0.45rem;
  color: var(--text);
  background: #faf9ff;
}
.profile-meter,
.profile-bar {
  background: #eeeef6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.profile-meter span,
.profile-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.profile-bars {
  display: grid;
  gap: 0.48rem;
}
.profile-bar-row {
  display: grid;
  grid-template-columns: 82px minmax(120px, 1fr) 34px;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.profile-bar-row strong {
  text-align: right;
}
.profile-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.profile-tag-cloud span {
  border: 1px solid var(--border);
  background: #faf9ff;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}
.profile-tag-cloud em {
  color: var(--muted);
  font-style: normal;
}
.profile-recent {
  display: grid;
  gap: 0.85rem;
}
.profile-recent-panel {
  margin-top: 1rem;
}

.profile-recent-card {
  display: block;
}

.profile-book {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}
.profile-book img,
.profile-cover-fallback {
  width: 54px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: #f1efff;
  border: 1px solid var(--border);
}
.profile-cover-fallback {
  display: none;
  align-items: center;
  justify-content: center;
}
.profile-book h3 {
  font-size: 0.92rem;
  line-height: 1.25;
  margin: 0;
}
.profile-book p,
.profile-book small,
.profile-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.discover-main {
  box-sizing: border-box;
  display: grid;
  gap: 1rem;
  width: 100%;
}

.discover-hero,
.discover-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.discover-hero h1 {
  font-size: 2rem;
  line-height: 1.12;
  margin: 0;
}

.discover-hero p:last-child,
.discover-note {
  color: var(--muted);
  line-height: 1.55;
}

.discover-search-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(190px, 240px) auto;
  align-items: end;
  gap: 0.75rem;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.discover-grid > .discover-panel {
  padding: 0.75rem;
}

.discover-grid .panel-head {
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.discover-grid .panel-head span {
  margin-left: auto;
}

.discover-source-guide-link {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.discover-source-guide-link:hover {
  text-decoration: underline;
}

.discover-grid .discover-chip-list {
  gap: 0.38rem;
}

.discover-grid .discover-chip-list button,
.discover-grid .discover-chip-list > a:not(.discover-source-guide-link) {
  font-size: 0.78rem;
  padding: 0.34rem 0.56rem;
}

.discover-panel-wide {
  grid-column: 1 / -1;
}

.discover-series-panel {
  align-content: start;
  display: grid;
  gap: 0.75rem;
}

.discover-panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.discover-panel-actions .btn {
  width: auto;
  min-width: 8rem;
}

.discover-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.discover-chip-list button,
.discover-chip-list a {
  border: 1px solid #dbe3f1;
  border-radius: 999px;
  background: #fff;
  color: #26324f;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0.48rem 0.72rem;
  text-decoration: none;
}

.discover-chip-list button:hover,
.discover-chip-list a:hover {
  border-color: rgba(124, 77, 255, 0.42);
  color: var(--accent);
  background: #faf9ff;
}

.discover-tag-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1rem;
}

.discover-tag-group {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  min-width: 0;
}

.discover-tag-group h3 {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.discover-tag-extra[hidden] {
  display: none;
}

.discover-tag-more {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0.1rem 0;
}

.discover-tag-more:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {
  .discover-tag-groups {
    grid-template-columns: 1fr;
  }

  .profile-main {
    width: min(100%, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
  .profile-hero,
  .profile-top {
    align-items: stretch;
    flex-direction: column;
  }
  .profile-reader-controls,
  .profile-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .profile-reader-controls,
  .profile-reader-switch {
    justify-content: flex-start;
  }
  .profile-section-heading > p {
    text-align: left;
  }
  .profile-section-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .profile-section-nav a {
    flex: 0 0 auto;
  }
  .profile-hero-actions .btn {
    flex: 1 1 9rem;
  }
  .profile-stat-row,
  .profile-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .profile-vocab-panel {
    grid-row: auto;
  }
  .profile-member-value-list {
    grid-template-columns: 1fr;
  }
  .profile-session-row {
    align-items: stretch;
    flex-direction: column;
  }
  .profile-session-row .btn,
  .profile-security-actions .btn {
    width: 100%;
  }
  .profile-member-value-list div,
  .profile-member-value-list div:first-child {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 0.7rem 0;
  }
  .profile-member-value-list div:first-child {
    border-top: 0;
    padding-top: 0;
  }
  .profile-vocab-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .discover-search-grid,
  .discover-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin */
.admin-page {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  min-height: 100vh;
  background: #f7f7fb;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}
.admin-main {
  padding: 1.25rem;
  min-width: 0;
}
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-header h2 {
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
}
.admin-header p {
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-height: 4rem;
}
.admin-summary-loading,
.admin-summary-error {
  grid-column: 1 / -1;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-entity-assets {
  margin: 0 0 0.85rem;
  padding: 0.9rem;
  border: 1px solid #d9e2f2;
  border-radius: 10px;
  background: #fff;
}

.admin-entity-assets-head,
.admin-entity-assets-search,
.admin-entity-assets-summary,
.admin-entity-assets-pagination,
.admin-entity-asset-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.admin-entity-assets-head { justify-content: space-between; }
.admin-entity-assets-head h3 { margin: 0.08rem 0 0; }
.admin-entity-assets > p { color: #64748b; font-size: 0.82rem; line-height: 1.45; }
.admin-entity-assets-search { margin: 0.75rem 0; }
.admin-entity-assets-search .admin-input { min-width: 10rem; }
.admin-entity-assets-search input.admin-input { flex: 1; }
.admin-entity-assets-summary { flex-wrap: wrap; color: #475569; font-size: 0.78rem; }
.admin-entity-assets-summary b { color: #1e293b; }
.admin-entity-assets-summary span { padding: 0.18rem 0.48rem; border-radius: 999px; background: #f1f5f9; }
.admin-entity-assets-pagination { justify-content: center; margin-top: 0.75rem; color: #64748b; font-size: 0.78rem; }
.admin-entity-assets-list { display: grid; gap: 0.45rem; max-height: 560px; overflow: auto; }
.admin-entity-asset-row { display: grid; grid-template-columns: 42px minmax(260px, 1fr) minmax(210px, .7fr); padding: 0.6rem 0.42rem; border-top: 1px solid #edf1f7; }
.admin-entity-asset-row strong, .admin-entity-asset-row span { display: block; }
.admin-entity-asset-row span { color: #64748b; font-size: 0.76rem; margin-top: 0.12rem; }
.admin-entity-asset-row code { min-width: 0; color: #475569; font-size: 0.7rem; overflow-wrap: anywhere; }
.admin-entity-asset-preview, .admin-entity-asset-placeholder { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: center 35%; }
.admin-entity-asset-placeholder { display: grid; place-items: center; background: #ede9fe; color: #6d4aff; font-weight: 900; }
.admin-entity-asset-status { width: fit-content; margin-top: 0.25rem !important; padding: 0.08rem 0.34rem; border-radius: 999px; font-size: 0.7rem !important; font-weight: 800; }
.admin-entity-asset-status.ready { color: #166534; background: #dcfce7; }
.admin-entity-asset-status.missing { color: #9a3412; background: #ffedd5; }
.admin-entity-asset-works { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.35rem; }
.admin-entity-asset-works b { color: #475569; font-size: 0.72rem; }
.admin-entity-asset-work { display: inline-flex !important; align-items: center; gap: 0.18rem; margin: 0 !important; color: #334155 !important; }
.admin-entity-asset-work img { width: 20px; height: 28px; border-radius: 2px; object-fit: cover; background: #f1f5f9; }
.admin-entity-asset-work em { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; font-style: normal; }
.admin-entity-asset-no-works { margin: 0 !important; }
.admin-entity-asset-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 0.35rem; }
.admin-entity-asset-actions code { flex-basis: 100%; text-align: right; }
@media (max-width: 760px) {
  .admin-entity-assets-search { align-items: stretch; flex-direction: column; }
  .admin-entity-asset-row { grid-template-columns: 42px minmax(0, 1fr); }
  .admin-entity-asset-actions { grid-column: 2; justify-content: flex-start; }
  .admin-entity-asset-actions code { text-align: left; }
}
.admin-summary-error {
  color: #b45309;
  border-color: #fcd34d;
  background: #fffbeb;
}
.admin-job-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(49, 46, 129, 0.08);
}
.admin-job-panel.running,
.admin-job-panel.starting {
  border-color: #a5b4fc;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}
.admin-job-panel.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.admin-job-panel.bad {
  border-color: #fed7aa;
  background: #fff7ed;
}
.admin-job-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.admin-job-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.admin-job-head h3 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  line-height: 1.35;
}
.admin-job-state {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
}
.admin-job-progress {
  height: 0.72rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.admin-job-progress-bar {
  height: 100%;
  min-width: 0.35rem;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width 0.25s ease;
}
.admin-job-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.7rem;
}
.admin-job-stats span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 0.28rem 0.65rem;
  color: var(--text);
  font-size: 0.82rem;
}
.admin-job-current {
  margin-top: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-job-errors {
  margin-top: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}
.admin-job-errors summary {
  cursor: pointer;
  font-weight: 700;
}
.admin-job-error {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}
.admin-job-error span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-metric,
.admin-wide {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
}
.admin-metric-link {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-metric-link:hover {
  border-color: #a78bfa;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}
.admin-metric-link.is-selected {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}
.admin-scope-hint {
  font-size: 0.82rem;
  color: #5b21b6;
  font-weight: 600;
  align-self: center;
  white-space: nowrap;
}
.btn-offline {
  border-color: #f59e0b;
  color: #92400e;
  background: #fffbeb;
}
.btn-offline:hover {
  background: #fef3c7;
}
.admin-filter-ready.is-active {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}
.admin-filter-ready.is-active:hover {
  background: #bbf7d0;
}
.admin-metric strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.2;
}
.admin-metric span,
.admin-wide {
  color: var(--muted);
  font-size: 0.84rem;
}
.admin-metric small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.25rem;
}
.lang-metric {
  background: #fbfbff;
}
.admin-wide {
  grid-column: span 2;
}
.admin-wide b {
  color: var(--text);
  display: block;
  margin-bottom: 0.45rem;
}
.admin-lang-breakdown {
  display: grid;
  gap: 0.35rem;
}
.admin-lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.admin-lang-row b {
  display: inline;
  margin: 0;
  min-width: 2.5rem;
}
.admin-lang-row span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fafafa;
  color: #374151;
  font-size: 0.75rem;
  padding: 0.16rem 0.42rem;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fafafa;
  color: #374151;
  font-size: 0.75rem;
  padding: 0.18rem 0.45rem;
  margin: 0 0.3rem 0.3rem 0;
}
.admin-toolbar,
.admin-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-input,
.admin-select {
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 0.65rem;
  font-size: 0.86rem;
}
.admin-input {
  min-width: min(360px, 100%);
  flex: 1;
}
.admin-card-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.admin-select-all {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem;
  color: #4b5563;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border);
}
.admin-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  padding: 0.85rem;
}
.admin-book-card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem 0.85rem 0.75rem 2.35rem;
}
.admin-book-row {
  display: grid;
  /* 左：前台预览 | 中：后台资产（两列，吃剩余宽度）| 右：状态+操作（尽量窄） */
  grid-template-columns: minmax(280px, 340px) minmax(480px, 2fr) minmax(210px, 240px);
  gap: 0.65rem 0.6rem;
  align-items: start;
}
.admin-book-preview {
  min-width: 0;
  max-width: 400px;
}
.admin-book-rail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.55rem;
  border-left: 1px solid var(--border);
  padding-left: 0.55rem;
  max-width: 240px;
  min-height: 0;
}
.admin-rail-top {
  display: grid;
  gap: 0.45rem;
}
.admin-rail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-rail-actions .btn.block {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-size: 0.72rem;
}
.admin-rail-top .admin-suggestion {
  font-size: 0.72rem;
  padding: 0.4rem 0.45rem;
}
.admin-duplicate-risk {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
  background: #fff7ed;
  border-color: #fed7aa;
}
.admin-duplicate-risk b {
  color: #9a3412;
}
.admin-duplicate-risk ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.admin-duplicate-risk li {
  display: grid;
  gap: 0.05rem;
  border-top: 1px solid rgba(251, 146, 60, 0.35);
  padding-top: 0.25rem;
}
.admin-duplicate-risk span,
.admin-duplicate-risk small {
  color: #6b7280;
  overflow-wrap: anywhere;
}
.admin-duplicate-risk.duplicate-danger {
  background: #fff1f2;
  border-color: #fecdd3;
}
.admin-duplicate-risk.duplicate-danger b {
  color: #be123c;
}
.admin-rail-top .admin-status-lines {
  font-size: 0.72rem;
  gap: 0.2rem;
}
.admin-frontend-preview.admin-preview-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  border: 2px solid #c4b5fd;
  border-radius: 16px;
  padding: 1rem 1rem 0.75rem;
  margin: 0;
  box-shadow: 0 4px 16px rgba(107, 78, 255, 0.08);
}
.admin-frontend-preview .card-head {
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1fr);
}
.admin-preview-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.admin-preview-badge.ready {
  background: #dcfce7;
  color: #166534;
}
.admin-preview-badge.pending {
  background: #fef3c7;
  color: #92400e;
}
.admin-preview-summary {
  margin-top: 0.35rem;
}
.admin-preview-summary .summary-text {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #4b5563;
  max-height: 5.5rem;
  overflow-y: auto;
}
.admin-coverage-all .cov-line {
  font-size: 0.66rem;
}
.admin-ops-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.65rem 0.75rem;
  min-width: 0;
  align-self: stretch;
}
.admin-ops-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e7eb;
}
.admin-ops-head .admin-section-title {
  margin: 0;
  white-space: nowrap;
  color: #1e1b4b;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}
.admin-ops-head .admin-ops-edit-btn {
  width: auto !important;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--accent) !important;
  background: #fff !important;
  border: 1px solid #c4b5fd !important;
  border-radius: 6px;
  padding: 0.12rem 0.45rem !important;
  text-decoration: none;
}
.admin-ops-head .admin-ops-edit-btn:hover {
  background: #f5f3ff !important;
}
.admin-ops-panel.is-editing {
  background: #fff;
  border-color: #c4b5fd;
}
.admin-section-title {
  font-size: 0.82rem;
  color: #4b5563;
  font-weight: 700;
}
.admin-ops-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.55rem;
}
.admin-ops-edit {
  display: grid;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #6b7280;
}
.admin-ops-edit.wide {
  grid-column: 1 / -1;
}
.admin-ops-edit input,
.admin-ops-edit textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.45rem;
  width: 100%;
}
.admin-ops-edit textarea {
  min-height: 4.5rem;
  resize: vertical;
}
.admin-ops-savebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.admin-ops-readonly.admin-ops-readonly-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 0.22rem;
}
.admin-ops-kv--full {
  grid-column: 1 / -1;
}
.admin-ops-kv--full .admin-ops-v {
  line-height: 1.4;
}
.admin-ops-readonly {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.admin-ops-kv {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
}
.admin-ops-k {
  flex: 0 0 5.2em;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}
.admin-ops-v {
  flex: 1;
  min-width: 0;
  color: #111827;
  overflow-wrap: anywhere;
}
.admin-ops-v code {
  font-size: 0.68rem;
}
.admin-book-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(107, 78, 255, 0.12);
}
.admin-card-check {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-card-cover {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}
.admin-card-cover .cover-wrap {
  width: 100%;
  aspect-ratio: 2 / 3;
}
.admin-card-main {
  min-width: 0;
  display: grid;
  gap: 0.55rem;
}
.admin-card-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.75rem;
}
.admin-card-title {
  font-size: 1rem;
  line-height: 1.25;
  margin: 0;
}
.admin-card-title-zh {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.admin-tags {
  justify-content: flex-start;
}
.admin-suggestion {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
}
.admin-suggestion b {
  font-size: 0.8rem;
}
.admin-suggestion span {
  color: #4b5563;
}
.suggestion-hide {
  background: #fff1f2;
  border-color: #fecdd3;
}
.suggestion-hide b {
  color: #be123c;
}
.suggestion-review {
  background: #fffbeb;
  border-color: #fde68a;
}
.suggestion-review b {
  color: #92400e;
}
.suggestion-active {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.suggestion-active b {
  color: #166534;
}
.admin-summary-text {
  color: #374151;
  font-size: 0.82rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.admin-card-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.admin-card-fields > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  padding: 0.5rem;
  min-width: 0;
}
.admin-card-fields b {
  display: block;
  color: #4b5563;
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}
.admin-card-fields span {
  color: #374151;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}
.admin-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.admin-edit-panel {
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.admin-edit-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}
.admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.admin-edit-field {
  display: grid;
  gap: 0.25rem;
  color: #4b5563;
  font-size: 0.76rem;
}
.admin-edit-field.wide {
  grid-column: 1 / -1;
}
.admin-edit-field input,
.admin-edit-field textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 0.45rem 0.55rem;
  width: 100%;
}
.admin-edit-field textarea {
  min-height: 5.5rem;
  resize: vertical;
}
.admin-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}
.admin-edit-hint {
  color: var(--muted);
  font-size: 0.76rem;
}
.missing-level {
  background: #fee2e2;
  color: #991b1b;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  color: #4b5563;
  background: #f9fafb;
  font-weight: 700;
}
.admin-book-title {
  font-weight: 750;
  max-width: 320px;
}
.admin-book-meta,
.admin-book-id,
.admin-file,
.admin-folder {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.15rem;
}
.admin-book-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.admin-folder {
  max-width: 360px;
  overflow-wrap: anywhere;
}
.admin-status-lines {
  display: grid;
  gap: 0.22rem;
}
.status-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}
.status-active { background: #dcfce7; color: #166534; }
.status-review { background: #fef3c7; color: #92400e; }
.status-draft { background: #e0f2fe; color: #075985; }
.status-hidden { background: #f3f4f6; color: #4b5563; }
.admin-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 260px;
}
.admin-missing,
.admin-ok {
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  font-size: 0.72rem;
}
.admin-missing {
  background: #fee2e2;
  color: #991b1b;
}
.admin-ok {
  background: #dcfce7;
  color: #166534;
}
.admin-file.online { color: var(--success); }
.admin-file.offline { color: var(--warning); }
.admin-row-actions {
  min-width: 150px;
}
.admin-row-actions .btn {
  margin: 0 0.25rem 0.25rem 0;
}
.admin-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
}
.admin-folder-scope {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.85rem;
  margin: 0 0.85rem 0.5rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #312e81;
}
.admin-folder-scope span {
  overflow-wrap: anywhere;
}
.admin-action-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.38;
  min-height: 2.4rem;
  max-height: none;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.admin-action-status:empty {
  display: none;
}
.admin-action-status.ok { color: var(--success); }
.admin-action-status.bad { color: var(--warning); }
.admin-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem !important;
}
@media (min-width: 981px) and (max-width: 1400px) {
  .admin-book-row {
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  }
  .admin-book-rail {
    grid-column: 1 / -1;
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 0.75rem;
  }
}
@media (max-width: 980px) {
  .admin-page { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
  }
  .admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-wide { grid-column: span 2; }
  .admin-book-row {
    grid-template-columns: 1fr;
  }
  .admin-book-preview,
  .admin-frontend-preview.admin-preview-card {
    max-width: none;
  }
  .admin-book-rail {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 0.75rem;
  }
  .admin-ops-edit-grid,
  .admin-ops-readonly.admin-ops-readonly-cols { grid-template-columns: 1fr; }
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  min-height: 100vh;
}

.folder-nav {
  background: #faf9ff;
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  font-size: 0.78rem;
}
.admin-folder-nav {
  background: #faf9ff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.45rem;
  overflow: visible;
  position: static;
  height: auto;
  min-height: 260px;
  font-size: 0.78rem;
}
.folder-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.folder-nav-head strong { color: var(--accent); font-size: 0.85rem; }
.brand-row { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.site-logo {
  display: block;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.site-logo-sm { width: 28px; height: 28px; border-radius: 6px; }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.sidebar-brand-text { min-width: 0; }
.sidebar-brand h1 { font-size: 1.4rem; color: var(--accent); margin: 0; line-height: 1.2; }
.sidebar-brand .subtitle { margin-bottom: 0; }
.btn.small { font-size: 0.72rem; padding: 0.15rem 0.4rem; }
.folder-tree { line-height: 1.35; }
.folder-node { margin: 0; }
.folder-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}
.folder-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  color: var(--text);
  font-size: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.folder-item:hover { background: var(--accent-light); }
.folder-item.active { background: var(--accent); color: #fff; }
.folder-item .count { color: var(--muted); font-size: 0.68rem; margin-left: auto; flex-shrink: 0; }
.folder-item.active .count { color: rgba(255,255,255,0.85); }
.folder-toggle {
  width: 1rem;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.65rem;
  padding: 0;
}
.folder-children { margin-left: 0.65rem; border-left: 1px solid var(--border); }
.folder-children.collapsed { display: none; }
.folder-err { color: #b91c1c; padding: 0.5rem; font-size: 0.75rem; line-height: 1.4; }
.folder-err small { color: var(--muted); }
.dup-section-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  margin: 0.65rem 0 0.35rem; padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.dup-group .dup-section-label:first-of-type { border-top: none; margin-top: 0.25rem; }

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}


.sidebar h1 { font-size: 1.4rem; color: var(--accent); }
.subtitle { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }

.lexile-bands-field .muted-hint { font-weight: 400; color: var(--muted); font-size: 0.72rem; }
.lexile-bands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.lexile-band-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text);
}
.lexile-band-btn:hover { border-color: var(--accent); color: var(--accent); }
.lexile-band-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.nav-link-row { margin: 0.5rem 0 0.75rem; font-size: 0.85rem; }
.nav-link-row a { color: var(--accent); text-decoration: none; font-weight: 600; }

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.award-lists {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  background: #fef3c7;
  border-radius: 12px;
  border: 1px solid #fde68a;
}
.filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.5rem;
}
.award-list-btn {
  width: 100%;
  margin-bottom: 0.4rem;
  background: #fff;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  font-weight: 600;
}
.award-list-btn.active {
  background: #f59e0b;
  color: #fff;
}
.btn.linkish {
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: underline;
  margin-top: 0.25rem;
}
.lexile-pill.raz { background: #0ea5e9; }

.lang-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.lang-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.field {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.reader-filter { font-size: 0.85rem; margin-bottom: 1rem; }
.reader-filter label { display: block; margin: 0.25rem 0; cursor: pointer; }

.btn {
  width: 100%;
  padding: 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.coverage-tool { margin-top: 1rem; font-size: 0.85rem; }
.cov-result {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--accent-light);
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: pre-wrap;
}

main { padding: 1rem 1.25rem; min-width: 0; overflow-x: hidden; }

.recent-reading {
  margin-bottom: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
}
.recent-title {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  color: var(--accent);
}
.activity-grid {
  display: grid;
  gap: 1rem;
}
.parent-grid {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 800px) {
  .parent-grid { grid-template-columns: 1fr; }
}
.activity-block h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}
.activity-stats {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--muted);
}
.activity-block h3 { margin-bottom: 0; }

.list-batch {
  break-inside: avoid;
  margin-bottom: 1.75rem;
}
.batch-heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.book-list-ts {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.15rem 0 0.35rem;
}
.masonry.list-mode .batch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.react-who {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.25rem;
}
.reaction-picker.react-readonly .react-btn {
  pointer-events: none;
  opacity: 0.85;
}
.reaction-picker.react-readonly .react-btn:not(.active) {
  opacity: 0.45;
}
.activity-list {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
}
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.activity-item:last-child { border-bottom: none; }
.act-icon {
  grid-row: 1 / 3;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.activity-item.act-read .act-icon { background: #dcfce7; color: #166534; }
.activity-item.act-want .act-icon { background: #fce7f3; color: #9d174d; }
.act-title {
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
}
.activity-empty {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.5rem 0;
}

.vocab-retry-bar {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
.vocab-retry-bar.is-active,
.vocab-retry-bar:not([hidden]) {
  display: flex;
}
.vocab-retry-bar[hidden] {
  display: none !important;
}
.vocab-retry-cancel {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.vocab-retry-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}
.vocab-retry-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vocab-retry-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes vocab-retry-spin {
  to { transform: rotate(360deg); }
}

.topbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.library-health {
  margin: -0.35rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.library-health.warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.library-health.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.file-offline-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.filter-search {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
}
.filter-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  background: var(--bg);
}
.filter-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filter-shortcut {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid #f59e0b;
  background: #fff;
  color: #92400e;
  border-radius: 999px;
}
.filter-shortcut.active {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.filter-adds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filter-add {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text);
  max-width: 140px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
}
.active-filter-label {
  color: var(--muted);
  font-weight: 600;
}
.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-light);
  border-radius: 999px;
  color: #4338ca;
}
.active-filter-clear {
  border: none;
  background: none;
  padding: 0 0.15rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}
.active-filter-clear:hover { opacity: 1; }

.masonry.list-mode {
  column-width: unset;
  column-count: unset;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.list-batch {
  margin-bottom: 1.75rem;
}
.batch-heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.batch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.book-list-ts {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.15rem 0 0.35rem;
}
.react-who {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.25rem;
}
.reaction-picker.react-readonly .react-btn {
  cursor: default;
  opacity: 0.85;
}
.reaction-picker.react-readonly .react-btn:not(.active) {
  opacity: 0.45;
}

.book-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.book-card-grid .book-card {
  width: 100%;
  margin: 0;
}

.book-card-grid .nb-asset-card {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.discover-results-grid {
  width: 100%;
}

.discover-page .discover-results-grid.book-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.discover-page .discover-results-grid.book-card-grid > .book-card,
.discover-page .discover-results-grid.book-card-grid > .nb-entity-card,
.discover-page .discover-results-grid.book-card-grid > .nb-asset-card,
.discover-page .discover-results-grid.book-card-grid > .empty {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.discover-page .discover-results-grid.book-card-grid > .book-card,
.discover-page .discover-results-grid.book-card-grid > .nb-asset-card,
.discover-page .discover-results-grid.book-card-grid > .empty {
  display: block;
}

.discover-page .discover-results-grid.book-card-grid > .nb-entity-card {
  display: grid;
}

@media (max-width: 760px) {
  .discover-page .discover-results-grid.book-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.discover-series-result-card .series-cover-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: #f8f7ff;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

/* Book grid — 从左到右、从上到下排列（排序顺序与视觉一致） */
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.9rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .folder-nav { position: static; height: auto; max-height: 240px; }
  .sidebar { position: static; height: auto; }
  .masonry { grid-template-columns: 1fr; }
}

.book-card {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 0;
  background: #f4f4f7;
  border-radius: 22px;
  border: 1px solid #ececf2;
  padding: 1.05rem 1.05rem 0.95rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.book-card:hover {
  box-shadow: 0 8px 28px rgba(107, 78, 255, 0.14);
  border-color: var(--accent);
}
.book-card.selected { border-color: var(--accent); outline: 2px solid rgba(107, 78, 255, 0.25); }

.author-card {
  cursor: pointer;
}

.author-card .meta-line {
  margin: 0.25rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.author-card .card-actions {
  border-top: 1px solid var(--border);
  margin-top: 0.8rem;
  padding-top: 0.7rem;
}

.author-card .btn {
  width: auto;
}

.card-top {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.card-top.no-signals {
  margin-bottom: 0.45rem;
}

.card-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(142px, 0.68fr);
  gap: 0.65rem 0.9rem;
  align-items: start;
  margin: 0;
}

.card-top-right {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.nb-book-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e8eef8;
  border-bottom: 1px solid #e8eef8;
  margin-top: 0.05rem;
}

.nb-book-metric {
  min-width: 0;
  border: 0;
  border-left: 1px solid #e8eef8;
  background: transparent;
  padding: 0.34rem 0.45rem;
  text-align: left;
}

.nb-book-metric:nth-child(2n + 1) {
  border-left: 0;
}

.nb-book-metric-grid > :nth-child(n + 3) {
  border-top: 1px solid #e8eef8;
}

.nb-book-coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  border-bottom: 1px solid #e8eef8;
  padding: 0.34rem 0.45rem;
}

.nb-book-coverage-summary {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.nb-book-coverage-summary span {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 850;
}

.nb-book-coverage-summary b {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.2;
}

.nb-book-coverage-row .nb-coverage-all-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: right;
}

.nb-book-metric b {
  display: block;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.nb-book-metric span {
  display: block;
  margin-top: 0.12rem;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.2;
}

.nb-book-paid-metric b {
  color: #6d4aff;
}

.nb-book-paid-metric-trigger {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.nb-book-paid-metric-trigger:focus-visible,
.nb-coverage-all-trigger:focus-visible {
  outline: 2px solid rgba(109, 74, 255, 0.34);
  outline-offset: -2px;
}

.nb-recommendation-reason {
  display: flex;
  gap: 0.38rem;
  margin-top: 0.54rem;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 0.48rem;
  background: rgba(255, 251, 235, 0.72);
  padding: 0.42rem 0.52rem;
  color: #475569;
  font-size: 0.68rem;
  line-height: 1.45;
}

.nb-recommendation-reason strong {
  flex: 0 0 auto;
  color: #92400e;
}

.cover-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 106px;
}
.cover-wrap {
  position: relative;
  width: 104px;
  height: 156px;
  border-radius: 0;
  overflow: visible;
  border: 3px solid #c4b5fd;
  background: linear-gradient(145deg, #ede9ff, #ddd6fe);
}
.cover-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.series-cover-wrap::before,
.series-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 7px -7px -7px 7px;
  border: 2px solid rgba(124, 58, 237, 0.32);
  background: linear-gradient(145deg, #fff7ed, #dbeafe);
  z-index: 0;
}
.series-cover-wrap::after {
  inset: 13px -13px -13px 13px;
  opacity: 0.55;
}
.series-cover-wrap .cover-img,
.series-cover-wrap .cover-fallback {
  position: relative;
  z-index: 2;
}
.series-cover-stack {
  position: absolute;
  inset: 0;
}
.series-cover-layer {
  position: absolute !important;
  top: 0;
  width: 78%;
  height: 100%;
  object-fit: cover;
  border: 3px solid #c4b5fd;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.series-cover-layer.layer-1 {
  left: 0;
  z-index: 3 !important;
}
.series-cover-layer.layer-2 {
  right: 0;
  z-index: 2 !important;
  transform: translateY(8px);
  opacity: 0.94;
}
.series-cover-count-1 .series-cover-layer {
  width: 100%;
  right: auto;
  transform: none;
}
.cover-img.cover-missing { display: none; }
.cover-fallback {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  font-size: 2rem; color: var(--accent);
}
.cover-img.cover-loaded ~ .cover-fallback { display: none; }
.cover-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 0.3rem;
  margin-top: 0.42rem;
}
.cover-metric-row.single {
  display: flex;
  justify-content: center;
}
.cover-metric-row.single .level-pill {
  min-width: min(100%, 8rem);
}

.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  background: var(--accent);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 950;
  padding: 0.18rem 0.28rem;
  border-radius: 9px;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}
.commercial-series-card .level-pill {
  font-size: 0.64rem;
  padding-inline: 0.12rem;
  letter-spacing: 0;
}

.commercial-series-card .cover-metric-row {
  grid-template-columns: minmax(66px, 1.15fr) minmax(44px, 0.85fr);
  gap: 0.18rem;
}
.level-pill.raz { background: #0ea5e9; }
.level-pill.cefr { background: #7c3aed; }
.level-pill.estimated { background: #7c3aed; }
.level-pill.age-ar {
  background: #1da8f2;
}
.lexile-pill {
  position: absolute; left: 4px; bottom: 4px;
  background: var(--accent); color: #fff;
  font-size: 0.62rem; font-weight: 700;
  padding: 0.15rem 0.4rem; border-radius: 6px;
}
.book-signal-overview {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  padding-top: 0.2rem;
  padding-right: 4rem;
  margin-left: -0.08rem;
}

.commercial-series-card .series-card-link {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.commercial-series-card .series-card-link:hover {
  text-decoration: underline;
}

.signal-row {
  display: inline-grid;
  grid-template-columns: 20px minmax(0, auto);
  align-items: center;
  gap: 0.34rem;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: #6f7786;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.12;
  max-width: 100%;
}

.signal-row.signal-link {
  text-decoration: none;
}

.signal-row.signal-link:hover span:last-child {
  text-decoration: underline;
}

.signal-row span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-more {
  display: contents;
  position: static;
  z-index: 3;
  background: var(--card, #fff);
  padding-left: 0;
  max-width: 100%;
  min-width: 0;
}

.signal-more summary {
  position: absolute;
  top: 0;
  right: 0;
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.signal-more summary::-webkit-details-marker {
  display: none;
}

.nb-source-overflow-trigger {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.signal-more-panel {
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
  margin-top: 0.14rem;
  padding: 0.52rem 0.62rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 0.56rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
}

.signal-icon {
  display: inline-grid;
  place-items: center;
  color: #ef1f2a;
  font-size: 1.35rem;
  line-height: 1;
}

.signal-commerce .signal-icon {
  color: #ef4444;
}

.signal-more-btn {
  position: absolute;
  top: 0.1rem;
  right: 0;
  border: 0;
  background: transparent;
  color: #6d28d9;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.cover-trend-badge {
  position: absolute;
  left: -5px;
  top: -9px;
  z-index: 2;
  max-width: 100px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ff6546;
  color: #fff;
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.tag-col-single {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  min-height: 0;
}
.card-coverage-col {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  min-height: 0;
  align-content: start;
  border-left: 1px solid var(--border);
  padding-left: 0.9rem;
}
.col-heading {
  font-size: 0.68rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}
.col-heading.section-gap {
  margin-top: 0.35rem;
}
.metric-row,
.cov-line {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: baseline;
  border-bottom: 0;
  padding: 0;
  line-height: 1.25;
}
.metric-row span,
.cov-line span {
  color: #687083;
  font-size: 0.86rem;
  font-weight: 850;
}
.metric-row b {
  color: #2563eb;
  font-size: 0.86rem;
  font-weight: 950;
  text-align: right;
}
.cov-line b {
  color: #e11d48;
  font-size: 0.86rem;
  font-weight: 950;
  text-align: right;
}
.cov-pairs {
  display: grid;
  gap: 0.08rem;
}
.coverage-expand-btn {
  min-width: 58px;
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.28rem 0 0;
  margin-left: auto;
  text-align: right;
}
.coverage-expand-btn:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.coverage-all-panel {
  display: block;
  grid-column: 1 / -1;
  margin-top: 0.14rem;
  padding: 0.44rem;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 0.52rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.coverage-all-panel[hidden] {
  display: none;
}

.book-card > .card-expansion-stack {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0.62rem;
  margin-top: 0.58rem;
  padding-top: 0.58rem;
  border-top: 1px solid rgba(226, 232, 240, 0.96);
  box-sizing: border-box;
}

.book-card > .card-expansion-stack:not(:has(> [data-expanded-panel]:not([hidden]))) {
  display: none;
}

.book-card > .card-expansion-stack > .signal-more-panel,
.book-card > .card-expansion-stack > .coverage-all-panel,
.book-card > .card-expansion-stack > .nb-book-content-panel {
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.nb-book-content-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
  margin-top: 0.38rem;
}

.nb-book-content-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
}

.nb-book-content-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.55rem;
  border: 1px solid rgba(196, 181, 253, 0.68);
  border-radius: 999px;
  background: #faf9ff;
  color: #65508c;
  padding: 0.18rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 780;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.nb-book-content-trigger {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0.22rem 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.nb-book-content-trigger:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nb-book-content-panel {
  display: grid;
  gap: 0.72rem;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 0.52rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  padding: 0.72rem;
}

.nb-book-content-panel[hidden] {
  display: none;
}

.nb-book-content-section h4 {
  margin: 0 0 0.4rem;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 900;
}

.nb-book-full-summary {
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.58;
  white-space: pre-line;
}

@media (max-width: 560px) {
  .nb-book-content-overview {
    align-items: flex-start;
  }

  .nb-book-content-tags {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .nb-book-content-overview .nb-book-content-tag {
    max-width: 8.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nb-book-content-panel {
    padding: 0.62rem;
  }
}
.coverage-all-heading {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin-bottom: 0.34rem;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
}
.plus-preview-badge {
  margin-left: auto;
  border-radius: 999px;
  background: #f0edff;
  color: #6d4aff;
  padding: 0.14rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 900;
  white-space: nowrap;
}
.plus-dedup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.34rem;
  border: 1px solid rgba(196, 181, 253, 0.68);
  border-radius: 0.42rem;
  background: #faf9ff;
  padding: 0.3rem 0.42rem;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 850;
}
.plus-dedup-row b {
  color: #6d4aff;
  font-size: 0.72rem;
  font-weight: 950;
}
.coverage-info-mark {
  display: inline-grid;
  place-items: center;
  width: 0.86rem;
  height: 0.86rem;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 999px;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}
.coverage-all-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 0.42rem;
  background: rgba(255, 255, 255, 0.86);
}
.coverage-all-grid .cov-line {
  display: grid;
  grid-template-columns: minmax(2.2rem, 0.9fr) minmax(2.4rem, 1fr);
  align-items: center;
  column-gap: 0.18rem;
  min-height: 1.72rem;
  padding: 0.2rem 0.28rem;
  border-right: 1px solid rgba(226, 232, 240, 0.96);
  border-bottom: 1px solid rgba(226, 232, 240, 0.96);
  line-height: 1.12;
}
.coverage-all-grid .cov-line:nth-child(4n) {
  border-right: 0;
}
.coverage-all-grid .cov-line:nth-last-child(-n + 4) {
  border-bottom: 0;
}
.coverage-all-grid .cov-line span,
.coverage-all-grid .cov-line b {
  font-size: 0.66rem;
  line-height: 1.08;
}
.coverage-all-grid .cov-line span {
  color: #475569;
  font-weight: 820;
  justify-self: start;
  white-space: nowrap;
}
.coverage-all-grid .cov-line b {
  color: #1d4ed8;
  font-weight: 900;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.chip-list {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-top: 0;
}
.chip-list[hidden] {
  display: none;
}
.chip-tag {
  display: flex;
  align-items: center;
  gap: 0.36rem;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.25;
  color: #8a909d;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 0;
  max-width: 100%;
}
.chip-tag.muted { color: var(--muted); font-weight: 500; }
.chip-tag.chip-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.25;
  color: inherit;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.chip-tag.chip-link:hover { color: #7c3aed; }
.chip-tag.chip-award {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  align-items: flex-start;
}
.chip-tag.chip-award .chip-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.chip-tag.chip-award .chip-icon {
  color: #d97706;
  margin-top: 0.12em;
}
.chip-tag.chip-theme .chip-icon { color: #9298a4; }
.chip-tag.chip-warn { color: #b45309; }
.chip-tag.chip-warn .chip-icon { color: #dc2626; }
.chip-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
.bookmark-btn {
  display: none;
}
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0;
  min-width: 0;
}
.want-btn,
.read-btn {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
  border: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.48rem 1rem;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
}
.want-btn:hover, .read-btn:hover { border-color: var(--accent); color: var(--accent); }
.want-btn.active {
  background: #fff0f1;
  color: #ef1f2a;
  font-weight: 700;
}
.want-btn.active svg { fill: #ef1f2a; stroke: #ef1f2a; }
.read-btn .read-icon { font-size: 0.85rem; }
.read-btn.active {
  background: #eaf7ff;
  color: #1da8f2;
  font-weight: 700;
}
.read-btn.pending {
  background: #fff7ed;
  color: #ea580c;
  font-weight: 700;
}
.meta-item.age { color: #7c3aed; font-weight: 600; }
.meta-item.ar { color: #b45309; font-weight: 600; }

/* 词汇多选：默认隐藏右上角勾选框 */
.select-check { display: none; }
body.select-mode .select-check { display: block; }
body.select-mode .book-card .select-check { position: absolute; top: 0.55rem; right: 0.55rem; z-index: 2; }
.book-title {
  font-size: 1.42rem; font-weight: 950; line-height: 1.22;
  margin: 0.4rem 0 0.25rem;
  display: block;
  overflow-wrap: anywhere;
}
.book-title-line {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
}
.book-title-text {
  min-width: 0;
}
.book-language-badge-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
}
.book-language-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.16rem;
  padding: 0.06rem 0.18rem;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 0.35rem;
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  font-size: 0.52rem;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.04em;
}
.book-language-badge.lang-es {
  border-color: rgba(14, 165, 233, 0.24);
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}
.book-language-badge.lang-zh {
  border-color: rgba(234, 88, 12, 0.26);
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
}
.book-title-zh {
  font-size: 0.84rem;
  font-weight: 600;
  color: #6d28d9;
  line-height: 1.35;
  margin: -0.05rem 0 0.25rem;
}
.book-author { font-size: 1rem; color: var(--muted); margin-bottom: 0.12rem; }
.author-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.author-link:hover { color: #7c3aed; }
.book-series { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.65rem; }
.series-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #7c3aed;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.series-link:hover { color: #5b21b6; }
.age-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #7c3aed;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.age-link:hover { color: #5b21b6; }
.card-footer {
  padding-top: 0.5rem; border-top: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.card-bottom {
  padding-top: 0.48rem;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.card-bottom-primary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}
.card-bottom-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-bottom: 0;
  flex: 0 0 auto;
  min-width: max-content;
}
.book-score {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ea580c;
  line-height: 1.2;
}
.score-star { font-size: 0.95rem; line-height: 1; }
.score-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}
.card-bottom-meta .meta-item.age {
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 700;
}
.card-bottom-meta button.meta-item.age {
  padding: 0;
  border: 0;
  background: transparent;
}
.reaction-picker {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.25rem;
  margin-left: 0.15rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--border);
}
.reaction-picker.react-selected-only {
  gap: 0;
  margin-left: 0.1rem;
  padding-left: 0.35rem;
}
.reaction-picker.react-selected-only .react-btn {
  pointer-events: none;
}
.reaction-picker.react-pending-read .react-btn,
.reaction-picker.react-selected-only .react-btn {
  display: inline-flex;
}
.react-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.2rem;
  min-width: 28px;
  height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.45rem;
  transition: all 0.15s;
}
.react-btn:not(.react-btn-text) {
  width: 28px;
  padding: 0;
}
.react-btn-icon { display: inline-flex; flex-shrink: 0; line-height: 0; }
.react-btn-label { font-size: 0.68rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.react-btn-label-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.react-btn-text {
  padding: 0 0.65rem;
  color: #78716c;
}
.react-btn-text .react-btn-label { font-size: 0.72rem; }
.react-btn:hover { border-color: var(--accent); color: var(--accent); }
.react-btn-text:hover { color: #b45309; border-color: #d97706; }
.react-btn.active[data-reaction="like"] {
  border-color: #16a34a;
  color: #16a34a;
  background: #ecfdf5;
}
.react-btn.active[data-reaction="neutral"] {
  border-color: #d97706;
  color: #d97706;
  background: #fffbeb;
}
.react-btn.active[data-reaction="dislike"] {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}
.card-meta-left { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; font-size: 0.78rem; }
.cov-line.pending { color: var(--muted); font-weight: 500; }
.cov-line.format-note { color: var(--muted); font-weight: 500; font-size: 0.68rem; }
.toc-list .toc-l2 { margin-left: 0.75rem; list-style: circle; }
.toc-empty { color: var(--muted); font-style: italic; }

.book-card .cover-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  min-width: 104px;
  max-width: 104px;
  min-height: 156px;
  max-height: 156px;
  border: 0;
  background: transparent;
}
.book-card .cover-img {
  width: auto !important;
  height: auto !important;
  max-width: 104px !important;
  max-height: 156px !important;
  object-fit: contain;
  display: block;
  border: 3px solid #c4b5fd;
  background: linear-gradient(135deg, #f3e8ff, #eef2ff);
}
.commercial-series-card .series-cover-wrap {
  overflow: visible;
  width: 124px;
  max-width: 124px;
  border: 0;
  background: transparent;
}
.commercial-series-card .series-cover-wrap::before {
  content: none;
  display: none;
}
.commercial-series-card .series-cover-wrap::after {
  content: none;
  display: none;
}
.commercial-series-card .series-cover-stack {
  position: absolute;
  inset: 0;
}
.commercial-series-card .series-cover-layer {
  width: 84% !important;
  height: 154px !important;
  max-width: none !important;
  max-height: none !important;
}
.commercial-series-card .series-cover-layer.layer-1 {
  left: 0;
  right: auto;
}
.commercial-series-card .series-cover-layer.layer-2 {
  left: 14px;
  right: auto;
  top: 0;
  transform: none;
}

.card {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.badge.award { background: #fef3c7; color: #92400e; }

.empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

/* Duplicate modal */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.modal-panel {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; }
.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.modal-hint {
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.modal-hint code { font-size: 0.75rem; background: var(--bg); padding: 0.1rem 0.3rem; border-radius: 4px; }
.dup-list {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  flex: 1;
}
.dup-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.dup-group-title {
  padding: 0.6rem 0.85rem;
  background: var(--accent-light);
  font-size: 0.85rem;
  font-weight: 600;
}
.dup-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  align-items: start;
}
.dup-copy.keep-suggested { background: #f0fdf4; }
.dup-copy label { display: flex; gap: 0.5rem; cursor: pointer; }
.dup-copy .path { color: var(--muted); word-break: break-all; font-size: 0.72rem; }
.dup-copy .meta { color: var(--muted); }
.badge.keep { background: #dcfce7; color: #166534; font-size: 0.65rem; }
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.modal-footer .btn { width: auto; flex: 0 0 auto; margin: 0; }
#dupSummary { flex: 1; font-size: 0.85rem; color: var(--muted); min-width: 120px; }

/* Duplicate modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.hidden { display: none; }

.modal-panel {
  background: var(--card);
  border-radius: 16px;
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.dup-group-warn { border-color: #f59e0b; }
.dup-group-warn .dup-group-title { background: #fef3c7; color: #92400e; }
.dup-note {
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}
.dup-count {
  font-weight: normal;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.35rem;
}
.dup-copy-label {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.65rem;
  cursor: pointer;
  align-items: start;
}
.dup-cover {
  width: 56px;
  height: 80px;
  border-radius: 6px;
  background: var(--accent-light);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.dup-cover img { width: 100%; height: 100%; object-fit: cover; }
.dup-cover-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.dup-copy-body { min-width: 0; }
.dup-copy-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}
.dup-filename {
  font-weight: 600;
  font-size: 0.82rem;
  word-break: break-all;
  margin-bottom: 0.2rem;
}
.dup-folder {
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.15rem;
}
.dup-path {
  font-size: 0.68rem;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.35;
}
.dup-reasons {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  font-size: 0.68rem;
  color: var(--muted);
}
.dup-copy.delete-suggested { background: #fef2f2; }
.badge.delete-hint { background: #fee2e2; color: #991b1b; font-size: 0.65rem; }
.badge.edition { background: #e0e7ff; color: #3730a3; font-size: 0.65rem; }
.dup-copy input[type="checkbox"] { margin-top: 0.35rem; width: 1rem; height: 1rem; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.15rem; }
.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}

.modal-hint {
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.modal-hint code { font-size: 0.75rem; background: var(--bg); padding: 0.1rem 0.3rem; border-radius: 4px; }

.dup-list {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  flex: 1;
}

.dup-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.dup-group-title {
  background: var(--accent-light);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.dup-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  align-items: start;
}
.dup-copy.keep-suggested {
  background: #f0fdf4;
}
.dup-copy label { display: contents; cursor: pointer; }
.dup-copy input { margin-top: 0.2rem; }
.dup-copy .path {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.7rem;
  word-break: break-all;
}
.dup-copy .meta { color: var(--muted); }

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.modal-footer .btn { width: auto; flex: 1; min-width: 100px; }
.modal-footer .btn.primary { flex: 2; }

/* Physical shelf */
.shelf-layout .sidebar { max-width: 280px; }
.shelf-page .layout { grid-template-columns: 280px 1fr; }
.nav-link-row { margin: 0.5rem 0 1rem; font-size: 0.85rem; }
.nav-link-row a { color: var(--accent); text-decoration: none; }
.nav-link-row a:hover { text-decoration: underline; }
.shelf-add-panel {
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
}
.shelf-add-body {
  overflow-y: auto;
  flex: 1;
  padding: 1rem 1.25rem 0.5rem;
}
.shelf-field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.shelf-field-label .req { color: var(--warning); }
.shelf-input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
}
.shelf-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.shelf-lookup-block { margin-bottom: 1rem; }
.shelf-lookup-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.shelf-lookup-actions .shelf-input { flex: 1; min-width: 0; }
.shelf-lookup-actions .btn-inline {
  width: auto;
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.shelf-add-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.25rem;
}
.shelf-form-field { min-width: 0; }
.shelf-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 520px) {
  .shelf-form-row { grid-template-columns: 1fr; }
}
.shelf-candidates { margin-bottom: 1rem; }
.shelf-candidate-btn {
  display: block; width: 100%; text-align: left;
  padding: 0.6rem 0.75rem; margin-bottom: 0.35rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); cursor: pointer;
}
.shelf-candidate-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.shelf-candidate-btn strong { display: block; font-size: 0.9rem; }
.shelf-candidate-btn span { font-size: 0.75rem; color: var(--muted); }
.shelf-cover-preview { text-align: center; margin-bottom: 0.75rem; }
.shelf-cover-preview img { max-height: 140px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.shelf-add-form textarea.shelf-input { resize: vertical; min-height: 5rem; font: inherit; }
.shelf-add-panel .modal-footer { flex-shrink: 0; }
.shelf-add-panel .modal-footer .btn { flex: 0 1 auto; min-width: 5.5rem; }
.shelf-add-panel .modal-footer .btn.primary { flex: 1 1 auto; }
.book-meta-line { font-size: 0.75rem; color: var(--muted); margin: 0.25rem 0 0.5rem; }
.summary-snippet { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.4; }
.add-status { flex: 1; font-size: 0.8rem; color: var(--muted); }
.empty-hint { padding: 2rem; color: var(--muted); text-align: center; }
.login-dest { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.login-dest a { color: var(--accent); margin: 0 0.35rem; }


/* Fix tiny cover rendering for specific low-resolution award title */
.cover-img.cover-stretch {
  object-fit: fill;
  transform: scale(1.08);
  transform-origin: center center;
}

.catalog-page .layout {
  min-height: 100vh;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem 0;
}

.catalog-toolbar .filter-search {
  min-width: 0;
  flex: 1 1 260px;
}

.catalog-toolbar .filter-search input {
  width: 100%;
}

.filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.42rem 0.55rem;
  background: #fff;
}

.filter-label-mini {
  color: var(--muted);
  font-size: 0.78rem;
}

.filter-control {
  min-width: 140px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.32rem 0.45rem;
  font-size: 0.86rem;
}

.filter-check {
  line-height: 1;
}

.filter-check input {
  transform: translateY(1px);
}

.hero-title-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.hero-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-stat-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.5rem;
}

.hero-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf9ff;
  padding: 0.6rem 0.65rem;
}

.hero-stat strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.hero-stat span {
  color: var(--muted);
  font-size: 0.74rem;
}

.author-state-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
  margin: 0.25rem 0 0.8rem;
}

.author-state-card.state-hint {
  background: #fff;
  border-left: 3px solid var(--accent);
}

.author-state-card.state-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.author-state-card .state-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.author-state-card .state-text {
  color: var(--muted);
  margin-bottom: 0.65rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

.author-state-card .state-cta {
  width: fit-content;
}

.book-subnote {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.book-volume-tag {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.card-state-label {
  color: #b45309;
  font-size: 0.72rem;
  margin-top: 0.22rem;
}

.loading-state {
  border: 1px dashed var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.95rem;
}

body[data-page="series"] .catalog-grid,
body[data-page="author"] .catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.author-hero,
.series-hero {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dfe7f6;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin: 0 0 0.85rem 0;
  box-shadow: 0 14px 38px rgba(31, 55, 120, 0.07);
}

.author-hero h1,
.series-hero h1 {
  margin-bottom: 0.35rem;
}

.author-profile-meta,
.series-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

body[data-page="author"] {
  min-width: 1180px;
  background:
    radial-gradient(circle at 48% 8%, rgba(124, 77, 255, 0.12), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(17, 189, 232, 0.1), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.author-home-shell,
.catalog-home-shell {
  width: min(1500px, calc(100vw - 28px));
}

.author-main .topbar,
.series-main .topbar {
  align-items: center;
  min-height: 36px;
  margin: 0 0 0.55rem;
  padding: 0.2rem 0.05rem;
  color: #687086;
  font-weight: 800;
}

.author-main .catalog-toolbar,
.series-main .catalog-toolbar {
  margin: 0 0 0.85rem;
  padding: 0.7rem;
  border: 1px solid #dfe7f6;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(31, 55, 120, 0.05);
}

body[data-page="author"].author-detail-mode #authorToolbar {
  display: none;
}

.author-main .catalog-grid,
.series-main .catalog-grid {
  gap: 0.85rem;
}

body[data-page="series"] {
  min-width: 1180px;
  background:
    radial-gradient(circle at 48% 8%, rgba(124, 77, 255, 0.12), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(17, 189, 232, 0.1), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.author-hero .hero-title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e8edf7;
}

.author-hero h1 {
  font-size: 1.55rem;
  line-height: 1.12;
  margin: 0 0 0.35rem;
  color: #12172b;
}

@media (max-width: 1180px) {
  body[data-page="author"],
  body[data-page="series"] {
    min-width: 0;
    overflow-x: hidden;
  }
}

.author-hero .hero-actions {
  flex: 0 0 auto;
}

.author-hero .hero-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.author-hero .hero-stat {
  min-width: 150px;
  border: 1px solid #e4e9f4;
  border-radius: 12px;
  background: #f9fbff;
  padding: 0.55rem 0.7rem;
}

.author-hero .hero-stat strong {
  display: block;
  color: #2563eb;
  font-size: 1rem;
  line-height: 1.2;
}

.author-hero .hero-stat span {
  display: block;
  margin-top: 0.18rem;
  color: #687086;
  font-size: 0.72rem;
  font-weight: 850;
}

.author-hero .chip-list {
  margin-top: 0.75rem;
}

body[data-page="author"] .author-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1.25rem;
  align-items: stretch;
  border-radius: 24px;
  padding: 1.45rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(124, 77, 255, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.96);
}

.author-detail-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.author-detail-portrait-wrap {
  flex: 0 0 148px;
  width: 148px;
  height: 148px;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c4dff, #36c6e8 70%, #ff8a4c);
  box-shadow: 0 18px 38px rgba(75, 68, 173, 0.2);
}

.author-detail-portrait,
.author-detail-portrait-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #eeeaff;
}

.author-detail-portrait {
  object-fit: cover;
  object-position: center;
}

.author-detail-portrait-fallback {
  place-items: center;
  color: #6845e8;
  font-size: 3.25rem;
  font-weight: 900;
}

.author-detail-copy {
  min-width: 0;
}

body[data-page="author"] .author-detail-copy h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  letter-spacing: -0.035em;
}

.author-detail-copy .author-profile-meta {
  margin: 0.28rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.author-detail-trail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(124, 77, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(245, 241, 255, 0.96), rgba(242, 250, 255, 0.94));
}

.author-detail-eyebrow {
  margin: 0 0 0.7rem;
  color: #6845e8;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.author-trail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.author-trail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(124, 77, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #40336f;
  font-size: 0.78rem;
  font-weight: 800;
}

.author-award-work-summary {
  margin: 0.75rem 0 0;
  color: #687086;
  font-size: 0.82rem;
  font-weight: 750;
}

.author-works-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 0.75rem;
  padding: 0 0.15rem;
}

.author-works-header h2 {
  margin: 0;
  color: #12172b;
  font-size: 1.25rem;
}

.author-works-header span {
  color: #687086;
  font-size: 0.84rem;
  font-weight: 750;
}

body[data-page="author"] .book-card {
  background: #fff;
  box-shadow: 0 4px 20px rgba(107, 78, 255, 0.08);
}

.author-result-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nb-asset-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(140px, .48fr);
  gap: 0.75rem;
  align-items: start;
  border: 2px solid #c4b5fd;
  border-radius: 16px;
  background: var(--card);
  padding: 0.85rem;
  box-shadow: 0 4px 20px rgba(107, 78, 255, 0.08);
}

.nb-entity-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 0.82rem;
  align-items: start;
  border: 1px solid #e2e8f6;
  border-radius: 12px;
  background: var(--card);
  padding: 0.82rem;
  box-shadow: 0 8px 24px rgba(31, 55, 120, 0.055);
}

.nb-entity-visual {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.36rem;
  min-width: 0;
}

.nb-entity-main {
  display: grid;
  align-content: start;
  gap: 0.38rem;
  min-width: 0;
}

.nb-entity-type-label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  width: fit-content;
  border-radius: 999px;
  background: #f1edff;
  color: #6d4aff;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1.2;
  padding: 0.18rem 0.42rem;
}

.nb-entity-type-label span {
  font-size: 0.68rem;
}

.nb-entity-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.nb-source-chip,
.nb-source-overflow {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  max-width: 100%;
  border: 1px solid #e2e8f6;
  border-radius: 999px;
  background: #fff;
  color: #344055;
  font-size: 0.65rem;
  font-weight: 850;
  line-height: 1.2;
  padding: 0.2rem 0.42rem;
  white-space: nowrap;
}

.nb-source-chip {
  min-width: 0;
  overflow: hidden;
}

.nb-source-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-detail-panel[hidden] {
  display: none;
}

.source-detail-section {
  display: grid;
  gap: 0.22rem;
}

.source-detail-section + .source-detail-section {
  padding-top: 0.48rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.source-detail-heading {
  color: #1d2b4f;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.2;
}

.source-detail-list {
  display: grid;
  gap: 0.18rem;
}

.source-detail-row {
  display: grid;
  grid-template-columns: 0.9rem 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.34rem;
  color: #344055;
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1.24;
  text-decoration: none;
}

.source-detail-row:hover {
  text-decoration: none;
}

.source-detail-icon {
  display: inline-grid;
  place-items: center;
  color: #d99b16;
  font-size: 0.72rem;
  line-height: 1;
}

.source-detail-year {
  color: #64748b;
  font-weight: 860;
  min-width: 0;
}

.source-detail-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-detail-row.nb-source-chip-book-award .source-detail-icon {
  color: #d99b16;
}

.source-detail-row.nb-source-chip-author-award .source-detail-icon,
.source-detail-row.nb-source-chip-author-awarded-work .source-detail-icon {
  color: #b77908;
}

.source-detail-row.nb-source-chip-curated-list .source-detail-icon {
  color: #2563eb;
}

.source-detail-row.nb-source-chip-reading-data .source-detail-icon {
  color: #16a34a;
}

.nb-source-chip span {
  font-size: 0.68rem;
  line-height: 1;
}

.nb-source-chip .signal-icon,
.nb-source-chip > span[aria-hidden="true"] {
  flex: 0 0 auto;
}

.nb-source-chip-book-award {
  border-color: #f6d58f;
  background: #fffaf0;
  color: #9a650f;
}

.nb-source-chip-author-award,
.nb-source-chip-author-awarded-work {
  border-color: #e8c56a;
  background: #fff8db;
  color: #8a5a05;
}

.nb-source-chip-curated-list {
  border-color: #c7dcff;
  background: #f3f7ff;
  color: #1d4ed8;
}

.nb-source-chip-reading-data {
  border-color: #bde8cf;
  background: #f1fff7;
  color: #16814b;
}

.nb-source-overflow {
  border-color: #dfe7f6;
  background: #fff;
  color: #64748b;
  font-weight: 900;
}

.nb-entity-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e8eef8;
  border-bottom: 1px solid #e8eef8;
  margin-top: 0.08rem;
}

.nb-entity-metric,
.nb-coverage-all-trigger {
  min-width: 0;
  border: 0;
  border-left: 1px solid #e8eef8;
  background: transparent;
  padding: 0.34rem 0.45rem;
  text-align: left;
}

.nb-entity-metric:nth-child(2n + 1),
.nb-entity-metric-grid > .nb-coverage-all-trigger:nth-child(2n + 1) {
  border-left: 0;
}

.nb-entity-metric-grid > :nth-child(n + 3) {
  border-top: 1px solid #e8eef8;
}

.nb-entity-metric b {
  display: block;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.nb-entity-metric span {
  display: block;
  margin-top: 0.12rem;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.2;
}

.nb-entity-paid-metric b {
  color: #6d4aff;
}

.nb-coverage-all-trigger {
  cursor: pointer;
  color: #6d4aff;
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.nb-entity-state-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 850;
}

.nb-entity-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid #e8eef8;
  padding-top: 0.48rem;
}

.nb-entity-primary-action {
  justify-self: end;
  min-width: 112px;
  margin: 0;
}

.nb-entity-action-row .nb-entity-primary-action {
  width: auto;
  min-width: 112px;
  margin: 0;
  padding: 0.42rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.nb-author-cover-stack {
  position: relative;
  width: 88px;
  height: 64px;
  margin-top: -0.02rem;
}

.nb-author-portrait,
.nb-author-mark {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 35%;
  box-shadow: 0 8px 18px rgba(31, 55, 120, 0.14);
}

.nb-author-cover-stack img {
  position: absolute;
  top: 0;
  width: 44px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(31, 55, 120, 0.16);
}

.nb-author-cover-stack img:nth-child(1) { left: 0; z-index: 5; }
.nb-author-cover-stack img:nth-child(2) { left: 18px; z-index: 4; }
.nb-author-cover-stack img:nth-child(3) { left: 36px; z-index: 3; }

.nb-asset-card.nb-author-card {
  grid-template-columns: 112px minmax(0, 1fr) minmax(140px, .48fr);
  gap: 0.85rem;
}

.nb-award-line {
  color: #9a3412;
  font-weight: 800;
}

.nb-asset-visual {
  display: grid;
  gap: 0.45rem;
}

.nb-asset-visual .series-cover-mini {
  width: 68px;
  height: 98px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(107, 78, 255, 0.12);
}

.nb-entity-visual .series-cover-mini {
  width: 112px;
  height: 152px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(107, 78, 255, 0.12);
}

.nb-entity-visual .series-cover-stack {
  position: relative;
  width: 132px;
  height: 154px;
}

.nb-entity-visual .series-cover-stack .series-cover-layer {
  position: absolute;
  top: 0;
  width: 96px;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(31, 55, 120, 0.16);
}

.nb-entity-visual .series-cover-stack .layer-0 {
  left: 0;
  top: 0;
  width: 96px;
  height: 140px;
  z-index: 5 !important;
}

.nb-entity-visual .series-cover-stack .layer-1 {
  left: 20px;
  top: 7px;
  width: 88px;
  height: 129px;
  z-index: 4 !important;
  box-shadow: 0 8px 16px rgba(31, 55, 120, 0.13);
}

.nb-entity-visual .series-cover-stack .layer-2 {
  left: 39px;
  top: 15px;
  width: 81px;
  height: 118px;
  z-index: 3 !important;
  transform: none;
  box-shadow: 0 6px 12px rgba(31, 55, 120, 0.1);
}

.nb-entity-visual .series-cover-count-1 .series-cover-layer {
  left: 16px;
  top: 0;
  width: 104px;
  height: 148px;
}

.nb-mini-state {
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
}

.nb-mini-state b {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
}

.nb-asset-main {
  min-width: 0;
}

.nb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.nb-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.22rem 0.48rem;
  white-space: nowrap;
}

.nb-chip-award {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.nb-chip-list {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.nb-chip-warning {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.nb-decision-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.65rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
}

.nb-decision-line b {
  color: var(--text);
  font-size: 0.78rem;
}

.nb-asset-data {
  border-left: 1px solid var(--border);
  padding-left: 0.7rem;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-width: 0;
}

.nb-data-title {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.nb-data-title b {
  color: var(--accent);
  white-space: nowrap;
  text-align: right;
}

.nb-coverage-pairs {
  display: grid;
  gap: 0.18rem;
}

.nb-coverage-pairs span {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px dashed var(--border);
  padding: 0.18rem 0;
  color: #e11d48;
  font-size: 0.74rem;
  font-weight: 800;
}

.nb-coverage-pairs b {
  color: #374151;
  font-weight: 800;
}

.nb-coverage-missing {
  color: var(--muted) !important;
}

.nb-share-btn {
  min-width: 2rem;
  text-align: center;
}

.nb-author-mark {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #7c4dff, #db2777);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(107, 78, 255, 0.16);
}

.nb-author-visual {
  display: grid;
  justify-items: center;
  gap: 0.42rem;
}

.nb-author-awards {
  width: 100%;
  display: grid;
  gap: 0.16rem;
  color: #9a3412;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.22;
}

.nb-author-awards span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nb-award-pairs span {
  color: #9a3412;
}

.series-result-card {
  gap: 0.55rem;
}

.series-row-head {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.series-title-wrap { flex: 1; min-width: 0; }

.series-cover-mini {
  width: 58px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(145deg, #ede9ff, #ddd6fe);
  flex: 0 0 auto;
  border: 1px solid var(--border);
}

.series-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.series-meta-grid .meta-item {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.series-meta-line {
  color: var(--muted);
  font-size: 0.82rem;
}

.author-result-card .author-meta {
  font-size: 0.82rem;
}

.author-profile-meta,
.series-meta {
  margin-top: 0.15rem;
}

.author-page-card {
  border-radius: 14px;
  padding: 0.85rem;
}

.author-page-card .book-title {
  margin: 0.42rem 0 0.2rem;
}

.author-page-card .book-meta-line {
  margin-bottom: 0.42rem;
}

.author-page-card .chip-list {
  margin-bottom: 0.42rem;
}

.author-page-card .asset-mini-list {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  line-height: 1.45;
  display: grid;
  gap: 0.25rem;
}

.author-page-card .book-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.catalog-page .empty-message {
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 1.2rem;
  color: var(--muted);
}

.inline-link {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
}

.btn-link {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.32rem 0.6rem;
  color: var(--accent);
  background: #fff;
  font-size: 0.8rem;
}

.author-asset-card {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) 170px;
  align-items: start;
  gap: 1rem;
}

.author-avatar-mark {
  width: 82px;
  height: 102px;
  border-radius: 20px;
  background: linear-gradient(145deg, #7c3aed, #db2777);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(124, 58, 237, 0.18);
}

.author-asset-main {
  min-width: 0;
}

.author-asset-main .book-title {
  margin: 0 0 0.2rem;
}

.author-meta-line {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.45rem;
}

.author-award-lines {
  color: #9a3412;
  font-size: 0.82rem;
  line-height: 1.35;
  display: grid;
  gap: 0.12rem;
  margin-bottom: 0.45rem;
}

.author-chip-list {
  margin: 0 0 0.5rem;
}

.author-representative {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.45rem 0 0.55rem;
  padding-top: 0.45rem;
}

.author-representative strong {
  color: var(--ink);
}

.author-card-link {
  width: 100%;
  justify-content: center;
}

.author-side-metrics {
  border-left: 1px solid var(--border);
  padding-left: 0.85rem;
  display: grid;
  gap: 0.42rem;
}

.author-side-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.3rem;
}

.author-side-metrics span {
  color: var(--muted);
  font-size: 0.8rem;
}

.author-side-metrics strong {
  color: var(--accent);
  font-size: 0.88rem;
  text-align: right;
}

@media (max-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  body[data-page="author"] .author-hero {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
  }

  .author-detail-identity {
    align-items: flex-start;
    gap: 0.85rem;
  }

  .author-detail-portrait-wrap {
    flex-basis: 92px;
    width: 92px;
    height: 92px;
  }

  .author-detail-portrait-fallback {
    font-size: 2rem;
  }

  body[data-page="author"] .author-detail-copy h1 {
    font-size: 1.55rem;
  }

  .author-detail-trail {
    padding: 0.9rem;
  }

  body[data-page="series"] .series-hero .hero-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-page="series"] .series-hero .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  body[data-page="series"] .series-hero .hero-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="series"] .series-main .filter-inline {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  body[data-page="series"] .series-main .filter-control {
    min-width: 0;
    width: min(190px, 68%);
    max-width: 100%;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .series-meta-grid {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="series"] .catalog-grid,
  body[data-page="author"] .catalog-grid {
    grid-template-columns: 1fr;
  }

  .nb-asset-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .nb-asset-data {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 0.55rem;
  }

  .nb-decision-line {
    grid-template-columns: 1fr;
  }

  .author-asset-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .author-avatar-mark {
    width: 70px;
    height: 88px;
    border-radius: 16px;
    font-size: 2rem;
  }

  .author-side-metrics {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 0.55rem;
  }
}

/* Series discovery: reading-path index */
body[data-page="series"] .series-main {
  padding-top: 1.15rem;
}

body[data-page="series"] .series-index-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 0;
  border: 1px solid rgba(116, 91, 255, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(46, 213, 231, 0.2), transparent 31%),
    radial-gradient(circle at 16% 110%, rgba(255, 119, 76, 0.13), transparent 33%),
    linear-gradient(125deg, #f3efff 0%, #fbfbff 52%, #edfaff 100%);
  box-shadow: 0 24px 60px rgba(52, 49, 120, 0.12);
}

body[data-page="series"] .series-index-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  min-height: 330px;
}

body[data-page="series"] .series-index-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4vw, 4rem);
}

body[data-page="series"] .series-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #6d4aff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

body[data-page="series"] .series-section-kicker::before {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7651ff, #25c4df);
  content: "";
}

body[data-page="series"] .series-index-copy h1 {
  max-width: 760px;
  margin: 0.8rem 0 0.85rem;
  color: #11162c;
  font-size: clamp(2.15rem, 4.6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

body[data-page="series"] .series-index-copy > p {
  max-width: 670px;
  margin: 0;
  color: #626b82;
  font-size: clamp(0.94rem, 1.2vw, 1.08rem);
  line-height: 1.75;
}

body[data-page="series"] .series-index-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.6rem;
  margin-top: 1.6rem;
}

body[data-page="series"] .series-index-proof > div {
  min-width: 108px;
  padding-left: 0.8rem;
  border-left: 2px solid rgba(109, 74, 255, 0.22);
}

body[data-page="series"] .series-index-proof strong,
body[data-page="series"] .series-index-proof span {
  display: block;
}

body[data-page="series"] .series-index-proof strong {
  color: #242b48;
  font-size: 1.25rem;
  line-height: 1.1;
}

body[data-page="series"] .series-index-proof span {
  margin-top: 0.28rem;
  color: #737b91;
  font-size: 0.72rem;
  font-weight: 800;
}

body[data-page="series"] .series-path-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 1.6rem;
  background: linear-gradient(145deg, rgba(79, 58, 173, 0.92), rgba(39, 54, 121, 0.92));
  color: #fff;
}

body[data-page="series"] .series-path-visual::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

body[data-page="series"] .series-path-covers {
  position: relative;
  z-index: 1;
  height: 180px;
  margin: 0 auto 1rem;
  width: min(250px, 100%);
}

body[data-page="series"] .series-cover-stack-hero-index {
  position: absolute;
  inset: 0;
}

body[data-page="series"] .series-cover-stack-hero-index .series-cover-layer {
  position: absolute;
  width: 112px;
  height: 162px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 18px 32px rgba(12, 18, 58, 0.38);
}

body[data-page="series"] .series-cover-stack-hero-index .layer-0 {
  left: 16px;
  bottom: 0;
  z-index: 5 !important;
  transform: rotate(-4deg);
}

body[data-page="series"] .series-cover-stack-hero-index .layer-1 {
  left: 64px;
  bottom: 5px;
  z-index: 4 !important;
  transform: none;
}

body[data-page="series"] .series-cover-stack-hero-index .layer-2 {
  right: 16px;
  bottom: 10px;
  z-index: 3 !important;
  transform: rotate(4deg);
}

body[data-page="series"] .series-path-caption {
  position: relative;
  z-index: 1;
}

body[data-page="series"] .series-path-caption > span {
  display: block;
  margin-bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="series"] .series-path-caption strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.25;
}

body[data-page="series"] .series-path-caption p {
  margin: 0.25rem 0 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

body[data-page="series"] .series-path-caption a {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

body[data-page="series"] .series-toolbar {
  display: block;
  margin-top: 1rem;
  padding: 1.05rem 1.15rem;
  border-radius: 20px;
}

body[data-page="series"] .series-toolbar-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #e9edf6;
}

body[data-page="series"] .series-toolbar-intro h2 {
  margin: 0.28rem 0 0.2rem;
  color: #171c31;
  font-size: 1.15rem;
}

body[data-page="series"] .series-toolbar-intro p {
  margin: 0;
  color: #7a8296;
  font-size: 0.78rem;
}

body[data-page="series"] .series-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
}

body[data-page="series"] .series-toolbar-actions .btn {
  width: auto;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
}

body[data-page="series"] .series-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  padding-top: 0.9rem;
}

body[data-page="series"] .series-filter-grid .filter-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-page="series"] .series-filter-grid .filter-label-mini {
  color: #747c90;
  font-size: 0.7rem;
  font-weight: 850;
}

body[data-page="series"] .series-filter-grid .filter-control {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 0.75rem;
  border: 1px solid #dfe5f1;
  border-radius: 12px;
  background: #fbfcff;
}

body[data-page="series"] .series-filter-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

body[data-page="series"] .series-filter-flags .filter-check {
  width: auto;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #e2e7f1;
  border-radius: 999px;
  background: #fff;
}

body[data-page="series"] .series-toolbar + .catalog-grid {
  margin-top: 1rem;
}

body[data-page="series"] .series-detail-hero {
  overflow: hidden;
  padding: 0;
  border-color: rgba(116, 91, 255, 0.2);
  border-radius: 26px;
  background:
    radial-gradient(circle at 10% 8%, rgba(115, 83, 255, 0.16), transparent 30%),
    radial-gradient(circle at 75% 115%, rgba(34, 199, 222, 0.13), transparent 35%),
    rgba(255, 255, 255, 0.96);
}

body[data-page="series"] .series-detail-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) minmax(290px, 0.58fr);
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
  align-items: center;
  min-height: 320px;
  padding: clamp(1.35rem, 2.8vw, 2.5rem);
}

body[data-page="series"] .series-detail-covers {
  position: relative;
  width: 220px;
  height: 238px;
  justify-self: center;
}

body[data-page="series"] .series-cover-stack-hero-detail {
  position: absolute;
  inset: 0;
}

body[data-page="series"] .series-detail-covers::after {
  position: absolute;
  right: 8px;
  bottom: 2px;
  left: 8px;
  height: 28px;
  border-radius: 50%;
  background: rgba(31, 35, 75, 0.18);
  filter: blur(16px);
  content: "";
}

body[data-page="series"] .series-cover-stack-hero-detail .series-cover-layer {
  position: absolute;
  width: 132px;
  height: 202px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 18px 34px rgba(28, 30, 82, 0.24);
}

body[data-page="series"] .series-cover-stack-hero-detail .layer-0 {
  left: 10px;
  bottom: 8px;
  z-index: 5 !important;
  transform: rotate(-3deg);
}

body[data-page="series"] .series-cover-stack-hero-detail .layer-1 {
  left: 48px;
  bottom: 11px;
  z-index: 4 !important;
  transform: none;
}

body[data-page="series"] .series-cover-stack-hero-detail .layer-2 {
  left: 86px;
  bottom: 14px;
  z-index: 3 !important;
  transform: rotate(3deg);
}

body[data-page="series"] .series-detail-copy {
  min-width: 0;
}

body[data-page="series"] .series-detail-copy h1 {
  margin: 0.65rem 0 0.45rem;
  color: #11162c;
  font-size: clamp(2rem, 3.7vw, 3.7rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

body[data-page="series"] .series-detail-meta,
body[data-page="series"] .series-detail-byline {
  margin: 0;
  color: #687188;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.55;
}

body[data-page="series"] .series-detail-byline {
  margin-top: 0.3rem;
  color: #424b68;
}

body[data-page="series"] .series-detail-copy .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

body[data-page="series"] .series-reading-path {
  align-self: stretch;
  min-width: 0;
  border: 1px solid rgba(116, 91, 255, 0.17);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(248, 246, 255, 0.98), rgba(239, 250, 255, 0.96));
  padding: 1.15rem;
}

body[data-page="series"] .series-reading-path > span {
  color: #704cfa;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="series"] .series-reading-path > p {
  margin: 0.8rem 0 0.18rem;
  color: #7b8296;
  font-size: 0.7rem;
  font-weight: 850;
}

body[data-page="series"] .series-reading-path h2 {
  margin: 0;
  color: #151a32;
  font-size: 1.08rem;
  line-height: 1.3;
}

body[data-page="series"] .series-reading-path ol {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

body[data-page="series"] .series-reading-path li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
}

body[data-page="series"] .series-reading-path li span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #fff;
  color: #6d4aff;
  font-size: 0.68rem;
  font-weight: 950;
  box-shadow: 0 4px 12px rgba(68, 50, 151, 0.1);
}

body[data-page="series"] .series-reading-path li strong {
  min-width: 0;
  color: #303852;
  font-size: 0.76rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="series"] .series-reading-path small {
  display: block;
  margin: 0.65rem 0 0 2rem;
  color: #7b8296;
  font-size: 0.68rem;
  font-weight: 800;
}

body[data-page="series"] .series-reading-path > a {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 1rem;
  color: #6543e8;
  font-size: 0.76rem;
  font-weight: 950;
  text-decoration: none;
}

body[data-page="series"] .series-results-head {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 0.35rem 0.15rem 0.2rem;
}

body[data-page="series"] .series-results-head h2,
body[data-page="series"] .series-results-head p {
  margin: 0;
}

body[data-page="series"] .series-results-head h2 {
  color: #171c31;
  font-size: 1.35rem;
}

body[data-page="series"] .series-results-head p,
body[data-page="series"] .series-results-head > strong {
  margin-top: 0.25rem;
  color: #747c90;
  font-size: 0.76rem;
  font-weight: 850;
}

@media (max-width: 1024px) {
  body[data-page="series"] .series-index-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  }

  body[data-page="series"] .series-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="series"] .series-detail-layout {
    grid-template-columns: 180px minmax(0, 1fr) minmax(250px, 0.55fr);
  }

  body[data-page="series"] .series-detail-covers {
    width: 175px;
  }

  body[data-page="series"] .series-cover-stack-hero-detail .series-cover-layer {
    width: 118px;
    height: 182px;
  }

  body[data-page="series"] .series-cover-stack-hero-detail .layer-0 { left: 4px; }
  body[data-page="series"] .series-cover-stack-hero-detail .layer-1 { left: 31px; }
  body[data-page="series"] .series-cover-stack-hero-detail .layer-2 { left: 58px; }
}

@media (max-width: 640px) {
  body[data-page="series"] .series-main {
    padding-top: 0.65rem;
  }

  body[data-page="series"] .series-index-hero {
    min-height: 0;
    border-radius: 20px;
  }

  body[data-page="series"] .series-index-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="series"] .series-detail-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.1rem;
  }

  body[data-page="series"] .series-detail-covers {
    width: 176px;
    height: 170px;
    justify-self: start;
  }

  body[data-page="series"] .series-cover-stack-hero-detail .series-cover-layer {
    width: 104px;
    height: 156px;
  }

  body[data-page="series"] .series-cover-stack-hero-detail .layer-0 { left: 2px; }
  body[data-page="series"] .series-cover-stack-hero-detail .layer-1 { left: 32px; }
  body[data-page="series"] .series-cover-stack-hero-detail .layer-2 { left: 62px; }

  body[data-page="series"] .series-detail-copy h1 {
    font-size: 2rem;
  }

  body[data-page="series"] .series-reading-path {
    padding: 1rem;
  }

  body[data-page="series"] .series-index-copy {
    padding: 1.35rem 1.1rem 1.5rem;
  }

  body[data-page="series"] .series-index-copy h1 {
    font-size: 2rem;
  }

  body[data-page="series"] .series-index-proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  body[data-page="series"] .series-index-proof > div {
    min-width: 0;
    padding-left: 0.55rem;
  }

  body[data-page="series"] .series-path-visual {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
  }

  body[data-page="series"] .series-path-covers {
    width: 140px;
    height: 128px;
    margin: 0;
  }

  body[data-page="series"] .series-cover-stack-hero-index .series-cover-layer {
    width: 76px;
    height: 112px;
  }

  body[data-page="series"] .series-cover-stack-hero-index .layer-0 { left: 4px; }
  body[data-page="series"] .series-cover-stack-hero-index .layer-1 { left: 28px; }
  body[data-page="series"] .series-cover-stack-hero-index .layer-2 { right: 4px; left: auto; }

  body[data-page="series"] .series-toolbar-head {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-page="series"] .series-toolbar-actions {
    justify-content: flex-start;
  }

  body[data-page="series"] .series-filter-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="series"] .series-main .series-filter-grid .filter-inline,
  body[data-page="series"] .series-main .series-filter-grid .filter-control {
    width: 100%;
    max-width: none;
  }
}

.source-help-entry {
  min-width: 260px;
}

.source-help-link {
  color: #5b21b6;
  border-color: rgba(124, 77, 255, 0.28);
  background: #f5f3ff;
}

.source-help-copy {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.reading-sources-page {
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 77, 255, 0.08), transparent 36%),
    linear-gradient(180deg, #fbfcff 0%, #ffffff 58%, #fbfdff 100%);
}

.source-locale-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 850;
}

.source-locale-field select {
  min-width: 112px;
  height: 36px;
  border: 1px solid #dbe3f1;
  border-radius: 999px;
  background: #fff;
  color: #12172b;
  font-weight: 800;
  padding: 0 0.6rem;
}

.reading-sources-main {
  box-sizing: border-box;
  width: 100%;
  padding: 2rem 0 3rem;
  overflow-x: clip;
}

.reading-sources-page .reading-sources-hero,
.reading-sources-page .source-layout {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.reading-sources-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  grid-template-areas:
    "copy art"
    "cards cards";
  gap: 1.45rem 2rem;
  align-items: center;
  padding: 2.25rem 0.5rem 0.55rem;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(124, 77, 255, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.7));
  box-shadow: none;
}

.source-hero-copy {
  grid-area: copy;
  display: grid;
  align-content: center;
}

.source-eyebrow {
  margin: 0 0 0.5rem;
  color: #5b21b6;
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0;
}

.reading-sources-hero h1 {
  margin: 0;
  max-width: 760px;
  color: #111827;
  font-size: clamp(2.45rem, 5vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.source-hero-copy > p:last-child {
  max-width: 760px;
  margin: 1rem 0 0;
  color: #475569;
  font-size: 1.03rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.source-hero-art {
  grid-area: art;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  overflow: hidden;
}

.source-hero-art::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(250, 252, 255, 0.96) 0%, rgba(250, 252, 255, 0) 14%, rgba(250, 252, 255, 0) 86%, rgba(250, 252, 255, 0.96) 100%),
    linear-gradient(180deg, rgba(250, 252, 255, 0.96) 0%, rgba(250, 252, 255, 0) 20%, rgba(250, 252, 255, 0) 78%, rgba(250, 252, 255, 0.96) 100%);
}

.source-hero-art img {
  display: block;
  width: min(100%, 560px);
  height: auto;
  object-fit: contain;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

.source-guide-grid {
  grid-area: cards;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.05rem;
}

.source-guide-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.8rem;
  min-height: 148px;
  border: 1px solid #e6d6a5;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 251, 236, 0.98), rgba(255, 255, 255, 0.96));
  padding: 1.35rem 1.2rem;
  min-width: 0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
}

.source-guide-card-2 {
  border-color: #d8cdfa;
  background: linear-gradient(135deg, rgba(248, 245, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.source-guide-card-3 {
  border-color: #bde8cf;
  background: linear-gradient(135deg, rgba(241, 255, 247, 0.98), rgba(255, 255, 255, 0.96));
}

.source-guide-card-4 {
  border-color: #c9dcff;
  background: linear-gradient(135deg, rgba(241, 247, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.source-guide-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #f2a91b;
  font-size: 0.76rem;
  font-weight: 950;
}

.source-guide-card-2 .source-guide-icon {
  background: #6d46c9;
}

.source-guide-card-3 .source-guide-icon {
  background: #188b4f;
}

.source-guide-card-4 .source-guide-icon {
  background: #2477d7;
}

.source-guide-card > b {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #dde6f6;
  border-radius: 999px;
  color: #4f1fd6;
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
}

.source-guide-card span {
  color: #5b21b6;
  font-size: 0.76rem;
  font-weight: 950;
}

.source-guide-card h2 {
  margin: 0;
  color: #111827;
  font-size: 1.15rem;
  line-height: 1.32;
  letter-spacing: 0;
}

.source-guide-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.source-principle-card {
  display: grid;
  align-content: center;
  gap: 0.75rem;
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: 14px;
  background: #fff;
  padding: 1.1rem;
}

.source-principle-card span {
  color: #7c3aed;
  font-size: 0.76rem;
  font-weight: 950;
}

.source-principle-card strong {
  color: #111827;
  font-size: 1.06rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.source-principle-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.source-side-panel,
.source-nextbook-use,
.source-card-group {
  scroll-margin-top: 86px;
}

.source-nextbook-use h2 {
  margin: 0;
  color: #111827;
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.source-info-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid #dfe7f4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
}

.source-card-index {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 950;
}

.source-info-card h2,
.source-side-panel h2 {
  margin: 0 0 0.45rem;
  color: #111827;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.source-info-card p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.source-info-card .source-note {
  margin-top: 0.65rem;
  border-left: 3px solid #7c4dff;
  padding-left: 0.75rem;
  color: #334155;
  background: #f8f7ff;
}

.source-side-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.1rem 0 0;
  box-shadow: none;
}

.source-panel-intro {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.58;
}

.source-card-group {
  border-top: 1px solid #e6ebf5;
  padding-top: 0.9rem;
  margin-top: 1.1rem;
}

.source-card-group:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.source-card-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.source-card-group-head h3 {
  margin: 0;
  color: #5b21b6;
  font-size: 0.92rem;
  font-weight: 950;
}

.source-card-group-head span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f1efff;
  color: #5b21b6;
  font-size: 0.78rem;
  font-weight: 950;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.source-card-grid-wide {
  grid-template-columns: 1fr;
}

.source-detail-card {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 0.92rem;
  align-items: start;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.9rem 1rem;
  min-width: 0;
  min-height: 112px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}

.source-detail-card-wide {
  grid-column: 1 / -1;
  grid-template-columns: 128px minmax(0, 1fr);
  min-height: 260px;
  padding: 1.35rem 1.55rem;
}

.source-detail-card-wide .source-logo-mark {
  width: 104px;
}

.source-detail-card-wide .source-detail-head h4 {
  font-size: 1.45rem;
}

.source-detail-card-wide .source-official-name {
  font-size: 0.92rem;
}

.source-detail-card-wide .source-narrative {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.source-detail-card-wide .source-narrative section {
  border-left: 1px solid #e7edf7;
  padding-left: 0.85rem;
}

.source-detail-card-wide .source-narrative h5 {
  font-size: 0.76rem;
}

.source-detail-card-wide .source-narrative p {
  font-size: 0.78rem;
  line-height: 1.55;
}

.source-logo-column {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.42rem;
  min-width: 0;
}

.source-logo-mark {
  width: 76px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: #9b6b0f;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  overflow: hidden;
}

.source-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.source-logo-mark span {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px solid #efe4ca;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 219, 112, 0.32), transparent 34%),
    linear-gradient(135deg, #fff8e6, #fff);
  padding: 0.25rem;
}

.source-category-badge {
  max-width: 100%;
  border: 1px solid rgba(124, 77, 255, 0.22);
  border-radius: 999px;
  background: #f6f4ff;
  color: #5b21b6;
  font-size: 0.63rem;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  padding: 0.2rem 0.44rem;
  overflow-wrap: anywhere;
}

.source-card-content {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
}

.source-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.18rem;
}

.source-detail-head h4 {
  margin: 0;
  color: #111827;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.source-detail-head p {
  margin: 0.22rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.source-detail-head .source-official-name {
  margin: 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-detail-head > span {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: 999px;
  background: #f6f4ff;
  color: #5b21b6;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1.25;
  text-align: center;
  padding: 0.22rem 0.5rem;
}

.source-fact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0;
}

.source-fact-grid div {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 1px solid #eadfc8;
  border-radius: 999px;
  background: #fffaf0;
  padding: 0.18rem 0.45rem;
}

.source-fact-grid dt {
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 950;
  white-space: nowrap;
}

.source-fact-grid dd {
  margin: 0;
  color: #172033;
  font-size: 0.68rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-narrative {
  display: block;
}

.source-narrative section {
  display: block;
  border: 0;
  padding: 0;
}

.source-narrative-visible {
  display: block;
}

.source-narrative h5 {
  display: block;
  margin: 0 0 0.18rem;
  color: #1f2937;
  font-size: 0.68rem;
  line-height: 1.35;
  font-weight: 950;
}

.source-narrative p {
  margin: 0;
  color: #475569;
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-more-facts {
  display: none;
  border-top: 0;
  padding-top: 0.12rem;
  margin-top: 0.18rem;
}

.source-more-facts.is-open {
  display: block;
}

.source-more-toggle {
  cursor: pointer;
  appearance: none;
  border: 0;
  background: transparent;
  width: fit-content;
  margin: 0;
  padding: 0;
  color: #4f46e5;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.2;
}

.source-more-toggle:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.28);
  outline-offset: 2px;
}

.source-more-facts .source-fact-grid {
  margin-top: 0.55rem;
}

.source-expanded-narrative {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.source-expanded-narrative section {
  display: grid;
  gap: 0.12rem;
  border-top: 1px solid #edf2f7;
  padding-top: 0.45rem;
}

.source-expanded-narrative h5 {
  margin: 0;
  color: #1f2937;
  font-size: 0.68rem;
  line-height: 1.35;
  font-weight: 950;
}

.source-expanded-narrative p {
  margin: 0;
  color: #475569;
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-fact-grid-full div {
  border-radius: 8px;
  align-items: flex-start;
}

.source-nextbook-use {
  border: 1px solid #e2e8f6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 1.2rem;
}

.source-nextbook-use {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 1rem 1.5rem;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(250, 247, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.source-nextbook-use h2 {
  grid-column: 1;
  grid-row: 1;
  max-width: 290px;
}

.source-nextbook-use p {
  max-width: 920px;
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.62;
}

.source-nextbook-use p {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0.7rem;
}

.source-nextbook-use ul {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-nextbook-use li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  border: 0;
  border-left: 1px solid #e2e8f6;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
  padding: 0.18rem 0.6rem;
  word-break: normal;
  overflow-wrap: break-word;
}

.source-nextbook-use li span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #6d46c9;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
}

.source-nextbook-use li:nth-child(2) span { background: #1ca15b; }
.source-nextbook-use li:nth-child(3) span { background: #367de0; }
.source-nextbook-use li:nth-child(4) span { background: #f0a51a; }
.source-nextbook-use li:nth-child(5) span { background: #b65acb; }
.source-nextbook-use li:nth-child(6) span { background: #23a35b; }

@media (max-width: 900px) {
  .source-detail-card-wide,
  .source-detail-card-wide .source-narrative,
  .reading-sources-hero,
  .source-layout,
  .source-nextbook-use {
    grid-template-columns: 1fr;
  }

  .source-detail-card-wide .source-narrative section {
    border-left: 0;
    padding-left: 0;
  }

  .source-nextbook-use h2,
  .source-nextbook-use p,
  .source-nextbook-use ul {
    grid-column: 1;
    grid-row: auto;
  }

  .reading-sources-hero {
    grid-template-areas:
      "copy"
      "cards";
  }

  .source-hero-art {
    display: none;
  }

  .source-guide-grid,
  .source-narrative {
    grid-template-columns: 1fr;
  }

  .source-nextbook-use ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-narrative section {
    grid-template-columns: 5.8em minmax(0, 1fr);
  }

  .source-side-panel {
    position: static;
  }

  .source-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .source-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-nextbook-use ul {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

}

@media (max-width: 560px) {
  .reading-sources-main {
    padding: 1rem 0 2rem;
  }

  .reading-sources-hero {
    padding: 1.15rem;
  }

  .reading-sources-hero h1 {
    font-size: 2rem;
  }

  .source-info-card {
    grid-template-columns: 1fr;
  }

  .source-locale-field {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
  }

  .source-locale-field select {
    min-width: 0;
    width: min(180px, 48vw);
    max-width: 100%;
  }

  .source-principle-card strong {
    font-size: 0.98rem;
    word-break: break-word;
  }

  .source-hero-copy > p:last-child,
  .source-guide-card p,
  .source-panel-intro,
  .source-nextbook-use p,
  .source-nextbook-use li {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .source-detail-head {
    display: grid;
  }

  .source-detail-head > span {
    max-width: 100%;
    justify-self: start;
  }

  .source-detail-card {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 0.72rem;
  }

  .source-logo-mark {
    width: 54px;
    font-size: 0.78rem;
  }

  .source-category-badge {
    font-size: 0.58rem;
    padding: 0.18rem 0.34rem;
  }

  .source-nextbook-use ul {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  html,
  body {
    width: auto;
    overflow: visible;
    background: #fff !important;
  }

  .reading-sources-page .home-shell,
  .reading-sources-page .reading-sources-main,
  .reading-sources-page .reading-sources-hero,
  .reading-sources-page .source-layout {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }

  .reading-sources-page .reading-sources-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "cards";
    padding: 18mm 0 8mm;
  }

  .reading-sources-page .source-hero-art {
    display: none;
  }

  .reading-sources-page .source-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-sources-page .source-card-grid {
    grid-template-columns: 1fr;
  }

  .reading-sources-page .source-detail-card,
  .reading-sources-page .source-nextbook-use {
    break-inside: avoid;
  }
}
