:root {
  color-scheme: light;
  --ink: #2c2c2c;
  --ink-soft: #3f3f3d;
  --paper: #fafaf7;
  --surface: #ffffff;
  --muted: #8a8a86;
  --brass: #5b8a7a;
  --brass-soft: #4d7a6a;
  --walnut: #84532f;
  --walnut-deep: #4f2e1a;
  --teal: #8faaa4;
  --wine: #a78d95;
  --line: #eeeeea;
  --shadow: rgba(0, 0, 0, 0.06);
  --cursor-rest: auto;
  --cursor-active: pointer;
  --emboss-light: rgba(255, 255, 255, 0.95);
  --emboss-dark: rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --font-spine: Georgia, "Times New Roman", serif;
  --soft-card-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

@media (pointer: fine) and (min-width: 681px) {
  :root {
    --cursor-rest: url("snoopy-cursor-muted-small.png") 10 18, auto;
    --cursor-active: url("snoopy-cursor-active-small.png") 10 18, pointer;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #fafaf7;
  cursor: var(--cursor-rest);
}

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, 0.94) 0%, rgba(250, 250, 247, 0.78) 48%, rgba(242, 239, 232, 0.86) 100%),
    #fafaf7;
  background-size: auto;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  cursor: var(--cursor-rest);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  display: block;
  opacity: 0.055;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.045)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
  mix-blend-mode: multiply;
  filter: contrast(1.04);
}

body::after {
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: multiply;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: var(--cursor-active);
}

.boot-fallback {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10000;
  padding: 12px 14px;
  border: 1px solid rgba(91, 138, 122, 0.18);
  border-radius: 10px;
  color: #5f6763;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(44, 44, 44, 0.1);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

.boot-fallback.is-error {
  color: #8d3c3c;
  border-color: rgba(141, 60, 60, 0.2);
}

body.app-ready .boot-fallback {
  display: none;
}

a,
select,
.book-spine,
.shelf-tag,
.modal-scrim,
.modal-close,
.settings-toggle {
  cursor: var(--cursor-active);
}

input {
  cursor: text;
}

.library-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 56px;
}

.library-header {
  position: relative;
  z-index: 30;
  min-height: 0;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(109, 73, 39, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(255, 255, 252, 0.9), rgba(255, 239, 208, 0.72) 58%, rgba(213, 42, 45, 0.08)),
    linear-gradient(180deg, rgba(74, 167, 163, 0.13), transparent 72%);
  background-size: auto, auto;
  box-shadow:
    0 30px 74px rgba(112, 76, 39, 0.16),
    -7px -7px 18px rgba(255, 255, 255, 0.5),
    9px 12px 24px rgba(96, 61, 28, 0.17),
    -1px -1px 0 var(--emboss-light),
    1px 1px 0 rgba(82, 53, 25, 0.14),
    inset 2px 2px 4px rgba(255, 255, 255, 0.74),
    inset -3px -4px 10px rgba(96, 62, 30, 0.16),
    inset 0 -18px 42px rgba(124, 80, 38, 0.055);
  overflow: visible;
}

.library-header.has-settings-open {
  margin-bottom: 260px;
}

.library-header::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: calc(var(--radius) - 2px);
  box-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.48),
    1px 1px 0 rgba(85, 56, 29, 0.12),
    inset 1px 1px 3px rgba(255, 255, 255, 0.6),
    inset -1px -1px 4px rgba(88, 58, 29, 0.14);
  pointer-events: none;
}

.header-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 54px;
}

.title-block {
  position: relative;
  min-height: 72px;
  padding-right: 120px;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.eyebrow,
.modal-kicker {
  margin: 0 0 4px;
  color: #7a4d21;
  font-family: var(--font-serif);
  font-size: 0.74rem;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.36rem;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0;
}

.snoopy-stage {
  position: absolute;
  right: 2px;
  top: 50%;
  bottom: auto;
  width: 108px;
  height: 96px;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(calc(-50% + 3px));
}

.snoopy-stage::before {
  content: none;
}

.snoopy-reader {
  position: absolute;
  display: block;
  user-select: none;
}

.snoopy-reader {
  right: 8px;
  top: 50%;
  bottom: auto;
  width: auto;
  max-width: 84px;
  max-height: 96px;
  object-fit: contain;
  filter: none;
  transform: translateY(-50%);
}

.settings-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(96, 65, 34, 0.15);
  border-radius: 999px;
  color: #3c2b1e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(238, 222, 195, 0.36));
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.66),
    inset -1px -1px 3px rgba(83, 54, 27, 0.12),
    0 6px 14px rgba(87, 55, 27, 0.1);
  font-size: 1.08rem;
  line-height: 1;
}

.settings-toggle:hover,
.settings-toggle:focus-visible,
.settings-toggle[aria-expanded="true"] {
  outline: none;
  color: #173d3a;
  border-color: rgba(53, 128, 124, 0.26);
  background:
    linear-gradient(180deg, rgba(232, 249, 246, 0.86), rgba(178, 224, 217, 0.48));
  transform: translateY(-1px);
}

.sync-panel {
  display: none;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.55fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(96, 65, 34, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.86), rgba(244, 230, 205, 0.74));
  background-size: auto;
  box-shadow:
    0 18px 42px rgba(111, 72, 34, 0.15),
    -5px -5px 14px rgba(255, 255, 255, 0.42),
    7px 9px 18px rgba(93, 59, 30, 0.13),
    -1px -1px 0 var(--emboss-light),
    1px 1px 0 rgba(82, 53, 25, 0.13),
    inset 2px 2px 4px rgba(255, 255, 255, 0.64),
    inset -3px -4px 8px rgba(91, 60, 31, 0.13);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(760px, calc(100vw - 40px));
  backdrop-filter: blur(18px);
}

.settings-panel.is-open {
  display: grid;
}

.share-settings {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(96, 65, 34, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(244, 229, 202, 0.34)),
    linear-gradient(90deg, rgba(62, 154, 146, 0.08), transparent 58%);
  box-shadow:
    inset 1px 1px 3px rgba(255, 255, 255, 0.54),
    inset -2px -2px 5px rgba(96, 62, 30, 0.08);
}

.share-settings-head,
.share-settings-head > div,
.share-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-settings-head {
  justify-content: space-between;
}

.share-settings-head strong {
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 0.98rem;
}

.share-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f3b2a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: var(--cursor-active);
}

.share-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.share-switch span {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(96, 65, 34, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(220, 204, 178, 0.44));
  box-shadow:
    inset 1px 1px 3px rgba(86, 56, 29, 0.16),
    inset -1px -1px 2px rgba(255, 255, 255, 0.5);
}

.share-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff8e8;
  box-shadow: 0 2px 5px rgba(75, 48, 24, 0.2);
  transition: transform 160ms ease;
}

.share-switch input:checked + span {
  border-color: rgba(53, 128, 124, 0.28);
  background:
    linear-gradient(180deg, rgba(133, 208, 198, 0.8), rgba(62, 154, 146, 0.64));
}

.share-switch input:checked + span::after {
  transform: translateX(18px);
}

.share-switch input:focus-visible + span {
  outline: 2px solid rgba(62, 154, 146, 0.32);
  outline-offset: 2px;
}

.share-note,
.share-status {
  margin: 0;
  color: rgba(43, 33, 24, 0.58);
  font-size: 0.78rem;
  line-height: 1.5;
}

.share-status.is-error {
  color: #9c3341;
}

.share-owner-row {
  display: grid;
}

.share-owner-field {
  max-width: 420px;
}

.share-link-row {
  align-items: stretch;
}

.share-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(96, 65, 34, 0.13);
  border-radius: 6px;
  color: #2b2118;
  background: rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 2px 2px 4px rgba(80, 52, 24, 0.1),
    inset -1px -1px 3px rgba(255, 255, 255, 0.58);
}

.sync-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  color: #68503a;
  font-size: 0.84rem;
}

.sync-copy strong {
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  white-space: nowrap;
}

.sync-copy span:last-child {
  grid-column: 2;
  position: relative;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.45;
  cursor: help;
}

.sync-copy span:last-child::after {
  content: attr(data-full-text);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(44, 44, 44, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sync-copy span:last-child:hover::after,
.sync-copy span:last-child:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.sync-copy span:last-child.is-error {
  color: #9c3341;
}

.sync-mark {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(74, 167, 163, 0.22);
  border-radius: 999px;
  color: #286c69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(212, 239, 235, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(77, 51, 26, 0.06);
  font-size: 0.74rem;
  font-weight: 700;
}

.api-key-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, max-content);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.turnstile-row {
  grid-column: 1 / -1;
  justify-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(136px, 150px);
  gap: 10px;
  align-items: center;
  width: min(100%, 430px);
  margin-top: 2px;
  padding: 8px 10px 8px 12px;
  border: 1px solid color-mix(in srgb, var(--brass) 12%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(237, 243, 240, 0.58), rgba(255, 255, 255, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(44, 44, 44, 0.035);
  overflow: visible;
}

.turnstile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.turnstile-copy strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.turnstile-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.turnstile-copy span.is-error {
  color: #9c3341;
}

.turnstile-mount {
  width: 150px;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.turnstile-mount > div,
.turnstile-mount iframe {
  flex: 0 0 auto;
  max-width: 150px;
}

.api-key-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(96, 65, 34, 0.13);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(240, 226, 202, 0.28));
  box-shadow:
    inset 2px 2px 4px rgba(76, 50, 25, 0.13),
    inset -1px -1px 3px rgba(255, 255, 255, 0.62),
    0 1px 0 rgba(255, 255, 255, 0.7);
}

.api-key-field span {
  color: #7a4d21;
  font-size: 0.78rem;
  white-space: nowrap;
}

.api-key-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2b2118;
}

.api-key-field input::placeholder {
  color: rgba(43, 33, 24, 0.34);
}

.sync-button,
.export-button,
.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.api-key-form .ghost-button {
  min-width: 58px;
}

.api-key-form .sync-button {
  min-width: 88px;
}

.sync-button {
  border: 1px solid rgba(135, 83, 34, 0.2);
  color: #21170f;
  background:
    linear-gradient(180deg, #f7df91, #d59c47);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 5px 14px rgba(142, 92, 36, 0.16);
}

.export-button {
  border: 1px solid rgba(53, 128, 124, 0.26);
  color: #153c39;
  background:
    linear-gradient(180deg, rgba(228, 248, 244, 0.86), rgba(116, 192, 184, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 5px 14px rgba(45, 123, 119, 0.13);
}

.ghost-button {
  border: 1px solid rgba(96, 65, 34, 0.14);
  color: #6b5139;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(238, 222, 195, 0.28));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 1px 2px rgba(77, 51, 26, 0.06);
}

.sync-button:hover,
.sync-button:focus-visible,
.export-button:hover,
.export-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  outline: none;
  filter: saturate(1.05) brightness(1.03);
  transform: translateY(-1px);
}

.sync-button:disabled,
.export-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.62;
  transform: none;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 1px;
  min-width: 330px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow:
    0 18px 46px rgba(118, 78, 36, 0.14),
    -4px -4px 12px rgba(255, 255, 255, 0.36),
    5px 7px 14px rgba(93, 59, 30, 0.11),
    -1px -1px 0 rgba(255, 255, 255, 0.72),
    1px 1px 0 rgba(82, 53, 25, 0.12),
    inset 2px 2px 4px rgba(255, 255, 255, 0.54),
    inset -2px -2px 4px rgba(82, 53, 25, 0.13);
}

.stat-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  background:
    linear-gradient(180deg, rgba(255, 252, 243, 0.84), rgba(245, 232, 210, 0.78));
  background-size: auto;
}

.stat-item strong {
  display: block;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.1;
}

.stat-item span {
  display: block;
  margin-top: 0;
  color: #7a614b;
  font-size: 0.72rem;
  white-space: nowrap;
}

.view-tabs {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
  padding: 5px;
  border: 1px solid rgba(96, 65, 34, 0.13);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 254, 248, 0.78), rgba(239, 223, 195, 0.5));
  box-shadow:
    inset 1px 1px 3px rgba(255, 255, 255, 0.62),
    inset -1px -2px 5px rgba(93, 59, 30, 0.12),
    0 8px 20px rgba(89, 57, 28, 0.08);
}

.view-tab {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #6b5139;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
}

.view-tab.is-active {
  color: #21170f;
  border-color: rgba(135, 83, 34, 0.22);
  background:
    linear-gradient(180deg, #f4dd96, #cf9a4d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 4px 12px rgba(139, 91, 36, 0.14);
}

.view-tab:hover,
.view-tab:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.stats-view {
  display: grid;
  gap: 18px;
}

.stats-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(96, 65, 34, 0.15);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 86% 22%, rgba(62, 154, 146, 0.16), transparent 28%),
    radial-gradient(circle at 10% 0%, rgba(185, 130, 56, 0.2), transparent 30%),
    linear-gradient(115deg, rgba(255, 254, 248, 0.94), rgba(246, 229, 198, 0.78) 62%, rgba(214, 185, 126, 0.22)),
    linear-gradient(180deg, rgba(185, 130, 56, 0.12), transparent);
  box-shadow:
    0 22px 58px rgba(112, 76, 39, 0.15),
    -5px -5px 14px rgba(255, 255, 255, 0.4),
    7px 9px 18px rgba(93, 59, 30, 0.12),
    inset 2px 2px 4px rgba(255, 255, 255, 0.68),
    inset -3px -4px 8px rgba(103, 69, 36, 0.12);
}

.stats-hero h2 {
  margin: 0;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.stats-save {
  flex: 0 0 auto;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stats-overview-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(96, 65, 34, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 18%, var(--stat-glow, rgba(185, 130, 56, 0.16)), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(244, 229, 202, 0.58));
  box-shadow:
    0 18px 38px rgba(108, 72, 35, 0.13),
    -3px -3px 10px rgba(255, 255, 255, 0.34),
    inset 1px 1px 3px rgba(255, 255, 255, 0.62),
    inset -2px -2px 6px rgba(93, 59, 30, 0.1);
}

.stats-overview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--stat-accent, #b98238);
  opacity: 0.78;
}

.stats-overview-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 92px;
  height: 92px;
  border: 1px solid var(--stat-accent, rgba(185, 130, 56, 0.28));
  border-radius: 50%;
  opacity: 0.28;
}

.stats-overview-card.tone-paper {
  --stat-accent: #8b633d;
  --stat-glow: rgba(139, 99, 61, 0.16);
}

.stats-overview-card.tone-brass {
  --stat-accent: #c69045;
  --stat-glow: rgba(198, 144, 69, 0.22);
}

.stats-overview-card.tone-teal {
  --stat-accent: #3e9a92;
  --stat-glow: rgba(62, 154, 146, 0.2);
}

.stats-overview-card.tone-wine {
  --stat-accent: #9a4b5c;
  --stat-glow: rgba(154, 75, 92, 0.15);
}

.stats-overview-card.tone-ink {
  --stat-accent: #2f4251;
  --stat-glow: rgba(47, 66, 81, 0.14);
}

.stats-overview-card strong {
  position: relative;
  z-index: 1;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
}

.stats-overview-card span {
  position: relative;
  z-index: 1;
  color: #735f4a;
  font-size: 0.82rem;
  font-weight: 700;
}

.stats-overview-card small {
  position: relative;
  z-index: 1;
  color: rgba(43, 33, 24, 0.5);
  font-size: 0.7rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.stats-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(96, 65, 34, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(62, 154, 146, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 254, 248, 0.9), rgba(245, 232, 209, 0.74));
  box-shadow:
    0 20px 52px rgba(109, 72, 35, 0.14),
    -5px -5px 14px rgba(255, 255, 255, 0.36),
    7px 9px 18px rgba(93, 59, 30, 0.12),
    inset 2px 2px 4px rgba(255, 255, 255, 0.62),
    inset -3px -4px 8px rgba(103, 69, 36, 0.11);
}

.chart-card-feature::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}

.stats-timeline-card {
  grid-column: 1 / -1;
}

.stats-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stats-card-heading span {
  color: #7a4d21;
  font-family: var(--font-serif);
  font-size: 0.74rem;
}

.stats-card-heading h2 {
  margin: 2px 0 0;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.stats-card-heading p {
  margin: 2px 0 0;
  color: rgba(43, 33, 24, 0.56);
  font-size: 0.78rem;
  text-align: right;
}

.category-chart-layout {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.category-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -2px 0 15px;
}

.category-insight {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: end;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--category-color) 28%, transparent);
  border-radius: var(--radius);
  color: #2e2117;
  background:
    radial-gradient(circle at 92% 20%, color-mix(in srgb, var(--category-color) 18%, transparent), transparent 38%),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 1px 1px 3px rgba(255, 255, 255, 0.5),
    0 8px 18px rgba(89, 55, 24, 0.06);
}

.category-insight span,
.category-insight em {
  color: rgba(43, 33, 24, 0.54);
  font-size: 0.68rem;
  font-style: normal;
}

.category-insight strong {
  min-width: 0;
  overflow: hidden;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-insight em {
  grid-row: 1 / 3;
  grid-column: 2;
  color: color-mix(in srgb, var(--category-color) 80%, #2e2117);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
}

.category-donut {
  width: 100%;
  max-width: 260px;
  filter:
    drop-shadow(0 18px 22px rgba(89, 55, 24, 0.15))
    drop-shadow(-4px -4px 10px rgba(255, 255, 255, 0.42));
}

.donut-slice {
  cursor: var(--cursor-active);
  stroke: rgba(255, 250, 239, 0.82);
  stroke-width: 2;
  transition: transform 140ms ease, filter 140ms ease;
  transform-origin: center;
}

.donut-slice:hover,
.donut-slice:focus-visible {
  outline: none;
  filter: brightness(1.08) saturate(1.06);
  transform: scale(1.012);
}

.donut-center {
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7))
    drop-shadow(0 8px 14px rgba(83, 54, 27, 0.08));
}

.donut-total {
  fill: #2e2117;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
}

.donut-label {
  fill: rgba(43, 33, 24, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
}

.category-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 286px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-color: rgba(202, 165, 106, 0.42) transparent;
  scrollbar-width: thin;
}

.category-legend-item {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(96, 65, 34, 0.1);
  border-radius: 999px;
  color: #4f3b2a;
  background: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
}

.category-legend-item > * {
  position: relative;
  z-index: 1;
}

.category-legend-item b {
  position: absolute;
  z-index: 0;
  left: 0;
  bottom: 0;
  width: var(--legend-width);
  height: 100%;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--category-color) 18%, transparent), transparent);
}

.category-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--category-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.52);
}

.category-legend-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-legend-item strong {
  color: #2e2117;
  font-size: 0.78rem;
}

.category-legend-item:hover,
.category-legend-item:focus-visible {
  outline: none;
  border-color: rgba(135, 83, 34, 0.22);
  background: rgba(255, 249, 236, 0.78);
  transform: translateY(-1px);
}

.progress-distribution {
  display: grid;
  gap: 11px;
}

.progress-dist-row {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(96, 65, 34, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.32);
}

.progress-dist-label strong,
.progress-dist-label span {
  display: block;
}

.progress-dist-label strong {
  color: #2e2117;
  font-size: 0.84rem;
}

.progress-dist-label span {
  margin-top: 2px;
  color: rgba(43, 33, 24, 0.54);
  font-size: 0.72rem;
}

.progress-dist-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 95, 62, 0.14);
  box-shadow:
    inset 1px 1px 2px rgba(71, 45, 22, 0.12),
    inset -1px -1px 2px rgba(255, 255, 255, 0.5);
}

.progress-dist-track i {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #b98238, #e6cb7c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.progress-dist-row:last-child .progress-dist-track i {
  background:
    linear-gradient(90deg, #3e9a92, #98d2bc);
}

.progress-dist-count {
  color: #4f3b2a;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.state-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 22px;
  align-items: stretch;
}

.state-map-canvas {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(238, 238, 232, 0.92);
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 34%, rgba(94, 140, 174, 0.12), transparent 24%),
    radial-gradient(circle at 35% 70%, rgba(139, 126, 184, 0.12), transparent 28%),
    radial-gradient(circle at 67% 39%, rgba(91, 138, 122, 0.15), transparent 27%),
    radial-gradient(circle at 73% 70%, rgba(168, 184, 160, 0.1), transparent 23%),
    radial-gradient(circle at 49% 47%, rgba(255, 255, 255, 0.9), rgba(250, 250, 247, 0.25) 46%, rgba(237, 243, 240, 0.3) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(246, 246, 242, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -30px 78px rgba(91, 138, 122, 0.075),
    0 18px 48px rgba(44, 44, 44, 0.045);
}

.state-map-canvas::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(91, 138, 122, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

.state-map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

.state-star-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.state-dot {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 999px;
  background: var(--dot-color);
  opacity: 0.32;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.48),
    0 4px 12px color-mix(in srgb, var(--dot-color), transparent 78%);
  mix-blend-mode: multiply;
}

.state-node {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--node-color), #ffffff 66%);
  border-radius: 999px;
  color: #2c2c2c;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82) 0 15%, transparent 38%),
    radial-gradient(circle at 68% 76%, color-mix(in srgb, var(--node-color), transparent 76%), transparent 62%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--node-soft), #ffffff 18%));
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--node-color), transparent 78%),
    0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -12px 24px rgba(44, 44, 44, 0.05);
  transform: translate(-50%, -50%);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.state-node:hover,
.state-node:focus-visible {
  z-index: 3;
  outline: none;
  border-color: color-mix(in srgb, var(--node-color), #ffffff 36%);
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--node-color), transparent 70%),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -10px 22px rgba(44, 44, 44, 0.05);
  transform: translate(-50%, -50%) scale(1.04);
}

.state-node strong,
.state-node span {
  display: block;
  max-width: 100%;
  text-align: center;
}

.state-node strong {
  font-family: var(--font-serif);
  overflow: visible;
  font-size: clamp(12px, 1.05vw, 17px);
  font-weight: 700;
  line-height: 1.12;
  white-space: normal;
}

.state-node span {
  color: color-mix(in srgb, var(--node-color), #2c2c2c 36%);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.state-node.is-small strong {
  font-size: 12px;
}

.state-node.is-small span {
  font-size: 11px;
}

.state-node.is-empty {
  opacity: 0.62;
  filter: grayscale(0.45);
  box-shadow:
    0 8px 22px rgba(44, 44, 44, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.state-map-legend {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 4px 8px 4px 0;
}

.state-map-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px 8px 10px 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(238, 238, 232, 0.9);
  border-left: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  transition: color 180ms ease, transform 180ms ease;
}

.state-map-legend-item:hover,
.state-map-legend-item:focus-visible {
  outline: none;
  transform: translateX(2px);
}

.state-map-legend-item:last-child {
  border-bottom: 0;
}

.state-map-legend-item i {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--legend-color), transparent 84%);
}

.state-map-legend-item strong {
  display: inline-flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: baseline;
  color: #2c2c2c;
  font-size: 14px;
  font-weight: 700;
}

.state-map-legend-item em {
  color: var(--legend-color);
  font-style: normal;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: left;
}

.state-map-legend-item span {
  display: block;
  margin-top: 3px;
  color: #8a8a86;
  font-size: 12px;
  line-height: 1.45;
}

.state-books-panel {
  width: min(880px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  background:
    radial-gradient(circle at 14% 10%, color-mix(in srgb, var(--state-color, #5b8a7a), transparent 86%), transparent 30%),
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--state-color, #5b8a7a), transparent 91%), transparent 34%),
    #ffffff;
}

.state-books-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.state-books-head h3 i {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--state-color, #5b8a7a);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--state-color, #5b8a7a), transparent 84%);
}

.state-books-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-height: min(560px, calc(100vh - 230px));
  overflow: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-color: color-mix(in srgb, var(--state-color, #5b8a7a), transparent 54%) transparent;
}

.state-book-item {
  min-height: 86px;
  border-color: rgba(238, 238, 232, 0.96);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(250, 250, 247, 0.76));
}

.state-book-item:hover,
.state-book-item:focus-visible {
  border-color: color-mix(in srgb, var(--state-color, #5b8a7a), transparent 64%);
  box-shadow: 0 10px 26px rgba(44, 44, 44, 0.06);
}

.state-book-item .author-book-copy {
  gap: 4px;
}

.state-book-item .author-book-copy strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.state-book-item .author-book-copy small {
  overflow: hidden;
  color: #8a8a86;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-books-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 34px;
  border: 1px dashed rgba(138, 138, 134, 0.28);
  border-radius: 14px;
  color: #8a8a86;
  text-align: center;
}

.reading-heatmap {
  display: grid;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-color: rgba(202, 165, 106, 0.42) transparent;
  scrollbar-width: thin;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 54px repeat(12, minmax(44px, 1fr));
  gap: 7px;
  align-items: center;
  min-width: 720px;
}

.heatmap-row strong,
.heatmap-header span {
  color: rgba(43, 33, 24, 0.55);
  font-size: 0.72rem;
  font-weight: 700;
}

.heatmap-cell {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 65, 34, 0.08);
  border-radius: 7px;
  color: rgba(43, 33, 24, 0.7);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(126, 95, 62, 0.1));
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.44),
    inset -1px -1px 2px rgba(71, 45, 22, 0.08);
}

.heatmap-cell.level-1 {
  background: linear-gradient(145deg, #f1dfbc, #e1c28b);
}

.heatmap-cell.level-2 {
  background: linear-gradient(145deg, #e5c982, #cfa05a);
}

.heatmap-cell.level-3 {
  color: #23180e;
  background: linear-gradient(145deg, #d29b4c, #ad7130);
}

.heatmap-cell.level-4 {
  color: #102927;
  background: linear-gradient(145deg, #95d8cc, #3e9a92);
}

.is-public-share .settings-toggle,
.is-public-share .settings-panel,
.is-public-share .view-tabs,
.is-public-share .notes-panel,
.is-public-share .weread-link {
  display: none !important;
}

.stats-empty {
  margin: 0;
  color: rgba(43, 33, 24, 0.62);
  font-size: 0.86rem;
}

.control-deck {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 254, 248, 0.92), rgba(247, 236, 217, 0.9));
  background-size: auto;
  box-shadow:
    0 18px 46px rgba(118, 78, 36, 0.15),
    -5px -5px 14px rgba(255, 255, 255, 0.42),
    7px 9px 18px rgba(93, 59, 30, 0.13),
    -1px -1px 0 var(--emboss-light),
    1px 1px 0 rgba(82, 53, 25, 0.13),
    inset 2px 2px 4px rgba(255, 255, 255, 0.66),
    inset -3px -4px 8px rgba(103, 69, 36, 0.13);
  backdrop-filter: blur(18px);
}

.filter-row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.filter-row-primary {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 190px);
}

.filter-row-secondary {
  grid-template-columns: minmax(430px, 1fr) minmax(150px, 200px) auto;
}

.search-field,
.select-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(96, 65, 34, 0.13);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(240, 226, 202, 0.25));
  box-shadow:
    inset 2px 2px 4px rgba(80, 52, 24, 0.12),
    inset -1px -1px 3px rgba(255, 255, 255, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.66);
}

.search-field {
  grid-template-columns: auto minmax(0, 1fr) 28px;
}

.search-field span,
.select-field span {
  color: #7a4d21;
  font-size: 0.78rem;
  white-space: nowrap;
}

.search-field input,
.select-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2b2118;
}

.search-field input::placeholder {
  color: rgba(43, 33, 24, 0.42);
}

.search-clear {
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: 1px solid rgba(96, 65, 34, 0.12);
  border-radius: 50%;
  color: #715744;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(237, 222, 198, 0.42));
  font-size: 1rem;
  line-height: 1;
}

.search-field.has-value .search-clear {
  display: grid;
}

.search-clear:hover,
.search-clear:focus-visible {
  outline: none;
  color: #2b2118;
  border-color: rgba(135, 83, 34, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.94), rgba(227, 198, 151, 0.46));
}

.select-field select {
  appearance: none;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
}

.segment {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(96, 65, 34, 0.1);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(232, 230, 225, 0.54));
  color: #6a6057;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(77, 51, 26, 0.04);
}

.segment:hover,
.segment:focus-visible {
  outline: none;
  color: #2b2118;
  border-color: rgba(135, 83, 34, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.86), rgba(230, 205, 164, 0.36));
}

.segment.is-active {
  color: #21170f;
  border-color: rgba(135, 83, 34, 0.22);
  background: linear-gradient(180deg, #f5d986, #d39b48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 3px 10px rgba(139, 91, 36, 0.12);
}

.filter-summary {
  justify-self: end;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(74, 167, 163, 0.18);
  border-radius: 999px;
  color: #315d59;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(217, 239, 235, 0.42));
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.shelves {
  display: grid;
  gap: 28px;
}

.category-section {
  border: 1px solid rgba(106, 69, 38, 0.16);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 232, 204, 0.42)),
    rgba(255, 248, 235, 0.74);
  background-size: auto, auto;
  box-shadow:
    0 24px 62px rgba(118, 78, 36, 0.16),
    -6px -6px 16px rgba(255, 255, 255, 0.4),
    9px 12px 24px rgba(94, 59, 29, 0.14),
    -1px -1px 0 var(--emboss-light),
    1px 1px 0 rgba(82, 53, 25, 0.13),
    inset 2px 2px 5px rgba(255, 255, 255, 0.64),
    inset -3px -4px 9px rgba(82, 53, 25, 0.13);
}

.wall-section {
  box-shadow:
    0 32px 82px rgba(103, 65, 31, 0.2),
    -7px -7px 18px rgba(255, 255, 255, 0.43),
    10px 13px 26px rgba(88, 54, 27, 0.16),
    -1px -1px 0 var(--emboss-light),
    1px 1px 0 rgba(82, 53, 25, 0.14),
    inset 2px 2px 5px rgba(255, 255, 255, 0.66),
    inset -3px -4px 10px rgba(82, 53, 25, 0.14);
}

.category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(106, 69, 38, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 243, 0.68), rgba(244, 229, 202, 0.5));
  background-size: auto;
}

.category-heading h2 {
  margin: 0;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.category-heading span {
  color: #7a614b;
  font-size: 0.84rem;
  white-space: nowrap;
}

.shelf-frame {
  padding: 12px 14px 0;
  border-left: 12px solid rgba(126, 77, 40, 0.86);
  border-right: 12px solid rgba(126, 77, 40, 0.86);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 15%, transparent 85%, rgba(92, 52, 27, 0.06)),
    repeating-linear-gradient(90deg, rgba(108, 74, 44, 0.075) 0 14px, rgba(255, 249, 237, 0.7) 14px 31px);
  background-size: auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 12px 0 22px rgba(89, 52, 26, 0.16),
    inset -12px 0 22px rgba(89, 52, 26, 0.16),
    inset 0 8px 16px rgba(255, 255, 255, 0.18);
}

.wall-frame {
  padding-top: 18px;
}

.shelf-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 218px;
  padding: 18px 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(202, 165, 106, 0.34) transparent;
  scrollbar-width: thin;
}

.wall-row {
  min-height: 226px;
}

.shelf-row::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(90deg, rgba(101, 62, 34, 0.12), transparent 12%, transparent 88%, rgba(101, 62, 34, 0.16));
}

.shelf-plank {
  height: 24px;
  margin: 0 -14px;
  border-top: 1px solid rgba(255, 232, 185, 0.23);
  background:
    linear-gradient(180deg, #c8965e, #855632 52%, #57321e),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 20px);
  box-shadow:
    0 14px 24px rgba(78, 45, 20, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -4px 8px rgba(57, 31, 16, 0.22);
}

.book-spine {
  --book-hue: 32;
  --book-sat: 50%;
  --book-light: 42%;
  --book-width: 28px;
  --book-height: 168px;
  --book-progress: 0%;
  --spine-top: hsl(var(--book-hue) var(--book-sat) calc(var(--book-light) + 8%));
  --spine-bottom: hsl(var(--book-hue) var(--book-sat) var(--book-light));
  --spine-accent: rgba(255, 248, 232, 0.32);
  --spine-text: rgba(255, 248, 232, 0.93);
  --spine-title-shadow: rgba(0, 0, 0, 0.82);
  --spine-title-backdrop: rgba(0, 0, 0, 0.14);
  --spine-texture: none;
  --spine-band-top: 15%;
  --spine-band-bottom: 78%;
  --spine-line-opacity: 0.18;
  position: relative;
  z-index: 1;
  flex: 0 0 var(--book-width);
  width: var(--book-width);
  height: var(--book-height);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom: 0;
  border-radius: 2px 5px 0 0;
  appearance: none;
  overflow: hidden;
  color: var(--spine-text);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0.22) 13%, rgba(255, 255, 255, 0.04) 34%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 18%) var(--spine-band-top) calc(var(--spine-band-top) + 3px), transparent calc(var(--spine-band-top) + 3px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 25%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  box-shadow:
    3px 0 8px rgba(80, 45, 18, 0.34),
    inset 3px 0 5px rgba(255, 255, 255, 0.08),
    inset -4px 0 8px rgba(0, 0, 0, 0.32);
  transform-origin: bottom center;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.book-spine.has-cover-visual,
.book-spine.is-album.has-cover-visual,
.book-spine.is-collection.has-cover-visual {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.24) 11%, rgba(255, 255, 255, 0.05) 33%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--spine-accent), transparent 78%) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 12%) var(--spine-band-top) calc(var(--spine-band-top) + 2px), transparent calc(var(--spine-band-top) + 2px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 22%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    var(--spine-texture),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-repeat: no-repeat;
  background-size: auto, auto, auto, auto, auto, 100% 100%, auto;
  background-position: center;
  background-blend-mode: normal, normal, soft-light, soft-light, soft-light, multiply, normal;
}

.book-spine.has-cover-fallback {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0.2) 12%, transparent 34%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, hsl(var(--book-hue) var(--book-sat) calc(var(--book-light) + 10%)), hsl(var(--book-hue) var(--book-sat) calc(var(--book-light) - 3%)));
}

.book-spine:hover,
.book-spine:focus-visible {
  z-index: 6;
  outline: 0;
  transform: translateY(-16px) scale(1.04);
  filter: saturate(1.1) brightness(1.12);
  box-shadow:
    8px 12px 22px rgba(0, 0, 0, 0.45),
    inset 3px 0 5px rgba(255, 255, 255, 0.1),
    inset -4px 0 8px rgba(0, 0, 0, 0.28);
}

.book-spine::before {
  content: "";
  position: absolute;
  inset: 9px 5px auto;
  height: 2px;
  background: color-mix(in srgb, var(--spine-accent), white 16%);
  opacity: var(--spine-line-opacity);
  box-shadow:
    0 10px 0 color-mix(in srgb, var(--spine-accent), transparent 22%),
    0 18px 0 color-mix(in srgb, var(--spine-accent), transparent 48%);
}

.book-spine::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--book-progress);
  max-height: 100%;
  background: linear-gradient(180deg, rgba(226, 197, 143, 0.12), rgba(226, 197, 143, 0.44));
  border-top: 1px solid rgba(255, 247, 231, 0.22);
}

.book-spine.is-done::after {
  background: linear-gradient(180deg, rgba(82, 168, 132, 0.12), rgba(82, 168, 132, 0.5));
}

.book-spine.is-unread::after {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.book-spine.is-album {
  --book-width: 42px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.32), rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.28)),
    linear-gradient(180deg, #42a6a2, #1e5d68);
}

.book-spine.is-collection {
  --book-width: 46px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.24)),
    linear-gradient(180deg, #e0ac52, #8c572a);
}

.book-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100% - 18px);
  padding: 26px 4px 10px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  overflow: hidden;
  color: var(--spine-text);
  font-family: var(--font-serif);
  font-size: var(--spine-title-size, 13px);
  font-weight: 700;
  line-height: var(--spine-title-line, 1.12);
  text-shadow:
    0 1px 2px var(--spine-title-shadow),
    0 0 10px rgba(0, 0, 0, 0.18);
  word-break: break-all;
}

.book-spine.has-cover-visual .book-title {
  padding-inline: 5px;
  background:
    linear-gradient(90deg, transparent, var(--spine-title-backdrop) 18%, var(--spine-title-backdrop) 82%, transparent);
  backdrop-filter: saturate(1.1);
}

.shelf-tag {
  --tag-hue: 38;
  position: relative;
  z-index: 2;
  flex: 0 0 32px;
  width: 32px;
  height: 166px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  margin: 0 8px 0 5px;
  padding: 12px 4px 8px;
  border: 1px solid rgba(72, 45, 26, 0.18);
  border-bottom: 0;
  border-radius: 999px 999px 2px 2px;
  color: #2b2118;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent 40%, rgba(0, 0, 0, 0.08)),
    linear-gradient(180deg, hsl(var(--tag-hue) 68% 78%), hsl(var(--tag-hue) 54% 62%));
  box-shadow:
    6px 8px 16px rgba(71, 42, 19, 0.16),
    -2px -2px 6px rgba(255, 255, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset -2px -3px 6px rgba(81, 49, 25, 0.12);
}

.shelf-tag::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
  transform: translateX(-50%);
  box-shadow: inset 0 0 0 1px rgba(72, 45, 26, 0.14);
}

.shelf-tag strong {
  max-height: 106px;
  max-width: 1.2em;
  overflow: hidden;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.8rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.shelf-tag span {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(43, 33, 24, 0.72);
  background: rgba(255, 255, 255, 0.48);
  font-size: 0.68rem;
  font-weight: 700;
}

.book-status-pin {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.28);
  transform: translateX(-50%);
}

.book-spine.is-done .book-status-pin {
  background: #76d0a6;
  box-shadow: 0 0 12px rgba(118, 208, 166, 0.58);
}

.book-hover-card {
  position: fixed;
  z-index: 90;
  width: min(260px, calc(100vw - 28px));
  padding: 12px 13px;
  border: 1px solid rgba(89, 58, 32, 0.16);
  border-radius: var(--radius);
  color: #2b2118;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(247, 232, 204, 0.62)),
    #fff7e8;
  box-shadow:
    0 18px 42px rgba(58, 35, 17, 0.24),
    -3px -3px 10px rgba(255, 255, 255, 0.38),
    inset 1px 1px 3px rgba(255, 255, 255, 0.56),
    inset -2px -2px 5px rgba(91, 60, 31, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 120ms ease;
}

.book-hover-card.is-visible {
  opacity: 1;
}

.book-hover-card strong {
  display: block;
  color: #20170f;
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.35;
}

.book-hover-card span {
  display: block;
  margin-top: 5px;
  color: #735f4a;
  font-size: 0.76rem;
  line-height: 1.4;
}

.book-hover-progress {
  margin-top: 9px;
}

.book-hover-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 95, 62, 0.16);
}

.book-hover-progress-fill {
  height: 100%;
  width: var(--hover-progress, 0%);
  border-radius: inherit;
  background:
    linear-gradient(90deg, #3e9a92, #d39b48);
}

.book-hover-progress span {
  margin-top: 5px;
  color: #315d59;
  font-weight: 700;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
}

.empty-state-guide {
  align-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}

.empty-state-guide strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.empty-state-guide span {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.book-modal.is-open {
  display: flex;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(42, 30, 18, 0.52);
  backdrop-filter: blur(18px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  width: min(940px, 100%);
  min-height: 340px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(89, 58, 32, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(246, 220, 184, 0.38)),
    #fff7e8;
  background-size: auto, auto;
  box-shadow:
    0 30px 90px rgba(63, 38, 18, 0.36),
    -6px -6px 16px rgba(255, 255, 255, 0.38),
    8px 11px 24px rgba(62, 38, 18, 0.22),
    -1px -1px 0 rgba(255, 255, 255, 0.78),
    1px 1px 0 rgba(82, 53, 25, 0.14),
    inset 2px 2px 5px rgba(255, 255, 255, 0.64),
    inset -3px -4px 10px rgba(105, 70, 36, 0.14);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(89, 58, 32, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  color: #2b2118;
  font-size: 1.3rem;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
  outline: none;
  background: rgba(221, 183, 117, 0.22);
}

.cover-stage {
  align-self: start;
  width: 210px;
  min-height: 302px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 50% 78%, rgba(91, 57, 28, 0.14), transparent 56%),
    linear-gradient(180deg, rgba(255, 250, 239, 0.72), rgba(236, 214, 181, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 4px rgba(96, 62, 30, 0.08);
}

.cover-stage img {
  width: 172px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 5px;
  box-shadow:
    0 18px 34px rgba(69, 42, 20, 0.22),
    0 3px 8px rgba(69, 42, 20, 0.14);
}

.cover-placeholder {
  width: 172px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #c99354, #6e4226);
  color: #fff4df;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
  box-shadow:
    0 18px 34px rgba(69, 42, 20, 0.22),
    0 3px 8px rgba(69, 42, 20, 0.14);
}

.modal-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal-copy h2 {
  margin: 0;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.28;
  letter-spacing: 0;
}

.modal-author {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.meta-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(89, 58, 32, 0.14);
  border-radius: 999px;
  color: #5e4633;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
}

.progress-block {
  margin-top: 18px;
}

.progress-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-line strong {
  color: #2b2118;
  font-size: 1.12rem;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(89, 58, 32, 0.13);
  border-radius: 999px;
  background: rgba(115, 81, 48, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--brass-soft));
}

.progress-note {
  margin: 10px 0 0;
  color: rgba(43, 33, 24, 0.62);
  font-size: 0.84rem;
  line-height: 1.5;
}

.notes-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(89, 58, 32, 0.13);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(244, 229, 202, 0.28));
  box-shadow:
    inset 1px 1px 3px rgba(255, 255, 255, 0.54),
    inset -1px -2px 5px rgba(96, 62, 30, 0.08);
}

.notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notes-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-heading strong {
  display: block;
  color: #2e2117;
  font-family: var(--font-serif);
  font-size: 1rem;
}

.notes-heading span {
  display: block;
  margin-top: 3px;
  color: rgba(43, 33, 24, 0.58);
  font-size: 0.78rem;
}

.notes-load {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(135, 83, 34, 0.22);
  border-radius: 999px;
  color: #20160e;
  background: linear-gradient(180deg, #f4dd96, #cf9a4d);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 4px 12px rgba(139, 91, 36, 0.14);
}

.notes-export {
  border-color: rgba(135, 83, 34, 0.28);
  color: #6b4a2a;
  background: rgba(255, 250, 239, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.notes-load:hover,
.notes-load:focus-visible {
  outline: none;
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.02);
}

.notes-load:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notes-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border-bottom: 1px solid rgba(96, 65, 34, 0.12);
  background: rgba(255, 255, 255, 0.24);
}

.notes-tabs button {
  position: relative;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b5139;
  font-size: 0.78rem;
}

.notes-tabs button.is-active {
  color: #1d140d;
  background: rgba(245, 217, 134, 0.16);
  font-weight: 700;
}

.notes-tabs button.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #b98238, #d39b48);
}

.notes-list {
  display: grid;
  gap: 0;
  max-height: 310px;
  margin-top: 12px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-color: rgba(202, 165, 106, 0.42) transparent;
  scrollbar-width: thin;
}

.notes-empty,
.notes-loading {
  margin: 12px 0 0;
  color: rgba(43, 33, 24, 0.62);
  font-size: 0.84rem;
  line-height: 1.55;
}

.notes-empty.is-error {
  color: #9c3341;
}

.trace-card {
  padding: 12px 11px 12px 13px;
  border-top: 1px solid rgba(89, 58, 32, 0.12);
  border-left: 3px solid rgba(111, 103, 94, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.54), rgba(246, 232, 208, 0.22));
}

.trace-card:first-child {
  border-top: 0;
}

.trace-card.is-review {
  border-left-color: rgba(62, 154, 146, 0.72);
}

.trace-card.is-bookmark {
  border-left-color: rgba(111, 103, 94, 0.46);
}

.trace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  color: rgba(43, 33, 24, 0.55);
  font-size: 0.72rem;
}

.trace-meta span:first-child {
  color: #7a4d21;
  font-weight: 700;
}

.trace-card blockquote {
  margin: 0;
  padding-left: 0;
  border-left: 0;
  color: #2d241c;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.58;
}

.trace-thought {
  margin: 8px 0 0;
  color: #453628;
  font-size: 0.88rem;
  line-height: 1.6;
}

.trace-link {
  display: inline-flex;
  margin-top: 8px;
  color: #2e756f;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.weread-link {
  align-self: flex-start;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #2e756f;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.84rem;
  font-weight: 700;
}

.weread-link:hover,
.weread-link:focus-visible {
  outline: none;
  color: #1d5c57;
}

.weread-link.is-hidden {
  display: none;
}

/* Quiet study theme: color, type, and spacing only. */
.library-shell {
  width: min(1500px, calc(100% - 48px));
  padding: 24px 0 72px;
}

.library-header,
.sync-panel,
.control-deck,
.stats-hero,
.stats-card,
.stats-overview-card,
.category-section,
.book-hover-card,
.modal-panel,
.notes-panel,
.empty-state {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--soft-card-shadow);
}

.library-header {
  margin-bottom: 18px;
  padding: 14px 16px;
}

.library-header.has-settings-open {
  margin-bottom: 300px;
}

.library-header::before,
.chart-card-feature::before {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.header-main {
  gap: 20px;
  min-height: 72px;
}

.title-block {
  min-height: 72px;
}

.eyebrow,
.modal-kicker,
.stats-card-heading span,
.sync-mark,
.search-field span,
.select-field span,
.api-key-field span {
  color: var(--muted);
}

h1,
.stats-hero h2,
.stats-card-heading h2,
.category-heading h2,
.modal-copy h2,
.notes-heading strong,
.book-hover-card strong,
.sync-copy strong,
.share-settings-head strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
}

h1 {
  font-size: 1.42rem;
}

.modal-copy h2 {
  font-weight: 600;
}

.stat-item strong,
.stats-overview-card strong,
.progress-line strong,
.progress-dist-count,
.category-legend-item strong,
.shelf-tag span,
.donut-total {
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.stat-strip {
  border-color: var(--line);
  background: var(--line);
  box-shadow: var(--soft-card-shadow);
}

.stat-item {
  background: var(--surface);
}

.stat-item strong {
  color: var(--ink);
}

.stat-item span,
.modal-author,
.modal-meta,
.progress-line,
.progress-note,
.notes-heading span,
.book-hover-card span,
.category-heading span,
.stats-card-heading p,
.share-note,
.share-status,
.sync-copy,
.filter-summary,
.progress-dist-label span,
.heatmap-row strong,
.heatmap-header span,
.notes-empty,
.notes-loading,
.trace-meta {
  color: var(--muted);
}

.settings-toggle,
.view-tabs,
.search-field,
.select-field,
.api-key-field,
.share-link-row input,
.segment,
.meta-pill,
.notes-tabs,
.trace-card {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
}

.settings-toggle {
  color: var(--ink);
}

.settings-toggle:hover,
.settings-toggle:focus-visible,
.settings-toggle[aria-expanded="true"] {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brass) 42%, var(--line));
  background: #ffffff;
}

.settings-panel {
  top: calc(100% + 12px);
}

.sync-panel {
  gap: 16px;
  padding: 16px;
}

.share-settings {
  gap: 14px;
  padding: 16px;
  border-color: var(--line);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.share-switch {
  color: var(--ink);
  font-weight: 500;
}

.share-switch span {
  border-color: var(--line);
  background: #f4f4f1;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.share-switch span::after {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.share-switch input:checked + span {
  border-color: var(--brass);
  background: var(--brass);
}

.share-switch input:focus-visible + span {
  outline-color: color-mix(in srgb, var(--brass) 36%, transparent);
}

.sync-button,
.export-button,
.notes-load,
.view-tab.is-active,
.segment.is-active {
  border-color: var(--brass);
  color: #ffffff;
  background: var(--brass);
  box-shadow: none;
  font-weight: 500;
}

.sync-button:hover,
.sync-button:focus-visible,
.export-button:hover,
.export-button:focus-visible,
.notes-load:hover,
.notes-load:focus-visible,
.view-tab.is-active:hover,
.segment.is-active:hover {
  background: var(--brass-soft);
  border-color: var(--brass-soft);
}

.ghost-button,
.notes-export,
.view-tab,
.segment,
.search-clear {
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
  font-weight: 500;
}

.ghost-button:hover,
.ghost-button:focus-visible,
.notes-export:hover,
.notes-export:focus-visible,
.view-tab:hover,
.view-tab:focus-visible,
.segment:hover,
.segment:focus-visible,
.search-clear:hover,
.search-clear:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brass) 42%, var(--line));
  background: #fbfbf8;
}

.api-key-form {
  gap: 12px;
}

.api-key-field,
.search-field,
.select-field {
  min-height: 46px;
  padding: 0 15px;
}

.api-key-field input,
.search-field input,
.select-field select,
.share-link-row input {
  color: var(--ink);
}

.api-key-field input::placeholder,
.search-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 68%, white);
}

.view-tabs {
  margin: 0 0 20px;
  padding: 6px;
}

.view-tab {
  min-height: 38px;
  padding: 0 18px;
}

.control-deck {
  gap: 14px;
  margin-bottom: 36px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.filter-row {
  gap: 14px;
}

.segmented-control {
  gap: 10px;
  min-height: 46px;
}

.segment {
  min-height: 38px;
  padding: 0 16px;
  color: var(--muted);
}

.filter-summary {
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--line);
  background: #ffffff;
  font-weight: 500;
}

.shelves {
  gap: 36px;
}

.category-section {
  background: #ffffff;
}

.category-heading {
  min-height: 64px;
  padding: 20px 22px 16px;
  border-bottom-color: var(--line);
  background: #ffffff;
}

.shelf-frame {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 15%, transparent 85%, rgba(92, 52, 27, 0.08)),
    repeating-linear-gradient(90deg, rgba(108, 74, 44, 0.08) 0 14px, rgba(255, 249, 237, 0.72) 14px 31px);
}

.book-title {
  font-family: var(--font-spine);
}

.shelf-frame {
  position: relative;
  padding: 16px 14px 0;
  border-left: 10px solid #76533a;
  border-right: 10px solid #76533a;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(0, 0, 0, 0.055) 100%),
    linear-gradient(90deg, rgba(62, 42, 27, 0.16), transparent 7%, transparent 93%, rgba(62, 42, 27, 0.16)),
    repeating-linear-gradient(90deg, rgba(103, 74, 51, 0.08) 0 14px, rgba(248, 242, 232, 0.72) 14px 31px);
  box-shadow:
    inset 10px 0 18px rgba(0, 0, 0, 0.08),
    inset -10px 0 18px rgba(0, 0, 0, 0.08),
    inset 0 10px 18px rgba(255, 255, 255, 0.16);
}

.shelf-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 58%, rgba(0, 0, 0, 0.055) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.08));
}

.shelf-row,
.shelf-plank {
  position: relative;
  z-index: 1;
}

.shelf-row {
  gap: 2px;
}

.shelf-plank {
  height: 28px;
  margin: 0 -14px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(180deg, #c4a882 0%, #b09070 48%, #87664a 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(1deg, rgba(82, 54, 35, 0.08) 0 1px, transparent 1px 7px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.15),
    inset 0 -7px 10px rgba(54, 34, 21, 0.12);
}

.book-spine {
  border-top-color: rgba(255, 255, 255, 0.24);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    2px 0 4px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    inset 3px 0 5px rgba(255, 255, 255, 0.08),
    inset -4px 0 8px rgba(0, 0, 0, 0.28);
}

.book-spine,
.book-spine.has-cover-fallback {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0.22) 13%, rgba(255, 255, 255, 0.04) 34%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 0, 0, 0.14) calc(100% - 1px)),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 76% 62%, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 18%) var(--spine-band-top) calc(var(--spine-band-top) + 3px), transparent calc(var(--spine-band-top) + 3px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 25%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, normal, normal;
}

.book-spine.has-cover-visual,
.book-spine.is-album.has-cover-visual,
.book-spine.is-collection.has-cover-visual {
  border-top-color: rgba(255, 255, 255, 0.24);
  border-right-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.12);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.24) 11%, rgba(255, 255, 255, 0.05) 33%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 0, 0, 0.14) calc(100% - 1px)),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 76% 62%, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--spine-accent), transparent 78%) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 12%) var(--spine-band-top) calc(var(--spine-band-top) + 2px), transparent calc(var(--spine-band-top) + 2px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 22%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    var(--spine-texture),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-repeat: no-repeat;
  background-size: auto, auto, 6px 6px, 7px 7px, auto, auto, auto, auto, auto, 100% 100%, auto;
  background-position: center;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, normal, soft-light, soft-light, soft-light, multiply, normal;
}

.book-spine:hover,
.book-spine:focus-visible {
  box-shadow:
    8px 12px 22px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    inset 3px 0 5px rgba(255, 255, 255, 0.1),
    inset -4px 0 8px rgba(0, 0, 0, 0.28);
}

.book-hover-card {
  padding: 14px 15px;
  color: var(--ink);
}

.book-hover-progress-track,
.progress-track,
.progress-dist-track {
  background: #eeeeea;
}

.book-hover-progress-fill,
.progress-fill,
.progress-dist-track i,
.progress-dist-row:last-child .progress-dist-track i {
  background: var(--brass);
}

.book-hover-progress span {
  color: var(--ink);
  font-weight: 500;
}

.stats-view {
  gap: 24px;
}

.stats-hero,
.stats-card,
.stats-overview-card {
  background: #ffffff;
}

.stats-hero,
.stats-card {
  padding: 22px;
}

.stats-overview {
  gap: 16px;
}

.stats-overview-card {
  min-height: 126px;
  padding: 20px;
}

.stats-overview-card::before {
  background: var(--brass);
  opacity: 0.7;
}

.stats-overview-card::after {
  border-color: color-mix(in srgb, var(--brass) 35%, transparent);
}

.stats-overview-card.tone-paper,
.stats-overview-card.tone-brass,
.stats-overview-card.tone-teal,
.stats-overview-card.tone-wine,
.stats-overview-card.tone-ink {
  --stat-accent: var(--brass);
  --stat-glow: rgba(184, 146, 106, 0.12);
}

.stats-overview-card strong,
.stats-card-heading h2,
.category-insight strong,
.category-legend-item strong,
.progress-dist-label strong {
  color: var(--ink);
}

.stats-overview-card span,
.stats-overview-card small,
.category-insight span,
.category-insight em,
.progress-dist-label span {
  color: var(--muted);
}

.category-insights {
  gap: 12px;
  margin-bottom: 18px;
}

.category-insight {
  padding: 13px 14px;
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
}

.category-insight em {
  color: var(--brass);
}

.donut-total {
  fill: var(--ink);
}

.donut-label {
  fill: var(--muted);
}

.donut-slice {
  stroke: #ffffff;
}

.category-legend {
  gap: 9px;
}

.category-legend-item {
  min-height: 38px;
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
}

.category-legend-item b {
  background: linear-gradient(90deg, rgba(184, 146, 106, 0.12), transparent);
}

.progress-distribution {
  gap: 13px;
}

.progress-dist-row {
  padding: 11px 12px;
  border-color: var(--line);
  background: #ffffff;
}

.progress-dist-count {
  color: var(--ink);
}

.heatmap-cell {
  min-height: 40px;
  border-color: var(--line);
  color: var(--ink);
  background: #fafaf7;
  box-shadow: none;
}

.heatmap-cell.level-1 {
  background: color-mix(in srgb, var(--brass) 16%, white);
}

.heatmap-cell.level-2 {
  background: color-mix(in srgb, var(--brass) 28%, white);
}

.heatmap-cell.level-3 {
  color: var(--ink);
  background: color-mix(in srgb, var(--brass) 42%, white);
}

.heatmap-cell.level-4 {
  color: #ffffff;
  background: var(--brass);
}

.modal-scrim {
  background: rgba(44, 44, 44, 0.32);
}

.modal-panel {
  gap: 34px;
  padding: 34px;
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), 0 28px 80px rgba(0, 0, 0, 0.12);
}

.modal-close {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: #fafaf7;
}

.cover-stage {
  background: #fafaf7;
  box-shadow: inset 0 0 0 1px var(--line);
}

.cover-stage img,
.cover-placeholder {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.meta-pill {
  color: var(--muted);
}

.notes-panel {
  margin-top: 24px;
  padding: 18px;
}

.notes-tabs {
  border-bottom-color: var(--line);
}

.notes-tabs button {
  color: var(--muted);
  font-weight: 500;
}

.notes-tabs button.is-active {
  color: var(--ink);
  background: transparent;
}

.notes-tabs button.is-active::after {
  background: var(--brass);
}

.trace-card {
  border-top-color: var(--line);
  border-left-color: #d8d8d2;
  background: #ffffff;
}

.trace-card.is-review {
  border-left-color: var(--brass);
}

.trace-card blockquote,
.trace-thought {
  color: var(--ink);
}

.trace-meta span:first-child,
.trace-link,
.weread-link {
  color: var(--brass-soft);
}

.weread-link:hover,
.weread-link:focus-visible {
  color: var(--brass);
}

.empty-state {
  color: var(--muted);
  background: #ffffff;
}

@media (max-width: 980px) {
  .header-main,
  .filter-row-primary,
  .filter-row-secondary {
    grid-template-columns: 1fr;
  }

  .header-tools {
    justify-content: space-between;
  }

  .stat-strip {
    width: 100%;
    min-width: 0;
  }

  .settings-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .library-header.has-settings-open {
    margin-bottom: 10px;
  }

  .control-deck {
    position: static;
  }

  .filter-summary {
    justify-self: start;
  }

  .api-key-form {
    grid-template-columns: minmax(0, 1fr) repeat(3, max-content);
  }

  .stats-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .category-chart-layout {
    grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .settings-panel.is-open,
  .sync-panel {
    grid-template-columns: 1fr;
  }

  .api-key-form {
    grid-template-columns: minmax(0, 1fr) repeat(3, max-content);
    width: 100%;
  }

  .turnstile-row {
    justify-self: stretch;
    width: min(100%, 430px);
  }
}

@media (max-width: 680px) {
  .shelves.is-rendering {
    opacity: 1;
    transform: none;
  }

  .shelves.has-entered .book-spine {
    animation: none;
  }

  .library-shell {
    width: min(100% - 22px, 1500px);
    padding-top: 10px;
  }

  .library-header {
    min-height: 0;
    padding: 10px;
  }

  .title-block {
    min-height: 62px;
    padding-right: 82px;
  }

  h1 {
    font-size: 1.18rem;
  }

  .snoopy-stage {
    position: absolute;
    right: 0;
    top: 50%;
    bottom: auto;
    width: 74px;
    height: 64px;
    overflow: hidden;
    margin: 0;
    transform: translateY(-50%);
    transform-origin: center center;
  }

  .snoopy-stage::before {
    left: 20px;
    right: 6px;
    bottom: 4px;
    height: 7px;
  }

  .snoopy-reader {
    right: 5px;
    top: 50%;
    bottom: auto;
    width: auto;
    max-width: 54px;
    max-height: 58px;
    transform: translateY(-50%);
  }

  .header-tools {
    gap: 6px;
  }

  .stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: 38px;
  }

  .stat-item {
    min-height: 36px;
    gap: 3px;
    padding: 0 5px;
  }

  .stat-item strong {
    font-size: 0.9rem;
  }

  .stat-item span {
    font-size: 0.62rem;
  }

  .settings-toggle {
    width: 38px;
    height: 38px;
  }

  .sync-copy {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .api-key-form {
    grid-template-columns: 1fr;
  }

  .turnstile-row {
    justify-self: stretch;
    grid-template-columns: 1fr;
    width: 100%;
    justify-items: center;
    padding: 10px;
  }

  .turnstile-mount {
    justify-content: center;
    width: min(150px, 100%);
  }

  .view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-tab {
    padding: 0 10px;
  }

  .stats-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .stats-hero h2 {
    font-size: 1.32rem;
  }

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

  .stats-overview-card {
    min-height: 96px;
    padding: 13px;
  }

  .stats-card {
    padding: 14px;
  }

  .stats-card-heading {
    display: grid;
  }

  .stats-card-heading p {
    text-align: left;
  }

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

  .category-donut {
    justify-self: center;
    max-width: 230px;
  }

  .category-legend {
    grid-template-columns: 1fr;
    max-height: 220px;
  }

  .progress-dist-row {
    grid-template-columns: 86px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .segmented-control {
    gap: 6px;
  }

  .segment {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .search-field,
  .select-field {
    min-height: 40px;
  }

  .filter-summary {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .shelf-frame {
    border-left-width: 8px;
    border-right-width: 8px;
    padding-inline: 8px;
  }

  .modal-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 48px);
    overflow: auto;
  }

  .cover-stage {
    width: 100%;
    min-height: 240px;
  }
}

/* Restrained UI polish */
.sync-button,
.export-button,
.ghost-button,
.notes-load,
.view-tab,
.search-clear {
  min-height: 38px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.sync-button,
.export-button.stats-save,
.notes-load[data-notes-action="load"] {
  border: 0;
  color: #ffffff;
  background: #5b8a7a;
  filter: none;
  transform: none;
}

.sync-button:hover,
.sync-button:focus-visible,
.export-button.stats-save:hover,
.export-button.stats-save:focus-visible,
.notes-load[data-notes-action="load"]:hover,
.notes-load[data-notes-action="load"]:focus-visible {
  outline: none;
  border: 0;
  color: #ffffff;
  background: #4d7a6a;
  filter: none;
  transform: none;
}

.ghost-button,
.notes-export,
.notes-load[data-notes-action="reload"],
.view-tab,
.search-clear {
  border: 1px solid #d4d4d0;
  color: #2c2c2c;
  background: transparent;
  filter: none;
  transform: none;
}

.ghost-button:hover,
.ghost-button:focus-visible,
.notes-export:hover,
.notes-export:focus-visible,
.notes-load[data-notes-action="reload"]:hover,
.notes-load[data-notes-action="reload"]:focus-visible,
.view-tab:hover,
.view-tab:focus-visible,
.search-clear:hover,
.search-clear:focus-visible {
  outline: none;
  border-color: #5b8a7a;
  color: #5b8a7a;
  background: transparent;
  filter: none;
  transform: none;
}

.view-tab.is-active {
  border-color: #5b8a7a;
  color: #ffffff;
  background: #5b8a7a;
}

.view-tab.is-active:hover,
.view-tab.is-active:focus-visible {
  border-color: #4d7a6a;
  color: #ffffff;
  background: #4d7a6a;
}

.sync-button:disabled,
.export-button:disabled,
.ghost-button:disabled,
.notes-load:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.settings-toggle,
.modal-close,
.share-switch span,
.share-switch span::after {
  transition: all 0.2s ease;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 20px;
  color: #8a8a86;
  background: #f5f5f2;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: background 0.2s ease, color 0.2s ease;
}

.segment:hover,
.segment:focus-visible {
  outline: none;
  color: #2c2c2c;
  background: #eeeeea;
}

.segment.is-active,
.segment.is-active:hover,
.segment.is-active:focus-visible {
  border: 0;
  color: #ffffff;
  background: #5b8a7a;
  box-shadow: none;
}

.book-modal.is-open {
  display: flex;
}

.modal-scrim {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

.book-modal.is-open .modal-scrim {
  animation: modalScrimIn 0.2s ease-out both;
}

.book-modal.is-closing .modal-scrim {
  animation: modalScrimOut 0.18s ease both;
}

.book-modal.is-open .modal-panel {
  animation: modalPanelIn 0.2s ease-out both;
}

.book-modal.is-closing .modal-panel {
  animation: modalPanelOut 0.18s ease both;
}

.modal-panel {
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), 0 28px 80px rgba(0, 0, 0, 0.1);
}

.cover-stage img {
  box-shadow:
    0 2px 20px rgba(0, 0, 0, 0.06),
    0 13px 12px -13px rgba(0, 0, 0, 0.36);
}

.progress-track {
  height: 6px;
  border: 0;
  border-radius: 100px;
  background: #eeeee8;
}

.progress-fill {
  border-radius: 100px;
  background: #5b8a7a;
}

.shelves {
  transition: opacity 0.18s ease, transform 0.2s ease-out;
}

.shelves.is-rendering {
  opacity: 0;
  transform: translateY(6px);
}

.shelves.has-entered {
  animation: shelvesEnter 0.22s ease-out both;
}

.shelves.has-entered .book-spine {
  animation: spineFade 0.18s ease-out both;
}

.shelves.is-loading {
  opacity: 1;
  transform: none;
}

.shelf-skeleton .category-heading h2,
.shelf-skeleton .category-heading span {
  width: 108px;
  height: 14px;
  overflow: hidden;
  border-radius: 100px;
  color: transparent;
  background: linear-gradient(90deg, #eeeeea 0%, #e4e4de 48%, #eeeeea 100%);
  background-size: 220% 100%;
  animation: skeletonPulse 1.1s ease-in-out infinite;
}

.shelf-skeleton .category-heading span {
  width: 70px;
  height: 11px;
}

.skeleton-book {
  display: block;
  flex: 0 0 auto;
  width: var(--skeleton-width, 24px);
  height: var(--skeleton-height, 148px);
  align-self: flex-end;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, #eeeeea 0%, #e4e4de 50%, #eeeeea 100%);
  background-size: 220% 100%;
  animation: skeletonPulse 1.1s ease-in-out infinite;
}

@keyframes modalScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScrimOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

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

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

@keyframes skeletonPulse {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

/* Paper surface and refined analytics */
html {
  background: #fafaf7;
}

body {
  background:
    radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, 0.94) 0%, rgba(250, 250, 247, 0.78) 48%, rgba(242, 239, 232, 0.86) 100%),
    #fafaf7;
}

body::before {
  display: block;
  opacity: 0.055;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.045)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
  mix-blend-mode: multiply;
  filter: contrast(1.04);
}

body::after {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: multiply;
}

.stats-view {
  gap: 40px;
}

.stats-hero {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.stats-hero h2 {
  font-size: 1.72rem;
}

.stats-overview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 8px 0 2px;
}

.stats-overview-card {
  min-height: 116px;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 6px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.stats-overview-card + .stats-overview-card {
  border-left: 1px solid #e8e8e4;
}

.stats-overview-card::before,
.stats-overview-card::after {
  display: none;
}

.stats-overview-card strong {
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: clamp(48px, 5vw, 56px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.stats-overview-card.tone-brass strong,
.stats-overview-card.tone-wine strong {
  color: #5b8a7a;
}

.stats-overview-card.tone-muted strong {
  color: #c8c4bc;
  font-size: clamp(28px, 3vw, 34px);
}

.stats-overview-card span {
  color: #8a8a86;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
}

.stats-overview-card small {
  margin-top: -4px;
  color: #8a8a86;
  font-size: 12px;
  font-weight: 400;
}

.stats-overview-card.tone-muted small {
  font-size: 10px;
}

.stats-grid {
  grid-template-columns: 1fr;
  gap: 40px;
}

.stats-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.stats-card + .stats-card {
  padding-top: 40px;
  border-top: 1px solid #eeeee8;
}

.chart-card-feature::before {
  display: none;
}

.stats-card-heading {
  margin-bottom: 22px;
}

.stats-card-heading span {
  color: #8a8a86;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.stats-card-heading h2 {
  color: #2c2c2c;
  font-size: 1.32rem;
}

.stats-card-heading p {
  color: #8a8a86;
  font-size: 13px;
}

.category-chart-layout {
  grid-template-columns: minmax(220px, 300px) minmax(240px, 1fr);
  gap: 30px;
  align-items: center;
}

.category-donut {
  max-width: 300px;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.06));
}

.donut-slice {
  stroke: #ffffff;
  stroke-width: 3;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.donut-center {
  filter: none;
}

.donut-icon {
  fill: #5b8a7a;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
}

.donut-total,
.donut-label {
  display: none;
}

.category-legend {
  grid-template-columns: 1fr;
  gap: 11px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.category-legend-item {
  min-height: 30px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #2c2c2c;
  background: transparent;
  font-size: 14px;
  text-align: left;
}

.category-legend-item:disabled {
  cursor: var(--cursor-rest);
}

.category-legend-item b {
  display: none;
}

.category-legend-item i {
  width: 9px;
  height: 9px;
  box-shadow: none;
}

.category-legend-item span {
  color: #2c2c2c;
}

.category-legend-item strong {
  color: #8a8a86;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
}

.category-legend-item:not(:disabled):hover,
.category-legend-item:not(:disabled):focus-visible {
  color: #5b8a7a;
  border-color: transparent;
  background: transparent;
  transform: none;
}

.progress-distribution {
  gap: 16px;
}

.progress-dist-row {
  grid-template-columns: 112px minmax(0, 1fr) 62px;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.progress-dist-track {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6f6f2, #ecece6);
  box-shadow: none;
}

.progress-dist-track i {
  border-radius: 999px;
  background: var(--bar-color, #5b8a7a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 3px 10px color-mix(in srgb, var(--bar-color, #5b8a7a), transparent 74%);
}

.progress-dist-row {
  --bar-color: #5b8a7a;
}

.progress-dist-label strong {
  color: #2c2c2c;
}

.progress-dist-label span,
.progress-dist-count {
  color: #8a8a86;
}

.progress-dist-count {
  font-weight: 500;
}

.progress-dist-label strong {
  color: #2c2c2c;
  font-size: 14px;
}

.progress-dist-label span,
.progress-dist-count {
  color: #8a8a86;
  font-size: 13px;
  font-weight: 400;
}

.reading-heatmap {
  gap: 8px;
  padding-bottom: 0;
}

.heatmap-row {
  grid-template-columns: 58px repeat(12, minmax(34px, 1fr));
  gap: 1px;
  min-width: 640px;
}

.heatmap-row strong {
  justify-self: start;
  color: #8a8a86;
  font-size: 12px;
  font-weight: 500;
}

.heatmap-header span {
  justify-self: center;
  color: #8a8a86;
  font-size: 12px;
  font-weight: 400;
}

.heatmap-cell {
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  color: transparent;
  background: #f0f0ec;
  box-shadow: none;
}

.heatmap-cell.level-0 {
  background: #f0f0ec;
}

.heatmap-cell.level-1,
.heatmap-legend .level-1 {
  background: #dbe8e2;
}

.heatmap-cell.level-2,
.heatmap-legend .level-2 {
  background: #a8cbbc;
}

.heatmap-cell.level-3,
.heatmap-legend .level-3 {
  background: #5b8a7a;
}

.heatmap-cell.level-4,
.heatmap-legend .level-4 {
  background: #3d6b5e;
}

.heatmap-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: #8a8a86;
  font-size: 12px;
}

.heatmap-legend i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #f0f0ec;
}

.heatmap-legend .level-0 {
  background: #f0f0ec;
}

.stats-actions {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.stats-actions .stats-save {
  min-width: 132px;
}

@media (max-width: 980px) {
  .stats-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 26px;
  }

  .stats-overview-card:nth-child(4) {
    border-left: 0;
  }

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

@media (max-width: 680px) {
  .stats-overview {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stats-overview-card,
  .stats-overview-card + .stats-overview-card,
  .stats-overview-card:nth-child(4) {
    border-left: 0;
  }

  .stats-overview-card strong {
    font-size: 44px;
  }

  .progress-dist-row {
    grid-template-columns: 86px minmax(0, 1fr) 48px;
  }
}

/* Final visual nips */
.view-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.view-bar .view-tabs {
  margin: 0;
}

.shelf-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 18px;
}

.shelf-share-button.is-generating {
  opacity: 0.88;
}

.shelf-share-button.is-generating::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(21, 60, 57, 0.18);
  border-top-color: #5b8a7a;
  border-radius: 50%;
  animation: shelfShareSpin 0.75s linear infinite;
}

@keyframes shelfShareSpin {
  to {
    transform: rotate(360deg);
  }
}

.view-tabs {
  display: inline-flex;
  gap: 26px;
  align-items: flex-end;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.view-tab {
  position: relative;
  min-height: 34px;
  padding: 0 0 8px;
  border: 0;
  border-radius: 0;
  color: #8a8a86;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.view-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 100px;
  background: #5b8a7a;
  opacity: 0;
  transform: scaleX(0.72);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.view-tab.is-active,
.view-tab.is-active:hover,
.view-tab.is-active:focus-visible {
  border: 0;
  color: #2c2c2c;
  background: transparent;
  box-shadow: none;
}

.view-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.view-tab:hover,
.view-tab:focus-visible {
  color: #2c2c2c;
  border: 0;
  background: transparent;
  transform: none;
}

.filter-summary {
  display: none;
}

.category-heading {
  align-items: baseline;
}

.category-heading h2 {
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.category-heading span {
  color: #8a8a86;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
}

.wall-heading span {
  max-width: min(56vw, 760px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track,
.progress-fill {
  border-radius: 100px;
}

.progress-track {
  overflow: hidden;
}

.progress-fill {
  min-width: 0;
}

.category-chart-layout {
  grid-template-columns: minmax(210px, 260px) minmax(210px, 340px);
  gap: 18px;
  justify-content: start;
}

.category-donut {
  max-width: 260px;
}

.donut-icon {
  fill: #2c2c2c;
  font-size: 21px;
}

.donut-mini-label {
  fill: #8a8a86;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
}

.category-legend {
  gap: 9px;
  align-content: center;
}

.category-legend-item {
  min-height: 28px;
}

@media (max-width: 680px) {
  .view-bar {
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 18px;
  }

  .shelf-share-button {
    width: 100%;
  }

  .view-tabs {
    width: auto;
    display: inline-flex;
    gap: 22px;
  }

  .category-heading {
    align-items: flex-start;
  }

  .wall-heading span {
    max-width: 100%;
    white-space: normal;
  }
}

/* Category treemap */
.category-treemap-wrap {
  display: grid;
  gap: 16px;
}

.category-treemap {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: visible;
  border-radius: 8px;
}

.treemap-tile {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 10px;
  border: 3px solid #ffffff;
  border-radius: 8px;
  color: #ffffff;
  background: var(--tile-color);
  box-shadow: none;
  text-align: center;
  transform-origin: center;
  transition: all 0.2s ease;
}

button.treemap-tile {
  cursor: var(--cursor-active);
}

div.treemap-tile {
  cursor: var(--cursor-rest);
}

.treemap-tile strong,
.treemap-tile span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treemap-tile strong {
  font-size: 14px;
  font-weight: 500;
}

.treemap-tile span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 400;
}

.treemap-tile.is-light {
  color: #4a4a48;
}

.treemap-tile.is-light span {
  color: rgba(74, 74, 72, 0.72);
}

.treemap-tile.is-compact strong,
.treemap-tile.is-compact span {
  display: none;
}

.treemap-tile:not(.is-compact):not(.is-narrow) strong {
  font-size: clamp(11px, 1.2vw, 14px);
}

.treemap-tile.is-narrow {
  padding: 8px 4px;
}

.treemap-tile.is-narrow strong {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 2px;
  white-space: normal;
}

.treemap-tile.is-narrow span {
  display: none;
}

.category-treemap-wrap[data-active-category] .treemap-tile:not(.is-active) {
  opacity: 0.5;
}

.treemap-tile.is-active,
.treemap-tile:hover,
.treemap-tile:focus-visible {
  z-index: 2;
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

.treemap-tooltip {
  position: absolute;
  z-index: 4;
  min-width: max-content;
  padding: 7px 10px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(44, 44, 44, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.treemap-tooltip[aria-hidden="false"] {
  opacity: 1;
}

.treemap-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
}

.treemap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: #8a8a86;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.treemap-legend-item[aria-disabled="true"] {
  cursor: var(--cursor-rest);
}

.treemap-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tile-color);
}

.treemap-legend-item.is-active,
.treemap-legend-item:hover,
.treemap-legend-item:focus-visible {
  outline: none;
  color: #2c2c2c;
}

.treemap-legend-item.is-active i,
.treemap-legend-item:hover i,
.treemap-legend-item:focus-visible i {
  transform: scale(1.15);
}

@media (max-width: 680px) {
  .category-treemap {
    height: 360px;
  }
}

/* Stronger view switcher and mobile reliability */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.view-tabs {
  gap: 34px;
  margin: 0 0 22px;
  padding: 0 0 2px;
}

.view-tab {
  min-height: 42px;
  padding: 0 2px 10px;
  color: #777772;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.view-tab::after {
  height: 3px;
}

.view-tab.is-active,
.view-tab.is-active:hover,
.view-tab.is-active:focus-visible {
  color: #1f2623;
}

.view-tab:hover,
.view-tab:focus-visible {
  color: #4d7a6a;
}

.paste-api-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  body::before,
  body::after {
    display: none;
  }

  .library-shell {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: 48px;
  }

  .library-header,
  .control-deck,
  .category-section,
  .stats-view,
  .stats-card,
  .modal-panel {
    max-width: 100%;
  }

  .library-header {
    padding: 12px;
    overflow: visible;
  }

  .header-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .title-block {
    min-width: 0;
    padding-right: 96px;
  }

  h1 {
    overflow-wrap: anywhere;
    font-size: clamp(1.08rem, 6vw, 1.42rem);
    line-height: 1.18;
  }

  .header-tools {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .stat-strip {
    width: 100%;
    min-width: 0;
    height: 44px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-item {
    min-width: 0;
    padding: 0 4px;
  }

  .stat-item strong {
    font-size: clamp(0.86rem, 4.1vw, 1.06rem);
  }

  .stat-item span {
    font-size: clamp(0.58rem, 2.8vw, 0.68rem);
  }

  .settings-toggle {
    width: 44px;
    height: 44px;
    align-self: stretch;
  }

  .settings-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding: 12px;
  }

  .settings-panel.is-open,
  .sync-panel {
    grid-template-columns: 1fr;
  }

  .sync-copy {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
  }

  .sync-copy > span:last-child {
    grid-column: 1 / -1;
  }

  .api-key-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .api-key-field {
    min-height: 48px;
  }

  .api-key-field input {
    min-height: 36px;
    font-size: 16px;
    -webkit-user-select: text;
    user-select: text;
  }

  .sync-button,
  .ghost-button,
  .paste-api-key {
    width: 100%;
    min-height: 44px;
  }

  .turnstile-row {
    justify-self: stretch;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    padding: 10px;
  }

  .turnstile-copy {
    width: 100%;
  }

  .turnstile-mount {
    width: min(150px, 100%);
    justify-content: center;
  }

  .share-settings {
    padding: 12px;
  }

  .share-settings-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .share-owner-row,
  .share-link-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .share-link-row input {
    width: 100%;
    min-width: 0;
  }

  .view-tabs {
    width: 100%;
    display: flex;
    gap: 28px;
    margin: 18px 0 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-tab {
    flex: 0 0 auto;
    min-height: 44px;
    font-size: 17px;
  }

  .control-deck {
    width: 100%;
    margin-bottom: 28px;
    padding: 14px;
    overflow: hidden;
  }

  .filter-row,
  .filter-row-primary,
  .filter-row-secondary {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .search-field,
  .select-field {
    width: 100%;
    min-width: 0;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .segmented-control::-webkit-scrollbar {
    display: none;
  }

  .segment {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .shelves,
  .category-section,
  .shelf-row,
  .shelf-wall {
    max-width: 100%;
  }

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

  .stats-view {
    width: 100%;
    overflow-x: hidden;
  }

  .stats-hero {
    margin-bottom: 4px;
  }

  .stats-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 0;
    width: 100%;
    padding: 6px 0 10px;
  }

  .stats-overview-card {
    min-width: 0;
    min-height: 106px;
    padding: 8px 10px;
  }

  .stats-overview-card + .stats-overview-card,
  .stats-overview-card:nth-child(4) {
    border-left: 1px solid #e8e8e4;
  }

  .stats-overview-card:nth-child(odd) {
    border-left: 0;
  }

  .stats-overview-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .stats-overview-card strong {
    font-size: clamp(34px, 12vw, 44px);
  }

  .stats-overview-card.tone-muted strong {
    font-size: clamp(24px, 8vw, 30px);
  }

  .stats-card + .stats-card {
    padding-top: 32px;
  }

  .category-treemap {
    height: 300px;
  }

  .progress-dist-row {
    grid-template-columns: 74px minmax(0, 1fr) 42px;
    gap: 10px;
  }

  .reading-heatmap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .heatmap-row {
    grid-template-columns: 44px repeat(12, 28px);
    min-width: 392px;
    gap: 3px;
  }

  .heatmap-cell {
    min-width: 24px;
    height: 24px;
  }

  .book-modal {
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 18px;
    grid-template-columns: 1fr;
    gap: 18px;
    overflow-x: hidden;
  }

  .cover-stage {
    min-height: 190px;
  }

  .modal-copy h2 {
    font-size: 1.28rem;
  }

  .notes-heading {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .notes-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .notes-tabs {
    overflow-x: auto;
  }
}

/* Shelf wall category rows and visible horizontal scrolling */
.shelf-row {
  scrollbar-color: rgba(91, 138, 122, 0.78) rgba(238, 238, 232, 0.72);
  scrollbar-width: auto;
}

.shelf-row::-webkit-scrollbar {
  height: 14px;
}

.shelf-row::-webkit-scrollbar-track {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 238, 232, 0.9));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.shelf-row::-webkit-scrollbar-thumb {
  min-width: 72px;
  border: 3px solid rgba(238, 238, 232, 0.92);
  border-radius: 999px;
  background: #5b8a7a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.shelf-row::after {
  content: none;
  position: sticky;
  right: 10px;
  bottom: 12px;
  z-index: 8;
  align-self: flex-end;
  margin-left: auto;
  margin-bottom: 14px;
  padding: 5px 9px;
  border: 1px solid rgba(91, 138, 122, 0.22);
  border-radius: 999px;
  color: #4d7a6a;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
}

.wall-row {
  gap: 4px;
  padding-top: 20px;
}

.wall-row.is-category-row {
  min-height: 236px;
}

.shelf-tag {
  flex: 0 0 108px;
  width: 108px;
  height: 64px;
  align-self: flex-start;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  align-items: center;
  gap: 6px;
  margin: 6px 14px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(82, 53, 25, 0.2);
  border-radius: 6px;
  color: #2c2c2c;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(237, 243, 240, 0.82)),
    linear-gradient(90deg, hsl(var(--tag-hue) 30% 82%), rgba(255, 255, 255, 0.58));
  box-shadow:
    0 10px 20px rgba(61, 41, 24, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(77, 52, 30, 0.08);
}

.shelf-tag::before {
  top: 8px;
  left: 8px;
  width: 5px;
  height: 5px;
  transform: none;
}

.shelf-tag::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(91, 138, 122, 0.34);
}

.shelf-tag strong {
  max-width: 100%;
  max-height: none;
  overflow: hidden;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-tag span {
  min-width: 26px;
  height: 26px;
  color: #ffffff;
  background: #5b8a7a;
  font-size: 12px;
}

@media (max-width: 680px) {
  .shelf-row::-webkit-scrollbar {
    height: 12px;
  }

  .shelf-row::after {
    right: 8px;
    bottom: 10px;
    margin-bottom: 12px;
    font-size: 11px;
  }

  .shelf-tag {
    flex-basis: 96px;
    width: 96px;
    height: 58px;
    margin-right: 10px;
    padding: 9px 10px;
  }

  .shelf-tag strong {
    font-size: 14px;
  }
}

/* More realistic book spines */
.book-spine,
.book-spine.has-cover-fallback {
  border-top-color: rgba(255, 255, 255, 0.32);
  border-left-color: rgba(255, 255, 255, 0.1);
  border-right-color: rgba(0, 0, 0, 0.16);
  border-bottom-color: rgba(0, 0, 0, 0.22);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.34) 0%, rgba(255, 255, 255, 0.18) 10%, rgba(255, 255, 255, 0.03) 36%, rgba(0, 0, 0, 0.24) 72%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px calc(100% - 2px), rgba(0, 0, 0, 0.2) calc(100% - 2px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 70% 62%, rgba(0, 0, 0, 0.055) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 20%) var(--spine-band-top) calc(var(--spine-band-top) + 2px), transparent calc(var(--spine-band-top) + 2px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 32%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-size: auto, auto, auto, auto, 7px 7px, 9px 9px, auto, auto;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, soft-light, normal;
  box-shadow:
    2px 0 3px rgba(0, 0, 0, 0.2),
    -1px 0 1px rgba(255, 255, 255, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.18),
    inset 4px 0 8px rgba(255, 255, 255, 0.06),
    inset -5px 0 10px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

.book-spine.has-cover-visual,
.book-spine.is-album.has-cover-visual,
.book-spine.is-collection.has-cover-visual {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0%, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0.04) 34%, rgba(0, 0, 0, 0.24) 72%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px calc(100% - 2px), rgba(0, 0, 0, 0.2) calc(100% - 2px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.034) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 70% 62%, rgba(0, 0, 0, 0.055) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.16)),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--spine-accent), transparent 82%) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, transparent 0 var(--spine-band-top), color-mix(in srgb, var(--spine-accent), transparent 16%) var(--spine-band-top) calc(var(--spine-band-top) + 2px), transparent calc(var(--spine-band-top) + 2px) var(--spine-band-bottom), color-mix(in srgb, var(--spine-accent), transparent 32%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px), transparent calc(var(--spine-band-bottom) + 2px)),
    var(--spine-texture),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-size: auto, auto, auto, auto, 7px 7px, 9px 9px, auto, auto, auto, 100% 100%, auto;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, normal, soft-light, soft-light, multiply, normal;
}

.book-spine::before {
  inset: 10px 6px auto;
  height: 1px;
  opacity: 0.14;
  box-shadow:
    0 12px 0 color-mix(in srgb, var(--spine-accent), transparent 38%),
    0 22px 0 color-mix(in srgb, var(--spine-accent), transparent 62%);
}

.book-spine::after {
  height: min(var(--book-progress), 7px);
  opacity: 0.82;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(91, 138, 122, 0.7), rgba(0, 0, 0, 0.12));
  border-top-color: rgba(255, 255, 255, 0.18);
}

.book-spine.is-done::after {
  height: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(212, 165, 116, 0.82), rgba(0, 0, 0, 0.12));
}

.book-spine.has-cover-visual .book-title {
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--spine-title-backdrop), transparent 18%) 20%, color-mix(in srgb, var(--spine-title-backdrop), transparent 18%) 80%, transparent);
}

/* Bookshelf and analytics refinements */
.wall-row {
  gap: 3px;
  padding-top: 18px;
}

.wall-row.is-category-row {
  min-height: 226px;
}

.shelf-tag {
  flex: 0 0 34px;
  width: 34px;
  height: 172px;
  align-self: flex-end;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  justify-items: center;
  gap: 8px;
  margin: 0 9px 0 4px;
  padding: 13px 4px 9px;
  border: 1px solid rgba(55, 38, 24, 0.22);
  border-bottom: 0;
  border-radius: 18px 18px 2px 2px;
  color: #27302c;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.55), transparent 42%, rgba(0,0,0,0.08)),
    linear-gradient(180deg, #f8f5ed, #e8ded0 58%, #d7c6ad);
  box-shadow:
    4px 7px 14px rgba(61, 41, 24, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset -2px 0 4px rgba(85, 57, 33, 0.12),
    inset 2px 0 3px rgba(255, 255, 255, 0.4);
}

.shelf-tag::before {
  top: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
  background: rgba(91, 138, 122, 0.42);
}

.shelf-tag::after {
  display: none;
}

.shelf-tag strong {
  max-width: 1.2em;
  max-height: 112px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: #27302c;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: normal;
}

.shelf-tag span {
  min-width: 22px;
  height: 22px;
  color: #ffffff;
  background: #5b8a7a;
  font-size: 11px;
}

.book-spine,
.book-spine.has-cover-fallback {
  border-radius: 1px 4px 0 0;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, overlay, soft-light, normal;
  box-shadow:
    1px 0 0 rgba(0, 0, 0, 0.16),
    -1px 0 0 rgba(255, 255, 255, 0.16),
    3px 0 6px rgba(39, 26, 15, 0.22),
    inset 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 4px 0 7px rgba(255, 255, 255, 0.07),
    inset -5px 0 11px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
}

.book-spine.has-cover-visual,
.book-spine.is-album.has-cover-visual,
.book-spine.is-collection.has-cover-visual {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(255,255,255,0.22) 9%, rgba(255,255,255,0.035) 34%, rgba(0,0,0,0.2) 69%, rgba(0,0,0,0.45) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.28) 0 1px, transparent 1px calc(100% - 2px), rgba(0,0,0,0.22) calc(100% - 2px)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.06) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 74% 64%, rgba(0,0,0,0.06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.18)),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--spine-accent), transparent 84%) 0 2px, transparent 2px 16px),
    var(--spine-texture),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-size: auto, auto, auto, auto, 7px 7px, 9px 9px, auto, auto, 100% 100%, auto;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, normal, soft-light, multiply, normal;
}

.stats-overview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
}

.stats-overview-card,
.stats-overview-card + .stats-overview-card {
  min-height: 118px;
  align-content: center;
  justify-items: start;
  padding: 18px 20px;
  border: 1px solid #eeeee8;
  border-left: 1px solid #eeeee8;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,247,0.72));
  box-shadow: 0 2px 20px rgba(0,0,0,0.045);
}

.stats-overview-card.is-priority {
  grid-column: span 2;
  min-height: 150px;
  background:
    radial-gradient(circle at 86% 14%, rgba(91, 138, 122, 0.13), transparent 34%),
    #ffffff;
}

.stats-overview-card.group-time {
  background:
    radial-gradient(circle at 90% 16%, rgba(94, 140, 174, 0.10), transparent 36%),
    #ffffff;
}

.stats-overview-card.group-notes {
  background:
    radial-gradient(circle at 90% 16%, rgba(139, 126, 184, 0.10), transparent 36%),
    #ffffff;
}

.stats-overview-card strong {
  font-size: clamp(34px, 4vw, 48px);
}

.stats-overview-card.is-priority strong {
  color: #5b8a7a;
  font-size: clamp(52px, 6vw, 68px);
}

.stats-overview-card.tone-wine strong {
  color: #c4785c;
}

.stats-overview-card.tone-teal strong,
.stats-overview-card.tone-ink strong {
  color: #5e8cae;
}

.monthly-heading {
  align-items: center;
}

.monthly-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.monthly-tools select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d4d4d0;
  border-radius: 6px;
  color: #2c2c2c;
  background: #ffffff;
  font: 500 14px var(--font-sans);
}

.stats-share-button,
.stats-actions .stats-save {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: #5b8a7a;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(91, 138, 122, 0.22);
}

.stats-share-button:hover,
.stats-share-button:focus-visible,
.stats-actions .stats-save:hover,
.stats-actions .stats-save:focus-visible {
  background: #4d7a6a;
  transform: translateY(-1px);
}

.monthly-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr);
  gap: 24px;
}

.monthly-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.monthly-metrics article {
  padding: 16px;
  border: 1px solid #eeeee8;
  border-radius: 10px;
  background: #ffffff;
}

.monthly-metrics strong {
  display: block;
  color: #5b8a7a;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.monthly-metrics span {
  display: block;
  margin-top: 8px;
  color: #8a8a86;
  font-size: 13px;
}

.monthly-finished,
.monthly-wordcloud,
.content-map {
  min-height: 250px;
  padding: 20px;
  border: 1px solid #eeeee8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.monthly-finished h3,
.monthly-wordcloud h3 {
  margin: 0 0 14px;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 18px;
}

.monthly-book-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.monthly-book-list span {
  padding: 8px 10px;
  border-radius: 999px;
  color: #2c2c2c;
  background: #edf3f0;
  font-size: 13px;
}

.monthly-wordcloud {
  display: flex;
  align-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.monthly-wordcloud h3,
.monthly-wordcloud .stats-empty {
  width: 100%;
}

.monthly-wordcloud span {
  color: color-mix(in srgb, #5b8a7a 72%, #8a8a86);
  font-family: var(--font-serif);
  font-size: var(--cloud-size);
  font-weight: 700;
  opacity: var(--cloud-opacity);
}

.content-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 16px;
}

.content-crumbs button,
.content-crumbs span {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #d4d4d0;
  border-radius: 999px;
  color: #2c2c2c;
  background: #ffffff;
  font-size: 13px;
}

.content-map {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(91, 138, 122, 0.08), transparent 36%),
    #ffffff;
}

.content-bubble {
  width: var(--bubble-size);
  height: var(--bubble-size);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(91, 138, 122, 0.2);
  border-radius: 50%;
  color: #2c2c2c;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.95), rgba(237,243,240,0.8) 48%, rgba(91,138,122,0.18));
  box-shadow: inset -8px -10px 22px rgba(91, 138, 122, 0.12), 0 12px 28px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-bubble:hover,
.content-bubble:focus-visible {
  outline: none;
  transform: translateY(-3px) scale(1.03);
  box-shadow: inset -8px -10px 22px rgba(91, 138, 122, 0.16), 0 18px 36px rgba(0,0,0,0.1);
}

.content-bubble strong {
  white-space: pre-line;
  font-family: var(--font-serif);
  font-size: 15px;
}

.content-bubble span,
.era-links,
.content-book-list span {
  color: #8a8a86;
  font-size: 12px;
}

.era-links {
  width: 100%;
  padding-top: 8px;
  text-align: center;
}

.era-links strong {
  display: block;
  margin-bottom: 6px;
  color: #5b8a7a;
}

.era-links p {
  margin: 4px 0;
}

.content-book-list {
  width: min(820px, 100%);
  display: grid;
  gap: 10px;
}

.content-book-list button {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid #eeeee8;
  border-radius: 8px;
  color: #2c2c2c;
  background: #fafaf7;
}

@media (max-width: 980px) {
  .stats-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-overview-card.is-priority {
    grid-column: span 1;
  }

  .monthly-body,
  .monthly-metrics {
    grid-template-columns: 1fr;
  }
}

/* Final responsive shelf and analytics polish */
.shelf-row {
  overflow-x: hidden;
  scrollbar-width: none;
}

.shelf-row::-webkit-scrollbar {
  display: none;
}

.shelf-row::after,
.wall-row.is-category-row::after {
  content: none;
}

.wall-row {
  min-height: 218px;
  padding: 18px 10px 0;
}

.wall-row.is-category-row {
  min-height: 222px;
}

.shelf-tag {
  flex: 0 0 38px;
  width: 38px;
  height: 176px;
  gap: 7px;
  margin: 0 10px 0 5px;
  padding: 30px 5px 10px;
  border-radius: 20px 20px 2px 2px;
  background:
    radial-gradient(circle at 50% 12px, rgba(91, 138, 122, 0.26) 0 5px, transparent 6px),
    linear-gradient(90deg, rgba(255,255,255,0.6), transparent 42%, rgba(0,0,0,0.075)),
    linear-gradient(180deg, #fbf8ef, #eadfce 58%, #d8c5aa);
}

.shelf-tag::before {
  top: 13px;
  width: 8px;
  height: 8px;
  background: rgba(91, 138, 122, 0.38);
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.5),
    inset 0 1px 1px rgba(255,255,255,0.6);
}

.shelf-tag strong {
  max-height: 96px;
  color: #22312b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.04;
}

.shelf-tag span {
  margin-top: auto;
  min-width: 24px;
  height: 24px;
  background: #5b8a7a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
}

.stats-overview {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.stats-overview-card,
.stats-overview-card + .stats-overview-card {
  grid-column: span 2;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(238, 238, 232, 0.95);
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 18%, rgba(91, 138, 122, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,250,247,0.76));
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.stats-overview-card.is-priority {
  grid-column: span 3;
  min-height: 150px;
  padding: 24px;
  box-shadow: 0 16px 42px rgba(91, 138, 122, 0.12);
}

.stats-overview-card strong {
  font-size: clamp(30px, 3.2vw, 44px);
}

.stats-overview-card.is-priority strong {
  font-size: clamp(58px, 6vw, 76px);
}

.monthly-wordcloud {
  align-content: flex-start;
  align-items: flex-start;
  gap: 12px;
}

.monthly-wordcloud span {
  display: inline-block;
  max-width: min(100%, 360px);
  padding: 10px 12px;
  border: 1px solid rgba(91, 138, 122, 0.12);
  border-radius: 12px;
  color: #355e52;
  background: #edf3f0;
  font-family: var(--font-serif);
  font-size: clamp(14px, var(--cloud-size), 20px);
  line-height: 1.55;
  opacity: var(--cloud-opacity);
}

.content-map {
  min-height: 540px;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 138, 122, 0.12), transparent 34%),
    radial-gradient(circle at 44% 42%, rgba(212, 165, 116, 0.08), transparent 30%),
    #ffffff;
}

.content-map::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(54vw, 620px);
  height: min(54vw, 620px);
  border: 1px solid rgba(91, 138, 122, 0.08);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.content-bubble {
  position: absolute;
  left: var(--bubble-x);
  top: var(--bubble-y);
  width: var(--bubble-size);
  height: var(--bubble-size);
  transform: translate(-50%, -50%) scale(1);
  animation: bubbleSettle 0.42s ease-out both;
  animation-delay: var(--bubble-delay);
}

.content-bubble:hover,
.content-bubble:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
}

.content-hub {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.3), transparent 36%),
    #5b8a7a;
  box-shadow: 0 18px 46px rgba(91, 138, 122, 0.25);
  transform: translate(-50%, -50%);
}

.content-hub strong {
  font-family: var(--font-serif);
  font-size: 24px;
}

.content-hub span {
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}

.era-links {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(250,250,247,0.78);
  backdrop-filter: blur(10px);
}

.content-book-list {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  padding: 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.86);
}

@keyframes bubbleSettle {
  from {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 560px) {
  .shelf-row {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .shelf-row::-webkit-scrollbar {
    display: block;
    height: 10px;
  }

  .shelf-row::after,
  .wall-row.is-category-row::after {
    content: none;
    position: sticky;
    right: 8px;
    bottom: 10px;
    z-index: 8;
    align-self: flex-end;
    margin-left: auto;
    margin-bottom: 12px;
    padding: 4px 8px;
    border: 1px solid rgba(91, 138, 122, 0.18);
    border-radius: 999px;
    color: #4d7a6a;
    background: rgba(255,255,255,0.78);
    font-size: 11px;
    pointer-events: none;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }

  .stats-overview-card,
  .stats-overview-card + .stats-overview-card,
  .stats-overview-card.is-priority {
    grid-column: span 1;
  }

  .content-map {
    min-height: 480px;
  }
}

/* Final pass: quieter shelf wall, clearer stats focus, clustered content map */
.shelf-row {
  overflow-x: hidden;
  scrollbar-width: none;
}

.shelf-row::-webkit-scrollbar {
  display: none;
}

.shelf-row::after,
.wall-row.is-category-row::after {
  content: none !important;
}

.wall-row {
  min-height: 222px;
  padding: 20px 12px 0;
}

.wall-row.is-category-row {
  padding-top: 18px;
}

.shelf-tag {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 178px;
  align-self: flex-end;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: 9px;
  margin: 0 12px 0 6px;
  padding: 36px 5px 11px;
  border: 1px solid rgba(69, 49, 31, 0.22);
  border-bottom: 0;
  border-radius: 20px 20px 3px 3px;
  color: #22312b;
  background:
    radial-gradient(circle at 50% 15px, rgba(255, 255, 255, 0.75) 0 9px, transparent 10px),
    radial-gradient(circle at 50% 15px, rgba(91, 138, 122, 0.46) 0 4px, transparent 5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), transparent 42%, rgba(0, 0, 0, 0.075)),
    linear-gradient(180deg, #fbf8ef 0%, #eee3d1 55%, #dac5a7 100%);
  box-shadow:
    4px 8px 16px rgba(61, 41, 24, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset -2px 0 4px rgba(85, 57, 33, 0.12),
    inset 2px 0 3px rgba(255, 255, 255, 0.42);
}

.shelf-tag::before,
.shelf-tag::after {
  display: none;
}

.shelf-tag strong {
  max-width: 1.1em;
  max-height: 108px;
  overflow: hidden;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: normal;
}

.shelf-tag span {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #5b8a7a;
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.book-spine,
.book-spine.has-cover-fallback,
.book-spine.has-cover-visual {
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, overlay, soft-light, multiply, normal;
}

.book-spine {
  filter: saturate(0.98) contrast(1.04);
}

.book-title {
  max-height: calc(100% - 20px);
  overflow: hidden;
}

.stats-view {
  gap: 34px;
}

.stats-hero {
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stats-hero .stats-save {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  white-space: nowrap;
}

.stats-overview {
  align-items: stretch;
  gap: 18px;
}

.stats-overview-card,
.stats-overview-card + .stats-overview-card {
  position: relative;
  min-height: 124px;
  padding: 20px;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 247, 0.8));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stats-overview-card::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, #5b8a7a 16%, transparent);
}

.stats-overview-card.is-priority {
  min-height: 164px;
  background:
    radial-gradient(circle at 86% 18%, rgba(91, 138, 122, 0.15), transparent 34%),
    #ffffff;
  box-shadow:
    0 20px 50px rgba(91, 138, 122, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stats-overview-card strong {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: clamp(34px, 3.4vw, 50px);
  line-height: 0.95;
}

.stats-overview-card.is-priority strong {
  color: #5b8a7a;
  font-size: clamp(58px, 6vw, 78px);
}

.stats-overview-card span,
.stats-overview-card small {
  position: relative;
  z-index: 1;
}

.stats-grid {
  gap: 30px;
}

.stats-card {
  border: 0;
  border-radius: 16px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.monthly-card,
.content-map-card {
  grid-column: 1 / -1;
}

.monthly-body {
  grid-template-columns: minmax(280px, 0.78fr) minmax(360px, 1.22fr);
  gap: 26px;
}

.monthly-wordcloud {
  align-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  background:
    radial-gradient(circle at 82% 12%, rgba(91, 138, 122, 0.08), transparent 34%),
    #ffffff;
}

.monthly-wordcloud span {
  max-width: min(100%, 420px);
  padding: 11px 13px;
  border: 1px solid rgba(91, 138, 122, 0.12);
  border-radius: 13px;
  color: #355e52;
  background: #edf3f0;
  font-family: var(--font-serif);
  font-size: clamp(14px, var(--cloud-size), 19px);
  line-height: 1.55;
}

.content-map {
  min-height: 580px;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 138, 122, 0.13), transparent 34%),
    radial-gradient(circle at 44% 42%, rgba(212, 165, 116, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 247, 0.72));
}

.content-map::before {
  border-color: rgba(91, 138, 122, 0.1);
  box-shadow:
    0 0 0 42px rgba(91, 138, 122, 0.025),
    inset 0 0 70px rgba(91, 138, 122, 0.04);
}

.content-bubble {
  border: 1px solid color-mix(in srgb, var(--bubble-accent), transparent 72%);
  color: #2c2c2c;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.62) 30%, color-mix(in srgb, var(--bubble-accent), #ffffff 72%) 62%, color-mix(in srgb, var(--bubble-accent), #2c2c2c 18%));
  box-shadow:
    inset -10px -12px 24px color-mix(in srgb, var(--bubble-accent), transparent 78%),
    inset 4px 5px 14px rgba(255, 255, 255, 0.62),
    0 16px 38px rgba(0, 0, 0, 0.07);
  transition: transform 0.22s ease-out, box-shadow 0.22s ease-out, opacity 0.22s ease-out;
}

.content-map:hover .content-bubble:not(:hover) {
  opacity: 0.68;
}

.content-bubble:hover,
.content-bubble:focus-visible {
  z-index: 6;
  transform: translate(-50%, -50%) scale(1.09);
  box-shadow:
    inset -12px -14px 26px color-mix(in srgb, var(--bubble-accent), transparent 70%),
    inset 4px 5px 14px rgba(255, 255, 255, 0.68),
    0 24px 54px rgba(0, 0, 0, 0.13);
}

.content-bubble strong {
  max-width: 100%;
  font-size: clamp(13px, calc(var(--bubble-size) / 8.2), 19px);
}

.content-hub {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.32), transparent 36%),
    linear-gradient(145deg, #6a9889, #426e60);
}

.era-thread-map {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  z-index: 5;
  display: grid;
  gap: 7px;
  max-height: 124px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid rgba(238, 238, 232, 0.86);
  border-radius: 14px;
  color: #8a8a86;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.055);
  font-size: 12px;
}

.era-thread-map strong {
  color: #5b8a7a;
  font-size: 13px;
}

.era-thread-map p {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.era-thread-map span {
  color: #2c2c2c;
  font-weight: 700;
}

.era-thread-map em {
  position: relative;
  padding-left: 14px;
  font-style: normal;
}

.era-thread-map em::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, #5b8a7a, transparent);
  transform: translateY(-50%);
  opacity: 0.22;
}

.content-book-list {
  max-height: 500px;
  overflow: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: ease-out;
}

@media (max-width: 980px) {
  .monthly-body {
    grid-template-columns: 1fr;
  }

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

  .stats-overview-card,
  .stats-overview-card + .stats-overview-card,
  .stats-overview-card.is-priority {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .shelf-row {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .shelf-row::-webkit-scrollbar {
    display: block;
    height: 10px;
  }

  .shelf-row::after,
  .wall-row.is-category-row::after {
    content: "左右滑动" !important;
    position: sticky;
    right: 8px;
    bottom: 10px;
    z-index: 8;
    align-self: flex-end;
    margin-left: auto;
    margin-bottom: 12px;
    padding: 4px 8px;
    border: 1px solid rgba(91, 138, 122, 0.18);
    border-radius: 999px;
    color: #4d7a6a;
    background: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    pointer-events: none;
  }

  .shelf-tag {
    flex-basis: 38px;
    width: 38px;
    margin-right: 9px;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }

  .content-map {
    min-height: 520px;
  }

  .era-thread-map {
    left: 12px;
    right: 12px;
  }
}

/* Monthly data and content map refinement */
.monthly-body {
  align-items: start;
  grid-template-columns: minmax(460px, 1.05fr) minmax(340px, 0.95fr);
  gap: 22px;
}

.monthly-read,
.monthly-finished,
.monthly-digest {
  padding: 22px;
  border: 1px solid #eeeee8;
  border-radius: 14px;
  background:
    radial-gradient(circle at 84% 12%, rgba(91, 138, 122, 0.07), transparent 34%),
    #ffffff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.monthly-read {
  min-height: 0;
}

.monthly-side {
  display: grid;
  gap: 16px;
}

.monthly-read h3,
.monthly-finished h3,
.monthly-digest h3 {
  margin: 0 0 16px;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 18px;
}

.monthly-book-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.monthly-book-stack button {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid rgba(238, 238, 232, 0.9);
  border-radius: 10px;
  color: #2c2c2c;
  background: rgba(250, 250, 247, 0.72);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.monthly-book-stack button:not([data-book-id]) {
  cursor: var(--cursor-rest);
}

.monthly-book-stack button[data-book-id]:hover,
.monthly-book-stack button[data-book-id]:focus-visible {
  border-color: rgba(91, 138, 122, 0.35);
  background: #edf3f0;
  transform: translateY(-1px);
}

.monthly-book-stack img,
.monthly-book-stack .monthly-cover {
  display: block;
  flex: 0 0 auto;
  width: 38px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  background-color: #eeeee8;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.monthly-book-stack img.is-empty,
.monthly-book-stack .monthly-cover.is-empty {
  background:
    linear-gradient(145deg, #edf3f0, #eeeee8);
}

.monthly-book-stack .monthly-cover.is-loading,
.monthly-finished-books .monthly-cover.is-loading {
  background:
    linear-gradient(110deg, #eeeee8 0%, #f7f7f3 44%, #e4e4de 72%, #eeeee8 100%);
  background-size: 220% 100%;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.monthly-book-stack span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.monthly-book-stack strong {
  overflow: hidden;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-book-stack em {
  color: #8a8a86;
  font-size: 12px;
  font-style: normal;
}

.monthly-wordcloud {
  display: none;
}

.monthly-finished-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.monthly-finished-list span {
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  color: #355e52;
  background: #edf3f0;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
}

.monthly-finished-books {
  display: grid;
  gap: 12px;
}

.monthly-finished-books button {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(238, 238, 232, 0.9);
  border-radius: 12px;
  color: #2c2c2c;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(250, 250, 247, 0.76));
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.monthly-finished-books button:not([data-book-id]) {
  cursor: var(--cursor-rest);
}

.monthly-finished-books button[data-book-id]:hover,
.monthly-finished-books button[data-book-id]:focus-visible {
  border-color: rgba(91, 138, 122, 0.35);
  background: #edf3f0;
  transform: translateY(-1px);
}

.monthly-finished-books img,
.monthly-finished-books .monthly-cover {
  display: block;
  flex: 0 0 auto;
  width: 48px;
  height: 68px;
  border-radius: 4px;
  object-fit: cover;
  background-color: #eeeee8;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.12);
}

.monthly-finished-books img.is-empty,
.monthly-finished-books .monthly-cover.is-empty {
  background: linear-gradient(145deg, #edf3f0, #eeeee8);
}

.monthly-finished-books span {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.monthly-finished-books strong {
  overflow: hidden;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-finished-books em {
  color: #8a8a86;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.monthly-digest {
  display: block;
  gap: 18px;
  background:
    radial-gradient(circle at 20% 12%, rgba(212, 165, 116, 0.08), transparent 34%),
    #ffffff;
}

.monthly-summary {
  padding: 22px;
  border: 1px solid #eeeee8;
  border-radius: 14px;
  background:
    radial-gradient(circle at 92% 18%, rgba(91, 138, 122, 0.08), transparent 34%),
    #ffffff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.monthly-digest h3 {
  margin-bottom: 14px;
}

.monthly-summary h3 {
  margin: 0 0 12px;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 18px;
}

.monthly-summary p {
  margin: 0;
  color: #2c2c2c;
  font-size: 14px;
  line-height: 1.8;
}

.monthly-digest dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.monthly-digest dl div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eeeee8;
}

.monthly-digest dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.monthly-digest dt {
  color: #8a8a86;
  font-size: 12px;
}

.monthly-digest dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-map.is-author .content-hub {
  width: 132px;
  height: 132px;
}

.content-map.is-author .content-bubble {
  z-index: 4;
}

.content-bubble {
  min-width: var(--bubble-size);
  min-height: var(--bubble-size);
}

.content-bubble span {
  font-size: clamp(11px, calc(var(--bubble-size) / 11), 15px);
}

.era-card {
  grid-column: 1 / -1;
}

.era-timeline {
  display: grid;
  gap: 14px;
}

.era-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eeeee8;
}

.era-row:last-child {
  border-bottom: 0;
}

.era-row.is-single {
  opacity: 0.96;
}

.era-row > strong {
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 24px;
}

.era-authors {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.era-authors::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(91, 138, 122, 0.28), transparent);
  transform: translateY(-50%);
}

.era-row.is-single .era-authors::before {
  right: auto;
  width: min(320px, 100%);
  background: linear-gradient(90deg, rgba(91, 138, 122, 0.24), rgba(91, 138, 122, 0.04), transparent);
}

.era-authors button {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  min-height: 46px;
  max-width: 210px;
  padding: 7px 12px;
  border: 1px solid rgba(91, 138, 122, 0.16);
  border-radius: 999px;
  color: #2c2c2c;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.045);
}

.era-authors button:hover,
.era-authors button:focus-visible {
  border-color: rgba(91, 138, 122, 0.38);
  color: #5b8a7a;
  max-width: 320px;
  transform: translateY(-1px);
}

.era-authors span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.era-authors em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8a8a86;
  font-size: 11px;
  font-style: normal;
}

.era-more {
  position: relative;
  z-index: 1;
  align-self: center;
  color: #8a8a86;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 780px) {
  .monthly-body,
  .monthly-metrics {
    grid-template-columns: 1fr;
  }

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

  .monthly-digest {
    grid-template-columns: 1fr;
  }

  .monthly-summary {
    padding: 18px;
  }

  .era-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Reading content map: quiet constellation */
.content-map-card {
  overflow: hidden;
}

.content-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
}

.content-crumbs button,
.content-crumbs span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(91, 138, 122, 0.16);
  border-radius: 999px;
  color: #4a4a48;
  background: rgba(237, 243, 240, 0.72);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.content-crumbs button:hover,
.content-crumbs button:focus-visible {
  border-color: rgba(91, 138, 122, 0.38);
  color: #5b8a7a;
  background: #ffffff;
}

.content-map {
  position: relative;
  display: block;
  contain: layout paint;
  scroll-margin-top: 96px;
  min-height: 570px;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(91, 138, 122, 0.1);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(91, 138, 122, 0.13) 0%, rgba(91, 138, 122, 0.045) 36%, transparent 62%),
    radial-gradient(circle at 28% 30%, rgba(212, 165, 116, 0.07), transparent 30%),
    radial-gradient(circle at 74% 68%, rgba(110, 145, 168, 0.055), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 247, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -80px 140px rgba(91, 138, 122, 0.035);
}

.content-map::before,
.content-map::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.content-map::before {
  inset: 34px;
  z-index: 0;
  border: 1px solid rgba(91, 138, 122, 0.055);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 92px, rgba(91, 138, 122, 0.03) 93px 94px),
    linear-gradient(rgba(91, 138, 122, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 138, 122, 0.018) 1px, transparent 1px);
  background-size: auto, 84px 84px, 84px 84px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, rgba(0, 0, 0, 0.62) 48%, transparent 76%);
}

.content-map::after {
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 54%, rgba(250, 250, 247, 0.58) 100%);
}

.content-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.content-links path {
  fill: none;
  stroke: rgba(91, 138, 122, 0.08);
  stroke-width: 0.12;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.content-bubble {
  position: absolute;
  --bubble-opacity: 1;
  --bubble-drift-x: 0px;
  --bubble-drift-y: 0px;
  --bubble-bounce-x: 0px;
  --bubble-bounce-y: 0px;
  appearance: none;
  left: var(--bubble-x);
  top: var(--bubble-y);
  z-index: 3;
  width: var(--bubble-size);
  height: var(--bubble-size);
  min-width: var(--bubble-size);
  min-height: var(--bubble-size);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 11px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--bubble-accent), #ffffff 28%);
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.13) 0 12%, transparent 31%),
    radial-gradient(circle at 76% 80%, color-mix(in srgb, var(--bubble-accent), #2c2c2c 10%) 0 34%, transparent 58%),
    linear-gradient(145deg, color-mix(in srgb, var(--bubble-accent), #ffffff 12%), var(--bubble-accent) 60%, color-mix(in srgb, var(--bubble-accent), #2c2c2c 10%));
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--bubble-accent), transparent 86%),
    0 9px 24px rgba(44, 44, 44, 0.065),
    inset 2px 3px 9px rgba(255, 255, 255, 0.12),
    inset -9px -12px 22px rgba(44, 44, 44, 0.095),
    inset 0 0 0 1px rgba(255, 255, 255, 0.11);
  text-align: center;
  opacity: var(--bubble-opacity, 1);
  transform: translate(-50%, -50%) scale(1);
  animation: contentBubbleIn 620ms cubic-bezier(0.18, 0.84, 0.22, 1) backwards;
  animation-delay: var(--bubble-delay);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.78, 0.22, 1),
    box-shadow 0.28s ease-out,
    opacity 0.22s ease,
    filter 0.22s ease;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
  scroll-margin: 120px;
}

.content-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  border-radius: inherit;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  mix-blend-mode: soft-light;
  opacity: 0.18;
  filter: none;
  pointer-events: none;
}

.content-bubble::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid rgba(238, 238, 232, 0.9);
  border-radius: 8px;
  color: #2c2c2c;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.content-bubble strong,
.content-bubble span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: inherit;
  text-shadow: none;
}

.content-bubble strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(13px, calc(var(--bubble-size) / 8.9), 24px);
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.content-bubble span {
  font-family: var(--font-sans);
  font-size: clamp(11px, calc(var(--bubble-size) / 11.5), 15px);
  font-weight: 500;
  opacity: 0.78;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.content-bubble.is-compact {
  padding: 8px;
}

.content-bubble.is-compact strong {
  max-width: 84%;
  font-size: clamp(11px, calc(var(--bubble-size) / 5.7), 16px);
  line-height: 1.08;
  -webkit-line-clamp: 2;
}

.content-bubble.is-compact span {
  display: none;
}

.content-bubble.is-primary {
  box-shadow:
    0 20px 52px rgba(91, 138, 122, 0.14),
    0 14px 34px rgba(44, 44, 44, 0.08),
    inset 3px 5px 13px rgba(255, 255, 255, 0.14),
    inset -13px -17px 30px rgba(44, 44, 44, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.content-bubble.is-muted {
  color: #4a4a48;
  border-color: rgba(138, 138, 134, 0.2);
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.18) 0 13%, transparent 32%),
    linear-gradient(145deg, #d3d0c8, #b9b3aa 58%, #a49c91);
}

.content-bubble.is-muted::before {
  opacity: 0.22;
}

.content-bubble.is-minor {
  padding: 0;
  color: transparent;
  border-color: color-mix(in srgb, var(--bubble-accent), #ffffff 26%);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.16) 0 15%, transparent 40%),
    linear-gradient(145deg, color-mix(in srgb, var(--bubble-accent), #ffffff 14%), var(--bubble-accent) 62%, color-mix(in srgb, var(--bubble-accent), #2c2c2c 11%));
  box-shadow:
    0 8px 18px rgba(44, 44, 44, 0.055),
    inset 3px 4px 9px rgba(255, 255, 255, 0.14),
    inset -5px -7px 12px rgba(44, 44, 44, 0.1);
}

.content-bubble.is-minor::before {
  inset: 0;
  opacity: 0.09;
}

.content-bubble.is-minor strong,
.content-bubble.is-minor span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.content-bubble:hover,
.content-bubble:focus-visible {
  z-index: 20;
  outline: none;
  --bubble-opacity: 1;
  filter: saturate(1.04) brightness(1.01);
  transform: translate(-50%, -50%) scale(1.055);
  box-shadow:
    0 22px 50px color-mix(in srgb, var(--bubble-accent), transparent 84%),
    0 20px 46px rgba(44, 44, 44, 0.13),
    inset 3px 5px 13px rgba(255, 255, 255, 0.15),
    inset -12px -16px 28px rgba(44, 44, 44, 0.11);
}

.content-bubble:hover::before,
.content-bubble:focus-visible::before {
  opacity: 0.16;
  filter: none;
}

.content-bubble:hover::after,
.content-bubble:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.content-map:has(.content-bubble:hover) .content-bubble:not(:hover),
.content-map:has(.content-bubble:focus-visible) .content-bubble:not(:focus-visible) {
  --bubble-opacity: 0.48;
}

.content-map:has(.content-bubble:hover) .content-bubble.is-minor:not(:hover),
.content-map:has(.content-bubble:focus-visible) .content-bubble.is-minor:not(:focus-visible) {
  --bubble-opacity: 0.34;
}

.content-bubble.is-ghost {
  z-index: 2;
  color: rgba(74, 74, 72, 0.72);
  border-color: rgba(138, 138, 134, 0.16);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.14) 0 14%, transparent 38%),
    linear-gradient(145deg, #d5d2cb, #beb8af 58%, #aaa299);
  box-shadow:
    0 12px 28px rgba(44, 44, 44, 0.05),
    inset 2px 3px 8px rgba(255, 255, 255, 0.11),
    inset -8px -10px 18px rgba(44, 44, 44, 0.075);
  --bubble-opacity: 0.64;
  filter: saturate(0.42);
}

.content-bubble.is-ghost::before {
  opacity: 0.14;
}

.content-bubble.is-ghost strong,
.content-bubble.is-ghost span {
  text-shadow: none;
}

.content-bubble.is-ghost-current {
  --bubble-opacity: 0.7;
  color: rgba(44, 44, 44, 0.78);
  border-color: rgba(91, 138, 122, 0.18);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.16) 0 14%, transparent 38%),
    linear-gradient(145deg, #dce5df, #c4d0c9 58%, #abbab2);
}

.content-map:has(.content-bubble:hover) .content-bubble.is-ghost:not(:hover),
.content-map:has(.content-bubble:focus-visible) .content-bubble.is-ghost:not(:focus-visible) {
  --bubble-opacity: 0.48;
}

.content-bubble.is-ghost:hover,
.content-bubble.is-ghost:focus-visible {
  --bubble-opacity: 0.88;
  filter: saturate(0.75);
  transform: translate(-50%, -50%) scale(1.045);
}

.content-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed rgba(91, 138, 122, 0.16);
  border-radius: 50%;
  color: rgba(91, 138, 122, 0.58);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.content-hub strong {
  font-family: var(--font-serif);
  font-size: 30px;
}

.content-hub span {
  color: rgba(91, 138, 122, 0.52);
  font-size: 13px;
  font-weight: 500;
}

.content-map.is-author .content-hub {
  display: none;
}

.content-book-list {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100% - 40px));
  display: grid;
  gap: 12px;
  margin: 42px auto;
  padding: 36px;
  border: 1px solid rgba(91, 138, 122, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.content-book-list::before {
  content: "";
  position: absolute;
  left: 84px;
  top: 34px;
  bottom: 34px;
  width: 1px;
  background: linear-gradient(#eeeee8, rgba(91, 138, 122, 0.22), #eeeee8);
}

.content-book-list button {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 20px;
  min-height: 66px;
  padding: 14px 18px;
  border: 1px solid #eeeee8;
  border-radius: 14px;
  background: rgba(250, 250, 247, 0.84);
  text-align: left;
  animation: bookTimelineIn 300ms ease-out both;
  animation-delay: calc(var(--book-order) * 34ms);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.content-book-list button::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #5b8a7a;
  box-shadow: 0 0 0 1px rgba(91, 138, 122, 0.22);
  transform: translateY(-50%);
}

.content-book-list button:hover,
.content-book-list button:focus-visible {
  border-color: rgba(91, 138, 122, 0.28);
  background: #ffffff;
  transform: translateX(2px);
}

.content-book-list span {
  order: -1;
  color: #5b8a7a;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
}

.content-book-list strong {
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 18px;
}

.content-evolution-card {
  grid-column: 1 / -1;
  overflow: visible;
  padding-top: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(250, 250, 247, 0.18)),
    transparent;
}

.content-evolution-card .stats-card-heading {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 0 20px;
  border-bottom: 1px solid rgba(44, 44, 44, 0.12);
  text-align: center;
}

.content-evolution-card .stats-card-heading > div {
  position: relative;
  display: grid;
  width: 100%;
  justify-items: center;
}

.content-evolution-card .stats-card-heading span {
  position: absolute;
  left: 0;
  top: 4px;
  color: rgba(44, 44, 44, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.content-evolution-card .stats-card-heading h2 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(50px, 7.2vw, 88px);
  letter-spacing: 0;
  line-height: 0.98;
}

.content-evolution-card .stats-card-heading h2::after {
  content: "EVOLUTION";
  position: absolute;
  left: 50%;
  top: 53%;
  z-index: -1;
  color: rgba(44, 44, 44, 0.105);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82em;
  letter-spacing: 0.02em;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.content-evolution-card .stats-card-heading p {
  margin: 0;
  color: rgba(44, 44, 44, 0.46);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.evolution-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(84px, 1fr));
  gap: 12px;
  width: 86%;
  margin-left: 8%;
  padding: 26px min(3vw, 42px) 20px;
  border-bottom: 1px solid rgba(44, 44, 44, 0.08);
}

.evolution-tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #2c2c2c;
  text-align: center;
}

.evolution-tab::before {
  content: "";
  width: 22px;
  height: 1px;
  margin-bottom: 7px;
  border-radius: 999px;
  background: var(--group-color);
  opacity: 0.48;
}

.evolution-tab strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.evolution-tab span {
  color: #8a8a86;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-evolution-map {
  position: relative;
  min-height: clamp(620px, calc(var(--year-count) * 132px), 940px);
  margin-top: 12px;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(44, 44, 44, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(44, 44, 44, 0.02) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.56), transparent 48%),
    rgba(255, 255, 255, 0.2);
  background-size: 118px 100%, 100% 82px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(44, 44, 44, 0.035);
}

.evolution-year-row {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--row-y);
  height: 1px;
  background: linear-gradient(90deg, rgba(44, 44, 44, 0.08), rgba(44, 44, 44, 0.032) 24%, rgba(44, 44, 44, 0.07));
}

.evolution-year-row strong,
.evolution-year-row span {
  position: absolute;
  left: clamp(8px, 1.6vw, 18px);
  transform: translateY(-50%);
}

.evolution-year-row strong {
  top: -15px;
  color: #2c2c2c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1;
}

.evolution-year-row span {
  top: 20px;
  color: #8a8a86;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.evolution-rail {
  position: absolute;
  top: 7%;
  bottom: 6%;
  left: var(--rail-x);
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(44, 44, 44, 0.038), transparent);
}

.evolution-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.evolution-lines path {
  fill: none;
  stroke: rgba(44, 44, 44, 0.18);
  stroke-width: 0.36;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.evolution-node {
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  z-index: 3;
  width: var(--node-size);
  height: var(--node-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.evolution-node::before,
.evolution-node::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.evolution-node::before {
  inset: -5px;
  border: 1px solid rgba(44, 44, 44, 0.18);
  background:
    radial-gradient(circle, transparent 0 49%, rgba(255, 255, 255, 0.7) 50% 61%, transparent 62%),
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.78), transparent 30%),
    color-mix(in srgb, var(--node-color), #ffffff 78%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.055),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0.66;
}

.evolution-node::after {
  inset: 18%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.3), transparent 32%),
    color-mix(in srgb, var(--node-color), #2c2c2c 12%);
  box-shadow:
    0 0 0 1px rgba(44, 44, 44, 0.18),
    inset 2px 3px 6px rgba(255, 255, 255, 0.16),
    inset -3px -4px 8px rgba(0, 0, 0, 0.13);
}

.evolution-node.is-quiet::before {
  inset: -3px;
  opacity: 0.5;
}

.evolution-node.is-quiet::after {
  inset: 22%;
  opacity: 0.72;
}

.evolution-node.is-strong::before {
  inset: -8px;
  opacity: 0.84;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    0 8px 20px rgba(0, 0, 0, 0.09),
    0 0 22px color-mix(in srgb, var(--node-color), transparent 84%);
}

.evolution-node span {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  z-index: 6;
  max-width: 140px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(44, 44, 44, 0.08);
  border-radius: 999px;
  color: #2c2c2c;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(-50%) translateX(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.evolution-node.is-strong span {
  opacity: 0.66;
}

.evolution-node:hover,
.evolution-node:focus-visible {
  z-index: 20;
  outline: none;
  filter: saturate(1.02);
  transform: translate(-50%, -50%) scale(1.1);
}

.content-evolution-map:has(.evolution-node:hover) .evolution-node:not(:hover),
.content-evolution-map:has(.evolution-node:focus-visible) .evolution-node:not(:focus-visible) {
  opacity: 0.48;
}

.evolution-node:hover span,
.evolution-node:focus-visible span {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.content-atlas-card {
  grid-column: 1 / -1;
  overflow-x: clip;
  overflow-y: visible;
  padding-top: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(250, 250, 247, 0.18)),
    transparent;
}

.content-atlas-card .stats-card-heading {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 0 20px;
  border-bottom: 1px solid rgba(44, 44, 44, 0.12);
  text-align: center;
}

.content-atlas-card .stats-card-heading > div {
  position: relative;
  display: grid;
  width: 100%;
  justify-items: center;
}

.content-atlas-card .stats-card-heading span {
  position: absolute;
  left: 0;
  top: 4px;
  color: rgba(44, 44, 44, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.content-atlas-card .stats-card-heading h2 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(46px, 6.6vw, 82px);
  letter-spacing: 0;
  line-height: 0.98;
}

.content-atlas-card .stats-card-heading h2::after {
  content: "AUTHOR ATLAS";
  position: absolute;
  left: 50%;
  top: 53%;
  z-index: -1;
  color: rgba(44, 44, 44, 0.105);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72em;
  letter-spacing: 0.02em;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.content-atlas-card .stats-card-heading p {
  margin: 0;
  color: rgba(44, 44, 44, 0.46);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.atlas-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 18px;
  padding: 0 0 8px;
  overflow: visible;
}

.atlas-country-filter {
  position: relative;
  flex: 0 0 auto;
  padding: 6px 3px 9px;
  border: 0;
  border-radius: 0;
  color: #8a8a86;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.18s ease;
}

.atlas-country-filter::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: #5b8a7a;
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.atlas-country-filter:hover,
.atlas-country-filter:focus-visible,
.atlas-country-filter.is-active {
  color: #2c2c2c;
}

.atlas-country-filter.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.content-atlas-map {
  position: relative;
  width: 100%;
  min-height: clamp(660px, calc(var(--era-count) * 120px), 840px);
  margin-top: 10px;
  overflow: hidden;
  border-radius: 3px;
  contain: layout paint;
  background:
    linear-gradient(90deg, rgba(44, 44, 44, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(44, 44, 44, 0.02) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.56), transparent 48%),
    rgba(255, 255, 255, 0.2);
  background-size: 118px 100%, 100% 82px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(44, 44, 44, 0.035);
}

.content-atlas-map[data-content-level="author"] {
  min-height: clamp(700px, calc(var(--era-count) * 128px), 880px);
}

.content-atlas-map[data-content-level="book"] {
  min-height: clamp(620px, calc(var(--era-count) * 112px), 760px);
}

.atlas-country-axis {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  height: 96px;
  pointer-events: none;
}

.atlas-country-axis-label {
  position: absolute;
  left: var(--axis-x);
  top: 18px;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 86px;
  padding: 0;
  border: 0;
  color: #2c2c2c;
  background: transparent;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: auto;
}

.atlas-country-axis-label::before {
  content: "";
  width: 24px;
  height: 1px;
  border-radius: 999px;
  background: rgba(44, 44, 44, 0.34);
}

.atlas-country-axis-label.is-selected::before {
  height: 2px;
  background: #5b8a7a;
}

.atlas-country-axis-label strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
}

.atlas-country-axis-label span {
  color: #8a8a86;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-era-row {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--row-y);
  height: 1px;
  background: linear-gradient(90deg, rgba(44, 44, 44, 0.08), rgba(44, 44, 44, 0.032) 24%, rgba(44, 44, 44, 0.07));
}

.atlas-era-row strong,
.atlas-era-row span {
  position: absolute;
  left: clamp(8px, 1.6vw, 18px);
  transform: translateY(-50%);
}

.atlas-era-row strong {
  top: -15px;
  max-width: 22%;
  color: #2c2c2c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2.35vw, 31px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.atlas-era-row span {
  top: 18px;
  color: #8a8a86;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.atlas-country-rail {
  position: absolute;
  top: 14%;
  bottom: 5%;
  left: var(--rail-x);
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(44, 44, 44, 0.038), transparent);
}

.atlas-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.atlas-lines path {
  fill: none;
  stroke: rgba(91, 138, 122, 0.18);
  stroke-width: 0.32;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.atlas-author-node {
  position: absolute;
  left: var(--atlas-node-x);
  top: var(--atlas-node-y);
  z-index: 3;
  width: var(--atlas-node-size);
  height: var(--atlas-node-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  animation: atlasNodeIn 0.24s ease-out both;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  will-change: transform, opacity;
}

.atlas-author-node::before,
.atlas-author-node::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.atlas-author-node::before {
  inset: -5px;
  border: 1px solid rgba(44, 44, 44, 0.18);
  background:
    radial-gradient(circle, transparent 0 49%, rgba(255, 255, 255, 0.7) 50% 61%, transparent 62%),
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.78), transparent 30%),
    color-mix(in srgb, var(--atlas-node-color), #ffffff 78%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.055),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0.66;
}

.atlas-author-node::after {
  inset: 18%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.3), transparent 32%),
    color-mix(in srgb, var(--atlas-node-color), #2c2c2c 12%);
  box-shadow:
    0 0 0 1px rgba(44, 44, 44, 0.18),
    inset 2px 3px 6px rgba(255, 255, 255, 0.16),
    inset -3px -4px 8px rgba(0, 0, 0, 0.13);
}

.atlas-author-node.is-quiet::before {
  inset: -3px;
  opacity: 0.5;
}

.atlas-author-node.is-quiet::after {
  inset: 22%;
  opacity: 0.72;
}

.atlas-author-node.is-strong::before {
  inset: -5px;
  opacity: 0.72;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    0 7px 16px rgba(0, 0, 0, 0.07),
    0 0 18px color-mix(in srgb, var(--atlas-node-color), transparent 88%);
}

.content-atlas-map[data-content-level="author"] .atlas-author-node::before {
  inset: -4px;
}

.content-atlas-map[data-content-level="author"] .atlas-author-node::after {
  inset: 21%;
}

.content-atlas-map[data-content-level="author"] .atlas-author-node.is-strong::before {
  inset: -4px;
}

.atlas-author-node.is-muted {
  opacity: 0.28;
}

.atlas-author-node.is-book::before {
  border-radius: 16px;
}

.atlas-author-node.is-book::after {
  border-radius: 10px;
}

.atlas-author-node span,
.atlas-author-node em {
  position: absolute;
  left: calc(100% + 8px);
  z-index: 6;
  max-width: min(240px, 30vw);
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(-50%) translateX(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.atlas-author-node span {
  top: 44%;
  padding: 4px 7px 0;
  border: 1px solid rgba(44, 44, 44, 0.08);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  color: #2c2c2c;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
}

.atlas-author-node em {
  top: calc(44% + 18px);
  padding: 0 7px 4px;
  border: 1px solid rgba(44, 44, 44, 0.08);
  border-top: 0;
  border-radius: 0 0 999px 999px;
  color: #8a8a86;
  background: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-style: normal;
  opacity: 0;
}

.atlas-author-node.is-strong span,
.atlas-author-node.is-strong em {
  opacity: 0;
}

.atlas-author-node:hover,
.atlas-author-node:focus-visible {
  z-index: 20;
  outline: none;
  filter: saturate(1.02);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.content-atlas-map:has(.atlas-author-node:hover) .atlas-author-node:not(:hover),
.content-atlas-map:has(.atlas-author-node:focus-visible) .atlas-author-node:not(:focus-visible) {
  opacity: 0.42;
}

.atlas-author-node:hover span,
.atlas-author-node:hover em,
.atlas-author-node:focus-visible span,
.atlas-author-node:focus-visible em {
  opacity: 1;
  max-width: min(320px, 42vw);
  transform: translateY(-50%) translateX(0);
}

.author-books-modal {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: none;
  place-items: center;
  padding: 24px;
}

@keyframes atlasNodeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.author-books-modal.is-open {
  display: grid;
}

.author-books-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(4px);
}

.author-books-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(238, 238, 232, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(91, 138, 122, 0.075), transparent 34%),
    #ffffff;
  box-shadow:
    0 2px 20px rgba(0, 0, 0, 0.06),
    0 28px 80px rgba(0, 0, 0, 0.13);
  animation: modalPanelIn 0.2s ease-out both;
}

.author-books-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid #eeeee8;
  border-radius: 50%;
  color: #8a8a86;
  background: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.author-books-close:hover,
.author-books-close:focus-visible {
  color: #5b8a7a;
  border-color: rgba(91, 138, 122, 0.28);
}

.author-books-head {
  display: grid;
  gap: 6px;
  padding-right: 42px;
  margin-bottom: 20px;
}

.author-books-head span {
  color: #8a8a86;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.author-books-head h3 {
  margin: 0;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.16;
}

.author-books-head p {
  margin: 0;
  color: #8a8a86;
  font-size: 14px;
}

.author-books-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.author-book-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #eeeee8;
  border-radius: 12px;
  background: rgba(250, 250, 247, 0.82);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.author-book-item:hover,
.author-book-item:focus-visible {
  border-color: rgba(91, 138, 122, 0.28);
  background: #ffffff;
  transform: translateY(-1px);
}

.author-book-cover {
  width: 42px;
  height: 56px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(91, 138, 122, 0.16), rgba(212, 165, 116, 0.14)),
    #eeeee8;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.author-book-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.author-book-copy strong {
  overflow: hidden;
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-book-copy em {
  color: #8a8a86;
  font-size: 12px;
  font-style: normal;
}

@keyframes contentBubbleIn {
  0% {
    opacity: 0;
    filter: blur(0.8px) saturate(0.82);
    transform: translate(-50%, -50%) translate(var(--bubble-drift-x), var(--bubble-drift-y)) scale(0.62);
  }
  72% {
    opacity: var(--bubble-opacity, 1);
    filter: blur(0) saturate(1);
    transform: translate(-50%, -50%) translate(var(--bubble-bounce-x), var(--bubble-bounce-y)) scale(1.035);
  }
  100% {
    opacity: var(--bubble-opacity, 1);
    filter: blur(0) saturate(1);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes bookTimelineIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .content-map {
    min-height: 560px;
    border-radius: 16px;
  }

  .content-map::before {
    inset: 16px;
    background-size: auto, 56px 56px, 56px 56px;
  }

  .content-bubble {
    padding: 9px;
  }

  .content-bubble strong {
    font-size: clamp(11px, calc(var(--bubble-size) / 9.2), 17px);
  }

  .content-hub {
    width: 138px;
    height: 138px;
  }

  .content-hub strong {
    font-size: 22px;
  }

  .content-book-list {
    width: calc(100% - 18px);
    margin: 18px auto;
    padding: 20px;
  }

  .content-book-list::before,
  .content-book-list button::before {
    display: none;
  }

  .content-book-list button {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .author-books-modal {
    padding: 14px;
  }

  .author-books-panel {
    padding: 22px 16px 16px;
  }

  .author-books-list {
    grid-template-columns: 1fr;
  }

  .state-books-panel {
    max-height: calc(100vh - 28px);
  }

  .state-books-list {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 220px);
    padding-right: 2px;
  }

  .content-atlas-card {
    overflow-x: clip;
    padding-bottom: 8px;
  }

  .content-atlas-card .stats-card-heading {
    min-width: 0;
  }

  .content-atlas-card .stats-card-heading h2 {
    font-size: 38px;
  }

  .atlas-toolbar {
    min-width: 0;
    padding-right: 16px;
  }

  .content-atlas-map {
    width: 100%;
    min-height: 680px;
  }

  .atlas-country-axis-label strong {
    font-size: 13px;
  }

  .atlas-era-row strong {
    font-size: 18px;
  }

  .atlas-era-row span {
    display: none;
  }

  .atlas-author-node span,
  .atlas-author-node em,
  .atlas-author-node.is-strong span,
  .atlas-author-node.is-strong em {
    opacity: 0;
  }

  .evolution-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 8px;
    width: auto;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .evolution-tab strong {
    font-size: 13px;
  }

  .content-evolution-map {
    min-height: clamp(560px, calc(var(--year-count) * 118px), 780px);
  }

  .evolution-year-row strong {
    font-size: 22px;
  }

  .evolution-year-row span {
    display: none;
  }

  .evolution-node span,
  .evolution-node.is-strong span {
    opacity: 0;
  }
}

/* Unified metric language */
.stats-overview-card,
.stats-overview-card + .stats-overview-card,
.stats-overview-card.is-priority,
.monthly-metrics article {
  --metric-accent: #5b8a7a;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(238, 238, 232, 0.94);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 247, 0.82));
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stats-overview-card::before,
.monthly-metrics article::before {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -64px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--metric-accent) 18%, transparent) 0 36%, color-mix(in srgb, var(--metric-accent) 7%, transparent) 37% 62%, transparent 63%);
  opacity: 0.86;
}

.stats-overview-card::after,
.monthly-metrics article::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 14px;
  width: 52px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--metric-accent) 46%, transparent), transparent);
}

.stats-overview-card > *,
.monthly-metrics article > * {
  position: relative;
  z-index: 1;
}

.stats-overview-card.tone-paper {
  --metric-accent: #8a8a86;
}

.stats-overview-card.tone-brass,
.stats-overview-card.is-priority {
  --metric-accent: #5b8a7a;
}

.stats-overview-card.tone-teal,
.stats-overview-card.tone-ink,
.stats-overview-card.group-time {
  --metric-accent: #5e8cae;
}

.stats-overview-card.tone-wine,
.stats-overview-card.group-notes {
  --metric-accent: #8b7eb8;
}

.stats-overview-card.tone-muted {
  --metric-accent: #c8c4bc;
}

.stats-overview-card strong,
.stats-overview-card.is-priority strong,
.stats-overview-card.tone-brass strong,
.stats-overview-card.tone-teal strong,
.stats-overview-card.tone-wine strong,
.stats-overview-card.tone-ink strong,
.monthly-metrics strong {
  color: #2c2c2c;
  font-family: var(--font-serif);
  letter-spacing: 0;
}

.stats-overview-card span,
.stats-overview-card small,
.monthly-metrics span {
  color: #8a8a86;
  font-family: var(--font-sans);
  font-weight: 500;
}

.stats-overview-card.is-priority {
  box-shadow:
    0 16px 42px rgba(91, 138, 122, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.monthly-metrics article {
  min-height: 106px;
  padding: 24px 18px 16px;
}

/* Statistics metric cards: final alignment pass */
.stats-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stats-overview-card,
.stats-overview-card + .stats-overview-card,
.stats-overview-card.is-priority {
  grid-column: auto;
  min-height: 138px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 8px;
  padding: 34px 22px 18px;
  border: 1px solid rgba(238, 238, 232, 0.96);
  border-radius: 16px;
}

.stats-overview-card::before,
.monthly-metrics article::before {
  right: -54px;
  bottom: -64px;
  width: 150px;
  height: 150px;
}

.stats-overview-card strong,
.stats-overview-card.is-priority strong {
  width: 100%;
  color: #2c2c2c;
  font-size: clamp(34px, 3.2vw, 52px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.stats-overview-card.is-long-value strong {
  font-size: clamp(28px, 2.45vw, 42px);
}

.stats-overview-card span {
  font-size: 14px;
  line-height: 1.35;
}

.stats-overview-card small {
  margin-top: -2px;
  font-size: 12px;
}

.monthly-metrics {
  gap: 14px;
}

.monthly-metrics article {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 116px;
  padding-bottom: 22px;
}

.monthly-metrics strong {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .stats-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stats-overview,
  .monthly-metrics {
    grid-template-columns: 1fr;
  }
}

.monthly-body {
  align-items: stretch;
}

.monthly-read {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.monthly-book-stack {
  flex: 1;
  align-content: start;
}

.monthly-side {
  align-content: start;
}

.monthly-summary {
  min-height: 150px;
}

/* Final metric card finish */
.stats-overview-card,
.stats-overview-card + .stats-overview-card,
.stats-overview-card.is-priority,
.monthly-metrics article {
  --metric-accent: #5b8a7a;
  border: 1px solid rgba(238, 238, 232, 0.9);
  background:
    radial-gradient(circle at calc(100% + 56px) calc(100% + 56px), rgba(91, 138, 122, 0.072) 0 34%, rgba(91, 138, 122, 0.032) 35% 58%, transparent 59%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.985) 0%, rgba(250, 250, 247, 0.94) 58%, rgba(237, 243, 240, 0.42) 100%);
  box-shadow:
    0 16px 38px rgba(44, 44, 44, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.stats-overview-card::before,
.monthly-metrics article::before {
  right: -74px;
  bottom: -78px;
  width: 132px;
  height: 132px;
  background:
    radial-gradient(circle, rgba(91, 138, 122, 0.062) 0 38%, rgba(91, 138, 122, 0.024) 39% 64%, transparent 65%);
  opacity: 0.72;
}

.stats-overview-card::after,
.monthly-metrics article::after {
  bottom: 15px;
  background: linear-gradient(90deg, rgba(91, 138, 122, 0.48), rgba(91, 138, 122, 0));
}

.stats-overview-card strong,
.stats-overview-card.is-priority strong,
.stats-overview-card.tone-brass strong,
.stats-overview-card.tone-teal strong,
.stats-overview-card.tone-wine strong,
.stats-overview-card.tone-ink strong,
.monthly-metrics strong {
  color: #5b8a7a;
}

.stats-overview-card.tone-muted strong {
  color: #c8c4bc;
}

.stats-overview-card span,
.stats-overview-card small,
.monthly-metrics span {
  color: #77776f;
}

/* Mobile progress distribution stability */
.progress-dist-count {
  min-width: 5ch;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.18em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-dist-count b {
  font: inherit;
  font-weight: inherit;
}

.progress-dist-count em {
  font-style: normal;
}

@media (max-width: 680px) {
  .state-map-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .state-map-canvas {
    min-height: 360px;
  }

  .state-map-legend {
    gap: 4px;
  }

  .state-map-legend-item {
    padding: 9px 0;
  }

  .stats-progress-card {
    overflow: visible;
  }

  .progress-dist-row {
    grid-template-columns: minmax(78px, 0.66fr) minmax(72px, 1fr) minmax(5ch, 56px);
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .progress-dist-label,
  .progress-dist-track {
    min-width: 0;
  }

  .progress-dist-count {
    width: 100%;
    min-width: 5ch;
    padding-left: 2px;
    overflow: visible;
    color: #77776f;
    text-align: right;
    justify-self: stretch;
  }

  .progress-dist-count em {
    display: none;
  }
}

@media (max-width: 390px) {
  .progress-dist-row {
    grid-template-columns: minmax(70px, 0.62fr) minmax(62px, 1fr) minmax(5ch, 52px);
    gap: 8px;
  }
}

@media (pointer: coarse) {
  html,
  body,
  button,
  input,
  select,
  textarea,
  a {
    cursor: auto !important;
  }
}

@media (max-width: 680px) {
  .progress-dist-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label count"
      "track track";
    align-items: end;
    gap: 8px 12px;
    padding: 4px 0 12px;
  }

  .progress-dist-label {
    grid-area: label;
    min-width: 0;
  }

  .progress-dist-track {
    grid-area: track;
    width: 100%;
    min-width: 0;
  }

  .progress-dist-count {
    grid-area: count;
    width: auto;
    min-width: max-content;
    padding-left: 8px;
    justify-self: end;
    color: #77776f;
    line-height: 1.2;
  }

  .progress-dist-count em {
    display: inline;
  }
}

/* Final mobile polish */
@media (max-width: 680px) {
  .stats-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .stats-hero .stats-save {
    width: 100%;
    min-height: 46px;
  }

  .stats-card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .stats-card-heading {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .stats-card-heading h2 {
    font-size: clamp(23px, 7vw, 30px);
    line-height: 1.16;
  }

  .stats-card-heading p {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.45;
  }

  .stats-overview {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats-overview-card,
  .stats-overview-card + .stats-overview-card,
  .stats-overview-card:nth-child(4),
  .stats-overview-card:nth-child(odd),
  .stats-overview-card:last-child:nth-child(odd) {
    grid-column: auto;
    min-height: 112px;
    padding: 18px;
    border-left: 1px solid rgba(238, 238, 232, 0.9);
    border-radius: 14px;
  }

  .stats-overview-card strong {
    font-size: clamp(36px, 13vw, 48px);
  }

  .category-treemap {
    height: 340px;
  }

  .treemap-tile {
    border-width: 2px;
    padding: 8px;
  }

  .treemap-tile strong {
    font-size: 12px;
  }

  .treemap-tile span {
    font-size: 11px;
  }

  .state-map-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .state-map-canvas {
    min-height: 430px;
    border-radius: 16px;
  }

  .state-node {
    width: min(var(--size), var(--state-mobile-size, 96px));
    height: min(var(--size), var(--state-mobile-size, 96px));
    padding: 8px;
    gap: 3px;
  }

  .state-node-finished {
    --x: 66 !important;
    --y: 33 !important;
    --state-mobile-size: 116px;
  }

  .state-node-active {
    --x: 30 !important;
    --y: 35 !important;
    --state-mobile-size: 100px;
  }

  .state-node-paused {
    --x: 32 !important;
    --y: 72 !important;
    --state-mobile-size: 96px;
  }

  .state-node-unstarted {
    --x: 73 !important;
    --y: 72 !important;
    --state-mobile-size: 82px;
  }

  .state-node strong {
    max-width: 92%;
    overflow: hidden;
    font-size: clamp(12px, 3.8vw, 15px);
    line-height: 1.08;
    text-overflow: ellipsis;
  }

  .state-node span {
    max-width: 92%;
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .state-map-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  .state-map-legend-item {
    min-height: 72px;
    padding: 10px;
    border: 1px solid rgba(238, 238, 232, 0.9);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
  }

  .state-map-legend-item span {
    display: none;
  }

  .content-map {
    min-height: 720px;
    border-radius: 16px;
  }

  .content-map.is-author {
    min-height: 760px;
  }

  .content-map.is-book {
    min-height: 740px;
  }

  .content-bubble {
    width: min(var(--bubble-size), 86px);
    height: min(var(--bubble-size), 86px);
    min-width: min(var(--bubble-size), 86px);
    min-height: min(var(--bubble-size), 86px);
    padding: 7px;
  }

  .content-map.is-author .content-bubble {
    width: min(var(--bubble-size), 76px);
    height: min(var(--bubble-size), 76px);
    min-width: min(var(--bubble-size), 76px);
    min-height: min(var(--bubble-size), 76px);
  }

  .content-bubble strong {
    max-width: 84%;
    font-size: clamp(10px, 3.2vw, 14px);
    line-height: 1.08;
    -webkit-line-clamp: 2;
  }

  .content-bubble span {
    max-width: 88%;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .content-bubble.is-minor,
  .content-bubble.is-compact {
    padding: 0;
  }

  .content-bubble.is-compact span {
    display: none;
  }

  .content-hub {
    width: 118px;
    height: 118px;
    opacity: 0.72;
  }

  .content-crumbs {
    gap: 8px;
  }

  .content-crumbs button,
  .content-crumbs span {
    min-height: 34px;
    padding: 0 12px;
  }

  .monthly-body,
  .monthly-metrics {
    grid-template-columns: 1fr;
  }

  .monthly-book-stack,
  .monthly-finished-books {
    grid-template-columns: 1fr;
  }

  .monthly-tools {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .monthly-tools select,
  .monthly-tools button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .state-map-canvas {
    min-height: 455px;
  }

  .state-node-finished {
    --state-mobile-size: 108px;
  }

  .state-node-active {
    --state-mobile-size: 94px;
  }

  .state-node-paused {
    --state-mobile-size: 88px;
  }

  .state-node-unstarted {
    --state-mobile-size: 76px;
  }

  .content-map {
    min-height: 740px;
  }

  .content-map.is-author {
    min-height: 790px;
  }
}

/* ===== Monetization: banner, license modal, key guide (20260726) ===== */
.monetize-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  margin: 0 0 18px;
  padding: 16px 20px;
  border: 1px solid rgba(91, 138, 122, 0.22);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(91, 138, 122, 0.10), rgba(255, 255, 255, 0.85) 55%);
  box-shadow: 0 10px 26px rgba(60, 80, 70, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.monetize-banner.is-preview {
  border-color: rgba(196, 148, 66, 0.32);
  background: linear-gradient(120deg, rgba(222, 178, 96, 0.14), rgba(255, 255, 255, 0.88) 55%);
}
.monetize-banner .banner-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.monetize-banner .banner-copy strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  color: #2C2C2C;
}
.monetize-banner .banner-copy span {
  color: #6E6E68;
  font-size: 13px;
  line-height: 1.5;
}
.monetize-banner .banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.banner-primary {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: #5B8A7A;
  color: #FFF8E8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(91, 138, 122, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.banner-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(91, 138, 122, 0.38);
}
.banner-ghost {
  padding: 10px 16px;
  border: 1px solid rgba(91, 138, 122, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #47705F;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.banner-ghost:hover {
  background: rgba(91, 138, 122, 0.08);
}

.lite-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lite-modal.is-open {
  display: flex;
}
.lite-modal .lite-modal-scrim {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(34, 40, 36, 0.46);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.lite-modal .lite-modal-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 28px 26px 24px;
  border-radius: 20px;
  background: #FBFAF6;
  box-shadow: 0 30px 70px rgba(30, 40, 34, 0.35);
}
.lite-modal .lite-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: #55554F;
  font-size: 19px;
  cursor: pointer;
}
.lite-modal .lite-modal-kicker {
  margin: 0 0 6px;
  color: #5B8A7A;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lite-modal h3 {
  margin: 0 0 14px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 24px;
  color: #2C2C2C;
}
.license-feature-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.license-feature-list li {
  position: relative;
  padding-left: 24px;
  color: #4A4A44;
  font-size: 14px;
  line-height: 1.55;
}
.license-feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #5B8A7A;
  font-weight: 700;
}
.license-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}
.license-price strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 34px;
  color: #C0653A;
}
.license-price s {
  color: #A8A8A2;
  font-size: 15px;
}
.license-price span {
  color: #8A8A86;
  font-size: 12px;
}
.license-buy-row {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(91, 138, 122, 0.08);
}
.license-buy-link {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: #C0653A;
  color: #FFF8E8;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.license-buy-hint {
  color: #6E6E68;
  font-size: 12.5px;
}
.license-activate-form {
  display: flex;
  gap: 8px;
}
.license-activate-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.license-activate-form input:focus {
  outline: 2px solid rgba(91, 138, 122, 0.4);
  border-color: transparent;
}
.license-activate-form button {
  padding: 11px 20px;
  border: none;
  border-radius: 12px;
  background: #5B8A7A;
  color: #FFF8E8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.license-activate-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.license-activate-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #47705F;
  font-size: 13px;
}
.license-activate-status.is-error {
  color: #B4472E;
}
.key-help-steps {
  margin: 0 0 14px;
  padding-left: 22px;
  display: grid;
  gap: 9px;
  color: #4A4A44;
  font-size: 14px;
  line-height: 1.6;
}
.key-help-tip {
  margin: 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(91, 138, 122, 0.08);
  color: #55705F;
  font-size: 12.5px;
  line-height: 1.55;
}
.license-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}
.license-status-text {
  color: #6E6E68;
  font-size: 12.5px;
}
.license-row.is-licensed .license-status-text {
  color: #47705F;
  font-weight: 700;
}
.license-buy-button {
  padding: 8px 15px;
  border: none;
  border-radius: 999px;
  background: #C0653A;
  color: #FFF8E8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.stats-lock-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin: 0 0 18px;
  padding: 16px 20px;
  border: 1px solid rgba(196, 148, 66, 0.3);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(222, 178, 96, 0.13), rgba(255, 255, 255, 0.9) 60%);
}
.stats-lock-card .lock-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.stats-lock-card .lock-copy strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15.5px;
  color: #2C2C2C;
}
.stats-lock-card .lock-copy span {
  color: #6E6E68;
  font-size: 13px;
  line-height: 1.5;
}
.stats-lock-card .lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.api-key-field input.is-invalid {
  border-color: rgba(180, 71, 46, 0.65);
  box-shadow: 0 0 0 2px rgba(180, 71, 46, 0.14);
}
.key-help-button {
  white-space: nowrap;
}
@media (max-width: 700px) {
  .monetize-banner,
  .stats-lock-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .monetize-banner .banner-actions,
  .stats-lock-card .lock-actions {
    justify-content: stretch;
  }
  .monetize-banner .banner-primary,
  .stats-lock-card .banner-primary {
    flex: 1;
  }
  .license-activate-form {
    flex-direction: column;
  }
}

/* ===== 2026-07-26 refresh: realistic spines, premium content map, era timeline ===== */

/* ---- 1. Book spines: deeper realism + stable swaps ---- */
.book-spine,
.book-spine.has-cover-fallback {
  border-radius: 1.5px 4px 1px 1px;
  background:
    /* 脊面圆弧光影：左侧沟槽高光 → 弧面亮部 → 右侧转角暗部 */
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.46) 0%,
      rgba(255, 255, 255, 0.05) 3.5%,
      rgba(255, 255, 255, 0.26) 9%,
      rgba(255, 255, 255, 0.10) 22%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(0, 0, 0, 0.10) 62%,
      rgba(0, 0, 0, 0.26) 84%,
      rgba(0, 0, 0, 0.48) 100%),
    /* 顶部书页口 + 底部落地阴影 */
    linear-gradient(180deg, rgba(255, 253, 244, 0.5) 0 1px, rgba(0, 0, 0, 0.14) 1px 2px, transparent 2px calc(100% - 3px), rgba(0, 0, 0, 0.28) calc(100% - 3px)),
    /* 布纹 */
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 4px),
    /* 纸纤维噪点 */
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 70% 62%, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 5px),
    /* 烫印色带 */
    linear-gradient(180deg,
      transparent 0 var(--spine-band-top),
      color-mix(in srgb, var(--spine-accent), #fff 18%) var(--spine-band-top) calc(var(--spine-band-top) + 1px),
      color-mix(in srgb, var(--spine-accent), transparent 12%) calc(var(--spine-band-top) + 1px) calc(var(--spine-band-top) + 3px),
      color-mix(in srgb, var(--spine-accent), #000 30%) calc(var(--spine-band-top) + 3px) calc(var(--spine-band-top) + 3.6px),
      transparent calc(var(--spine-band-top) + 3.6px) var(--spine-band-bottom),
      color-mix(in srgb, var(--spine-accent), transparent 26%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px),
      transparent calc(var(--spine-band-bottom) + 2px)),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-size: auto, auto, auto, auto, 7px 7px, 9px 9px, auto, auto;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, normal, normal;
  box-shadow:
    1.5px 0 0 rgba(0, 0, 0, 0.18),
    -1px 0 0 rgba(255, 255, 255, 0.14),
    3px 1px 6px rgba(39, 26, 15, 0.26),
    inset 1px 0 0 rgba(255, 255, 255, 0.24),
    inset 4px 0 7px rgba(255, 255, 255, 0.07),
    inset -6px 0 12px rgba(0, 0, 0, 0.36),
    inset 0 2px 1px rgba(255, 251, 240, 0.28),
    inset 0 -2px 2px rgba(0, 0, 0, 0.28);
}

.book-spine.has-cover-visual,
.book-spine.is-album.has-cover-visual,
.book-spine.is-collection.has-cover-visual {
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(255, 255, 255, 0.05) 3.5%,
      rgba(255, 255, 255, 0.28) 9%,
      rgba(255, 255, 255, 0.10) 22%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(0, 0, 0, 0.10) 62%,
      rgba(0, 0, 0, 0.24) 84%,
      rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(255, 253, 244, 0.46) 0 1px, rgba(0, 0, 0, 0.15) 1px 2px, transparent 2px calc(100% - 3px), rgba(0, 0, 0, 0.3) calc(100% - 3px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.038) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 74% 64%, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18)),
    linear-gradient(180deg,
      transparent 0 var(--spine-band-top),
      color-mix(in srgb, var(--spine-accent), #fff 18%) var(--spine-band-top) calc(var(--spine-band-top) + 1px),
      color-mix(in srgb, var(--spine-accent), transparent 10%) calc(var(--spine-band-top) + 1px) calc(var(--spine-band-top) + 3px),
      color-mix(in srgb, var(--spine-accent), #000 30%) calc(var(--spine-band-top) + 3px) calc(var(--spine-band-top) + 3.6px),
      transparent calc(var(--spine-band-top) + 3.6px) var(--spine-band-bottom),
      color-mix(in srgb, var(--spine-accent), transparent 26%) var(--spine-band-bottom) calc(var(--spine-band-bottom) + 2px),
      transparent calc(var(--spine-band-bottom) + 2px)),
    var(--spine-texture),
    linear-gradient(180deg, var(--spine-top), var(--spine-bottom));
  background-size: auto, auto, auto, auto, 7px 7px, 9px 9px, auto, auto, 100% 100%, auto;
  background-blend-mode: normal, normal, soft-light, multiply, soft-light, multiply, normal, normal, multiply, normal;
}

/* 封面分析完成后的换肤过渡：短促的亮度呼吸掩盖配色替换，不再生硬闪变 */
.book-spine.is-visual-swap {
  animation: spineVisualSwap 0.56s ease;
}

@keyframes spineVisualSwap {
  0% { filter: brightness(1) saturate(1); }
  35% { filter: brightness(1.12) saturate(0.86); }
  100% { filter: brightness(1) saturate(1); }
}

.book-spine:hover,
.book-spine:focus-visible {
  filter: brightness(1.05) saturate(1.05);
}

/* ---- 2. Content map: premium & fluid ---- */
.content-map {
  isolation: isolate;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 68% 54% at 50% 44%, rgba(91, 138, 122, 0.10), transparent 74%),
    radial-gradient(ellipse 40% 30% at 50% 46%, rgba(255, 255, 255, 0.5), transparent 70%),
    repeating-radial-gradient(circle at 50% 46%, rgba(91, 138, 122, 0.05) 0 1px, transparent 1px 68px),
    linear-gradient(180deg, #fbfaf6, #f4f2ec);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 60px rgba(101, 84, 60, 0.05),
    0 18px 40px rgba(60, 60, 50, 0.08);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.content-map.is-leaving {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}

.content-bubble {
  transition:
    transform 0.28s cubic-bezier(0.34, 1.3, 0.5, 1),
    box-shadow 0.28s ease,
    filter 0.28s ease;
  will-change: transform;
}

.content-bubble:not(.is-ghost) {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.06) 48%),
    radial-gradient(circle at 50% 118%, color-mix(in srgb, var(--bubble-accent), #000 22%), transparent 62%),
    color-mix(in srgb, var(--bubble-accent), #f6f4ee 12%);
  box-shadow:
    inset 0 1.5px 3px rgba(255, 255, 255, 0.55),
    inset 0 -4px 10px color-mix(in srgb, var(--bubble-accent), #000 40% ),
    0 10px 26px color-mix(in srgb, var(--bubble-accent), transparent 62%),
    0 2px 6px rgba(50, 45, 35, 0.16);
}

.content-bubble:not(.is-ghost):hover,
.content-bubble:not(.is-ghost):focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
  filter: saturate(1.1) brightness(1.04);
  box-shadow:
    inset 0 1.5px 3px rgba(255, 255, 255, 0.6),
    inset 0 -4px 10px color-mix(in srgb, var(--bubble-accent), #000 40%),
    0 0 0 5px color-mix(in srgb, var(--bubble-accent), transparent 82%),
    0 16px 36px color-mix(in srgb, var(--bubble-accent), transparent 52%),
    0 3px 8px rgba(50, 45, 35, 0.2);
  z-index: 6;
}

.content-bubble.is-primary:not(.is-ghost) {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -5px 13px color-mix(in srgb, var(--bubble-accent), #000 44%),
    0 0 0 7px color-mix(in srgb, var(--bubble-accent), transparent 88%),
    0 18px 44px color-mix(in srgb, var(--bubble-accent), transparent 52%),
    0 3px 8px rgba(50, 45, 35, 0.18);
}

.content-bubble.is-ghost {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0.32;
  filter: saturate(0.35);
}

.content-bubble.is-ghost:hover,
.content-bubble.is-ghost:focus-visible {
  opacity: 0.62;
  filter: saturate(0.7);
}

.content-links path {
  stroke: rgba(91, 138, 122, 0.16);
  stroke-dasharray: 0.6 1.8;
  stroke-width: 0.34;
}

.content-map-hint {
  margin: 12px 2px 0;
  color: #9a988f;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.content-crumbs button {
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* ---- 3. Era timeline: chronology rail ---- */
.era-card .stats-card-heading p {
  max-width: 320px;
}

.era-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 8px;
  padding-left: 4px;
}

.era-timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 14px;
  left: 9px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(91, 138, 122, 0.05), rgba(91, 138, 122, 0.3) 14%, rgba(91, 138, 122, 0.3) 86%, rgba(184, 178, 168, 0.16));
}

.era-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 0;
  padding: 14px 0 18px 26px;
  border: 0;
}

.era-row + .era-row {
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.era-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.era-marker {
  position: absolute;
  top: 21px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid #5b8a7a;
  background: #fbfaf6;
  box-shadow: 0 0 0 4px rgba(91, 138, 122, 0.12);
}

.era-row.is-unknown .era-marker {
  border-color: #b8b2a8;
  box-shadow: 0 0 0 4px rgba(184, 178, 168, 0.14);
}

.era-head strong {
  color: #2c2c2c;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.era-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(91, 138, 122, 0.1);
  color: #47705f;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.era-row.is-unknown .era-tag {
  background: rgba(184, 178, 168, 0.16);
  color: #8a8a86;
}

.era-head em {
  color: #9a988f;
  font-size: 12px;
  font-style: normal;
}

.era-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.era-authors::before {
  display: none;
}

.era-authors .era-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 9px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(60, 55, 45, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.era-authors .era-chip:hover,
.era-authors .era-chip:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--era-dot), transparent 40%);
  box-shadow:
    0 8px 18px rgba(60, 55, 45, 0.12),
    0 0 0 3px color-mix(in srgb, var(--era-dot), transparent 86%);
}

.era-chip-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--era-dot, #5b8a7a);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.22), 0 0 0 2.5px color-mix(in srgb, var(--era-dot, #5b8a7a), transparent 84%);
}

.era-authors .era-chip span {
  color: #2c2c2c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.era-authors .era-chip em {
  color: #9a988f;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.era-row.is-unknown .era-chip {
  opacity: 0.82;
}

.era-note {
  margin: 14px 2px 0;
  color: #9a988f;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .era-row {
    padding-left: 22px;
  }
  .era-head strong {
    font-size: 17px;
  }
  .era-authors {
    gap: 7px;
  }
  .era-authors .era-chip {
    padding: 6px 10px 6px 8px;
  }
}

/* ===== Packed content map (circle packing) ===== */
.content-map {
  height: var(--map-height, 560px);
  min-height: 0;
  transition: opacity 0.17s ease, transform 0.17s ease;
}

.content-map.is-leaving-down {
  opacity: 0;
  transform: scale(1.06);
}

.content-map.is-leaving-up {
  opacity: 0;
  transform: scale(0.94);
}

.content-map.is-enter-down {
  animation: contentMapEnterDown 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-map.is-enter-up {
  animation: contentMapEnterUp 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes contentMapEnterDown {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes contentMapEnterUp {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

/* 外圈气泡：上一层级的兄弟节点，保留本色但压暗降饱和，紧贴中心聚簇 */
.content-bubble.is-outer {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.04) 52%),
    color-mix(in srgb, var(--bubble-accent), #efece4 46%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -3px 7px color-mix(in srgb, var(--bubble-accent), #000 52%),
    0 4px 12px rgba(60, 55, 45, 0.1);
  opacity: 0.86;
  filter: saturate(0.72);
  z-index: 1;
}

.content-bubble.is-outer strong {
  font-size: clamp(10px, calc(var(--bubble-size) * 0.2), 13px);
  opacity: 0.85;
}

.content-bubble.is-outer span {
  font-size: 10px;
  opacity: 0.7;
}

.content-bubble.is-outer:hover,
.content-bubble.is-outer:focus-visible {
  opacity: 1;
  filter: saturate(1);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -3px 7px color-mix(in srgb, var(--bubble-accent), #000 48%),
    0 0 0 4px color-mix(in srgb, var(--bubble-accent), transparent 80%),
    0 10px 24px color-mix(in srgb, var(--bubble-accent), transparent 58%);
  z-index: 7;
}

.content-bubble.is-outer.is-minor strong,
.content-bubble.is-outer.is-minor span {
  display: none;
}

/* 中心聚簇气泡在外圈之上 */
.content-bubble:not(.is-outer):not(.is-ghost) {
  z-index: 3;
}

/* 堆积布局下字号随气泡大小缩放，小泡自动只显示圆点 */
.content-bubble strong {
  font-size: clamp(10.5px, calc(var(--bubble-size) * 0.17), 17px);
  line-height: 1.15;
}

.content-bubble span {
  font-size: clamp(9px, calc(var(--bubble-size) * 0.11), 12px);
}

.content-bubble.is-primary strong {
  font-size: clamp(13px, calc(var(--bubble-size) * 0.18), 21px);
}

@media (max-width: 720px) {
  .content-map {
    height: var(--map-height, 600px);
  }
}

/* ===== Content map v3: deep-ink plate & jewel glass bubbles ===== */
.content-map {
  border: 1px solid rgba(120, 160, 142, 0.18);
  border-radius: 24px;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 72% 58% at 50% 38%, rgba(111, 199, 163, 0.11), transparent 68%),
    radial-gradient(ellipse 46% 42% at 84% 92%, rgba(232, 183, 108, 0.08), transparent 70%),
    radial-gradient(ellipse 40% 36% at 10% 8%, rgba(130, 172, 224, 0.07), transparent 72%),
    repeating-radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, #1c2823, #131c18 56%, #0e1512);
  background-size: 200px 200px, auto, auto, auto, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 110px rgba(0, 0, 0, 0.46),
    0 26px 54px rgba(24, 34, 29, 0.30);
}

.content-map::before {
  display: none;
}

/* 主层气泡：宝石玻璃球 —— 顶部高光、球心透亮、底部深影、彩色辉光 */
.content-bubble:not(.is-ghost):not(.is-outer) {
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.03) 46%),
    radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--bubble-accent), #ffffff 6%) 0%, color-mix(in srgb, var(--bubble-accent), #0f1713 42%) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    inset 0 -6px 14px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px color-mix(in srgb, var(--bubble-accent), transparent 48%),
    0 0 24px color-mix(in srgb, var(--bubble-accent), transparent 70%),
    0 10px 24px rgba(0, 0, 0, 0.4);
}

.content-bubble:not(.is-ghost) strong {
  color: #f6f3ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.content-bubble:not(.is-ghost) span {
  color: rgba(246, 243, 234, 0.66);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.content-bubble:not(.is-ghost):not(.is-outer):hover,
.content-bubble:not(.is-ghost):not(.is-outer):focus-visible {
  filter: brightness(1.1) saturate(1.12);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -6px 14px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px color-mix(in srgb, var(--bubble-accent), transparent 30%),
    0 0 0 5px color-mix(in srgb, var(--bubble-accent), transparent 78%),
    0 0 42px color-mix(in srgb, var(--bubble-accent), transparent 56%),
    0 14px 30px rgba(0, 0, 0, 0.44);
}

.content-bubble.is-primary:not(.is-ghost):not(.is-outer) {
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.46),
    inset 0 -8px 18px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1.5px color-mix(in srgb, var(--bubble-accent), #fff 22%),
    0 0 0 7px color-mix(in srgb, var(--bubble-accent), transparent 86%),
    0 0 52px color-mix(in srgb, var(--bubble-accent), transparent 58%),
    0 14px 32px rgba(0, 0, 0, 0.46);
}

/* 外圈（上一层级）：暗色玻璃 + 本色描边，明显退后但保持身份色 */
.content-bubble.is-outer {
  --bubble-opacity: 0.94;
  opacity: var(--bubble-opacity);
  filter: none;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.12), transparent 52%),
    color-mix(in srgb, var(--bubble-accent), #121a16 70%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -3px 8px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px color-mix(in srgb, var(--bubble-accent), transparent 55%),
    0 5px 16px rgba(0, 0, 0, 0.34);
}

.content-bubble.is-outer strong {
  color: color-mix(in srgb, var(--bubble-accent), #fff 52%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.content-bubble.is-outer span {
  color: rgba(246, 243, 234, 0.4);
  opacity: 1;
}

.content-bubble.is-outer:hover,
.content-bubble.is-outer:focus-visible {
  opacity: 1;
  filter: none;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.2), transparent 52%),
    color-mix(in srgb, var(--bubble-accent), #121a16 44%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -3px 8px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1.5px color-mix(in srgb, var(--bubble-accent), transparent 26%),
    0 0 30px color-mix(in srgb, var(--bubble-accent), transparent 62%),
    0 8px 20px rgba(0, 0, 0, 0.4);
}

/* 小气泡退化为发光圆点 */
.content-bubble.is-minor strong,
.content-bubble.is-minor span {
  display: none;
}

.content-bubble.is-minor:not(.is-ghost):not(.is-outer) {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -2px 5px rgba(0, 0, 0, 0.35),
    0 0 12px color-mix(in srgb, var(--bubble-accent), transparent 58%);
}

/* 待确认类：低饱和银灰，不抢戏 */
.content-bubble.is-muted:not(.is-ghost) {
  filter: saturate(0.5);
  opacity: 0.8;
}

/* 面包屑改成图版风格的暗色药丸 */
.content-crumbs button,
.content-crumbs span {
  border: 1px solid rgba(91, 138, 122, 0.28);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(91, 138, 122, 0.08);
  color: #47705f;
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.content-crumbs button:hover {
  background: rgba(91, 138, 122, 0.16);
  box-shadow: 0 2px 8px rgba(91, 138, 122, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .content-map,
  .content-bubble {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Content map v4: warm paper atlas (回归全站纸面风格) ===== */
.content-map {
  border: 1px solid rgba(85, 70, 50, 0.10);
  border-radius: 24px;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 56% at 50% 42%, rgba(255, 255, 253, 0.85), transparent 72%),
    radial-gradient(ellipse 48% 40% at 86% 92%, rgba(181, 128, 58, 0.045), transparent 70%),
    radial-gradient(ellipse 40% 36% at 8% 8%, rgba(62, 132, 101, 0.05), transparent 72%),
    repeating-radial-gradient(circle at 50% 46%, rgba(85, 70, 50, 0.024) 0 1px, transparent 1px 76px),
    linear-gradient(180deg, #FCFAF4, #F3EFE5);
  background-size: 200px 200px, auto, auto, auto, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 70px rgba(101, 84, 60, 0.05),
    0 16px 38px rgba(90, 78, 60, 0.09);
}

/* 主层气泡：水彩色块 + 纸色描边缝隙（经典 circle packing 的纸上质感） */
.content-bubble:not(.is-ghost):not(.is-outer) {
  background:
    radial-gradient(circle at 33% 27%, color-mix(in srgb, var(--bubble-accent), #ffffff 30%), var(--bubble-accent) 58%, color-mix(in srgb, var(--bubble-accent), #2E2418 16%) 100%);
  box-shadow:
    0 0 0 2.5px #FBF8F1,
    inset 0 1px 2px rgba(255, 255, 255, 0.34),
    inset 0 -4px 10px rgba(46, 36, 24, 0.18),
    0 10px 22px color-mix(in srgb, var(--bubble-accent), transparent 68%),
    0 3px 7px rgba(90, 78, 60, 0.16);
}

.content-bubble:not(.is-ghost) strong {
  color: #FFFDF6;
  text-shadow: 0 1px 2px rgba(46, 36, 24, 0.4);
}

.content-bubble:not(.is-ghost) span {
  color: rgba(255, 253, 246, 0.85);
  text-shadow: 0 1px 2px rgba(46, 36, 24, 0.34);
}

.content-bubble:not(.is-ghost):not(.is-outer):hover,
.content-bubble:not(.is-ghost):not(.is-outer):focus-visible {
  filter: saturate(1.1) brightness(1.04);
  box-shadow:
    0 0 0 2.5px #FBF8F1,
    0 0 0 5.5px color-mix(in srgb, var(--bubble-accent), transparent 66%),
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -4px 10px rgba(46, 36, 24, 0.16),
    0 16px 32px color-mix(in srgb, var(--bubble-accent), transparent 58%),
    0 4px 9px rgba(90, 78, 60, 0.18);
}

.content-bubble.is-primary:not(.is-ghost):not(.is-outer) {
  box-shadow:
    0 0 0 2.5px #FBF8F1,
    0 0 0 6px color-mix(in srgb, var(--bubble-accent), transparent 62%),
    inset 0 2px 3px rgba(255, 255, 255, 0.38),
    inset 0 -5px 12px rgba(46, 36, 24, 0.2),
    0 16px 34px color-mix(in srgb, var(--bubble-accent), transparent 56%),
    0 4px 9px rgba(90, 78, 60, 0.18);
}

/* 外圈（上一层级）：淡彩纸片 —— 本色染纸、彩色细描边、深色文字，明确退后 */
.content-bubble.is-outer {
  --bubble-opacity: 1;
  opacity: 1;
  filter: none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.6), transparent 56%),
    color-mix(in srgb, var(--bubble-accent), #F8F4EA 72%);
  box-shadow:
    0 0 0 2.5px #FBF8F1,
    inset 0 0 0 1.2px color-mix(in srgb, var(--bubble-accent), transparent 46%),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 5px 12px rgba(90, 78, 60, 0.1);
}

.content-bubble.is-outer strong {
  color: color-mix(in srgb, var(--bubble-accent), #2E2418 42%);
  text-shadow: none;
  opacity: 1;
}

.content-bubble.is-outer span {
  color: color-mix(in srgb, var(--bubble-accent), #6E6E64 55%);
  text-shadow: none;
  opacity: 1;
}

.content-bubble.is-outer:hover,
.content-bubble.is-outer:focus-visible {
  opacity: 1;
  filter: none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55), transparent 56%),
    color-mix(in srgb, var(--bubble-accent), #F8F4EA 46%);
  box-shadow:
    0 0 0 2.5px #FBF8F1,
    0 0 0 5px color-mix(in srgb, var(--bubble-accent), transparent 76%),
    inset 0 0 0 1.2px color-mix(in srgb, var(--bubble-accent), transparent 30%),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 9px 20px rgba(90, 78, 60, 0.14);
}

.content-bubble.is-minor:not(.is-ghost):not(.is-outer) {
  box-shadow:
    0 0 0 2px #FBF8F1,
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(46, 36, 24, 0.18),
    0 4px 9px color-mix(in srgb, var(--bubble-accent), transparent 66%);
}

.content-bubble.is-muted:not(.is-ghost) {
  filter: saturate(0.55);
  opacity: 0.85;
}

/* ===== Content map v5: airy watercolor — 半透明、会呼吸的气泡 ===== */
.content-map {
  position: relative;
  overflow: hidden;
}

/* 底板上缓慢游移的色晕，让整个图版“活”起来 */
.content-map::before {
  content: "";
  display: block;
  position: absolute;
  inset: -12%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 24% 30%, rgba(62, 132, 101, 0.08), transparent 42%),
    radial-gradient(circle at 78% 68%, rgba(181, 128, 58, 0.07), transparent 44%),
    radial-gradient(circle at 60% 12%, rgba(70, 113, 159, 0.05), transparent 40%);
  animation: mapAuraDrift 24s ease-in-out infinite alternate;
}

@keyframes mapAuraDrift {
  from { transform: translate(-2.2%, -1.2%) scale(1); }
  to { transform: translate(2.2%, 2%) scale(1.07); }
}

/* 主层气泡：水彩晕染 —— 中心透光、边缘沉色、纸底隐约透出来，不再是实心色块 */
.content-bubble:not(.is-ghost):not(.is-outer) {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.2) 36%, transparent 60%),
    radial-gradient(circle at 70% 82%, color-mix(in srgb, var(--bubble-accent), #2E2418 22%), transparent 66%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bubble-accent), #ffffff 26%) 0%, color-mix(in srgb, var(--bubble-accent), transparent 4%) 74%, color-mix(in srgb, var(--bubble-accent), transparent 12%) 100%);
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    inset 0 -5px 12px rgba(46, 36, 24, 0.12),
    0 18px 34px -12px color-mix(in srgb, var(--bubble-accent), transparent 42%),
    0 3px 8px -2px rgba(90, 78, 60, 0.14);
}

/* 呼吸漂浮：入场动画结束后接管，每颗周期/方向不同 */
.content-map .content-bubble {
  animation:
    contentBubbleIn 0.6s cubic-bezier(0.34, 1.3, 0.5, 1) var(--bubble-delay, 0ms) both,
    bubbleBreathe var(--float-dur, 6.4s) ease-in-out var(--float-wait, 0.8s) infinite alternate;
}

@keyframes bubbleBreathe {
  from { transform: translate(-50%, -50%) translate(0, 0); }
  to { transform: translate(-50%, -50%) translate(var(--float-dx, 3px), var(--float-dy, -4px)); }
}

/* hover：停下呼吸，弹性放大 + 光环 */
.content-bubble:not(.is-ghost):hover,
.content-bubble:not(.is-ghost):focus-visible {
  animation: none;
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 8;
}

.content-bubble:not(.is-ghost):not(.is-outer):hover,
.content-bubble:not(.is-ghost):not(.is-outer):focus-visible {
  filter: saturate(1.12) brightness(1.03);
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.95),
    0 0 0 6px color-mix(in srgb, var(--bubble-accent), transparent 82%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 -5px 12px rgba(46, 36, 24, 0.1),
    0 24px 44px -12px color-mix(in srgb, var(--bubble-accent), transparent 34%),
    0 4px 10px -2px rgba(90, 78, 60, 0.16);
}

.content-bubble.is-primary:not(.is-ghost):not(.is-outer) {
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.95),
    0 0 0 6px color-mix(in srgb, var(--bubble-accent), transparent 78%),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    inset 0 -6px 14px rgba(46, 36, 24, 0.13),
    0 22px 42px -12px color-mix(in srgb, var(--bubble-accent), transparent 36%),
    0 4px 10px -2px rgba(90, 78, 60, 0.16);
}

/* 外圈：晨雾般的淡彩 —— 更透、更轻，漂得也更慢 */
.content-bubble.is-outer {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.3) 44%, transparent 66%),
    color-mix(in srgb, var(--bubble-accent), #FAF6EC 78%);
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.9),
    inset 0 0 0 1px color-mix(in srgb, var(--bubble-accent), transparent 58%),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 8px 18px -8px rgba(90, 78, 60, 0.18);
}

.content-map .content-bubble.is-outer {
  animation:
    contentBubbleIn 0.6s cubic-bezier(0.34, 1.3, 0.5, 1) var(--bubble-delay, 0ms) both,
    bubbleBreathe calc(var(--float-dur, 6.4s) * 1.5) ease-in-out var(--float-wait, 0.8s) infinite alternate;
}

.content-bubble.is-outer:hover,
.content-bubble.is-outer:focus-visible {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.24) 44%, transparent 66%),
    color-mix(in srgb, var(--bubble-accent), #FAF6EC 52%);
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.95),
    0 0 0 5px color-mix(in srgb, var(--bubble-accent), transparent 84%),
    inset 0 0 0 1px color-mix(in srgb, var(--bubble-accent), transparent 38%),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 12px 24px -8px rgba(90, 78, 60, 0.22);
}

/* 小圆点也跟着呼吸，但阴影更轻 */
.content-bubble.is-minor:not(.is-ghost):not(.is-outer) {
  box-shadow:
    0 0 0 1.5px rgba(252, 249, 242, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(46, 36, 24, 0.14),
    0 6px 14px -6px color-mix(in srgb, var(--bubble-accent), transparent 46%);
}

@media (prefers-reduced-motion: reduce) {
  .content-map::before,
  .content-map .content-bubble,
  .content-map .content-bubble.is-outer {
    animation: none !important;
  }
}
