* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(42px);
  opacity: .22;
  pointer-events: none;
}
body::before {
  width: 340px;
  height: 340px;
  left: -120px;
  top: 24vh;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  animation: floatA 11s ease-in-out infinite alternate;
}
body::after {
  width: 300px;
  height: 300px;
  right: -90px;
  top: 50vh;
  background: color-mix(in srgb, var(--accent-2) 66%, transparent);
  animation: floatB 13s ease-in-out infinite alternate;
}
@keyframes floatA {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-42px) translateX(24px); }
}
@keyframes floatB {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(36px) translateX(-20px); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.brand h1 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-size: 1.25rem;
}
.total-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .72em;
  font-weight: 700;
  vertical-align: middle;
  color: var(--muted);
  background: var(--paper-2);
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: relative;
}
.actions input,
.actions select,
.ghost-btn {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 10px;
}
.actions input {
  width: clamp(220px, 32vw, 360px);
  max-width: 100%;
}
.search-wrap {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
}
.controls-toggle {
  min-width: 96px;
  font-weight: 700;
}
body.controls-open .controls-toggle {
  background: color-mix(in srgb, var(--accent) 14%, var(--paper-2));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.controls-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 18px 34px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 8px;
}
.controls-panel[hidden] {
  display: none;
}
.controls-panel .ghost-btn,
.controls-panel select {
  width: 100%;
  justify-content: space-between;
}
.controls-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

/* First-load simplicity mode */
body.ui-simple .hero-showcase,
body.ui-simple .news-strip,
body.ui-simple .insights,
body.ui-simple .weekly-collection,
body.ui-simple .news-hub,
body.ui-simple .probar,
body.ui-simple .quick-filters,
body.ui-simple .category-rails,
body.ui-simple .shelf,
body.ui-simple .meta-panel {
  display: none !important;
}

.ghost-btn { cursor: pointer; }
.ghost-btn:hover { background: var(--paper-2); }
.ghost-btn.active {
  background: color-mix(in srgb, var(--accent) 18%, var(--paper-2));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) minmax(220px, 290px);
  gap: 16px;
  padding: 16px 14px;
  width: 100%;
  margin: 0;
  align-items: start;
}

.sidebar, .content {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  min-width: 0;
}

.sidebar {
  padding: 12px;
  position: sticky;
  top: 78px;
  height: auto;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sidebar h2, .content h2 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-size: 1rem;
}

.pill {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.pill.active {
  background: color-mix(in srgb, var(--accent) 18%, var(--paper-2));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.category-list {
  display: grid;
  gap: 7px;
}
.category-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.category-btn.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--paper-2));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}
.category-btn small { color: var(--muted); }

.stats {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: .88rem;
}

.content {
  padding: 12px;
  min-width: 0;
  overflow-x: hidden;
}
.probar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 10px;
}
.probar__group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.probar__group label {
  font-size: .82rem;
  color: var(--muted);
}
.probar__group select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 8px;
}
.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 12px;
}
.content-head__right {
  display: flex;
  align-items: center;
  gap: 8px;
}
#resultCount { color: var(--muted); font-size: .9rem; }
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.quick-filters button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  padding: 6px 10px;
  font-size: .8rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
body.view-list .grid {
  grid-template-columns: 1fr;
}
body.view-list .card {
  display: grid;
  grid-template-columns: minmax(96px, 110px) minmax(0, 1fr);
}
body.view-list .cover {
  aspect-ratio: 3/4;
}
body.density-compact .grid {
  gap: 8px;
}
body.density-compact .body {
  padding: 8px;
  gap: 4px;
}
body.density-compact .title {
  font-size: .88rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.cover {
  aspect-ratio: 3/4;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  padding: 6px;
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .28s ease;
}
.card:hover .cover img { transform: scale(1.03); }
.body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.title {
  font-family: "Literata", Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.32;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 3.1em;
}
.title > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.view-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: .58em;
  font-style: normal;
  font-weight: 700;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  background: color-mix(in srgb, var(--paper-2) 75%, transparent);
}
.badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.fav-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 3px 8px;
  cursor: pointer;
  font-size: .76rem;
}
.fav-btn.active {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 20%, var(--paper-2));
}
.row {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.row button,
.row a {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-2);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.row button:disabled,
.row a[aria-disabled="true"] {
  opacity: .56;
  cursor: not-allowed;
}
.file-warn {
  border: 1px dashed color-mix(in srgb, #d64b3b 60%, var(--line));
  background: color-mix(in srgb, #d64b3b 15%, var(--paper-2));
  color: color-mix(in srgb, #f6d9d5 85%, var(--ink));
  border-radius: 8px;
  padding: 6px 8px;
  font-size: .8rem;
}
.row button.primary {
  color: #fff;
}
.row button.primary:hover {
  filter: brightness(1.06);
}
.loadmore-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}
.loadmore-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
}
.loadmore-btn[hidden] { display: none; }
.shelf {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.shelf h3 {
  margin: 0 0 8px;
  font-family: "Literata", Georgia, serif;
  font-size: .96rem;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.mini-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 8px;
  display: grid;
  gap: 4px;
}
.mini-card__title {
  font-size: .82rem;
  line-height: 1.35;
}
.mini-card button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 6px;
  cursor: pointer;
}

.meta-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 12px;
  position: sticky;
  top: 78px;
  height: auto;
  max-height: calc(100vh - 96px);
  overflow: auto;
  min-width: 0;
}
.meta-panel h3 {
  margin: 0 0 10px;
  font-family: "Literata", Georgia, serif;
  font-size: 1rem;
}
.meta-panel__cover {
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 6px;
  margin-bottom: 10px;
}
.meta-panel__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.meta-panel__title {
  font-size: .92rem;
  font-family: "Literata", Georgia, serif;
  margin-bottom: 8px;
  line-height: 1.35;
}
.meta-panel__row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  align-items: start;
  padding: 5px 0;
}
.meta-panel__row span {
  color: var(--muted);
  font-size: .78rem;
}
.meta-panel__row strong {
  font-size: .82rem;
  word-break: break-word;
}
.meta-panel__actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.meta-panel__actions .ghost-btn {
  width: 100%;
}
.author-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.author-panel h4 {
  margin: 0 0 8px;
  font-family: "Literata", Georgia, serif;
  font-size: .9rem;
}
.author-books {
  display: grid;
  gap: 6px;
}
.author-books button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  font-size: .78rem;
  line-height: 1.35;
}
.author-books button.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--paper-2));
}
.author-books__more {
  color: var(--muted);
  font-size: .78rem;
  padding: 2px 2px 0;
}

.viewer {
  position: fixed;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  margin: 0;
  inset: 0;
}
.viewer::backdrop { background: rgba(0,0,0,.88); }
.viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 54px 10px 12px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.viewer-close-x {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.viewer-head h3 {
  margin: 0;
  font-size: .95rem;
  font-family: "Literata", Georgia, serif;
}
.viewer-head button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.viewer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.viewer-tools a,
.viewer-tools button,
.viewer-tools select,
.viewer-tools input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 8px;
  font-size: .8rem;
}
.viewer-tools a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.viewer-tools input {
  width: 64px;
}
.pdf-shell {
  width: 100%;
  height: calc(100vh - 58px);
  border: 0;
  display: grid;
  place-items: center;
  background: #111;
  overflow: auto;
  padding: 18px;
  position: relative;
}
.pdf-loading {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: .82rem;
  color: #ddd;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 5px 8px;
  display: none;
  z-index: 2;
}
.pdf-shell.is-loading .pdf-loading {
  display: inline-block;
}
#pdfCanvas {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  background: #fff;
}
body.viewer-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}
.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  display: grid;
  gap: 8px;
}
.toast {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 10px;
  font-size: .86rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
}
.toast-warn {
  border-color: color-mix(in srgb, #d64b3b 65%, var(--line));
}

@media (max-width: 1280px) {
  .layout { grid-template-columns: 1fr; }
  .topbar {
    flex-wrap: wrap;
  }
  .actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .meta-panel {
    position: static;
    height: auto;
  }
  .actions input { width: 52vw; }
  .controls-panel {
    left: 0;
    right: auto;
  }
}

/* Revitalized Identity Layer removed — superseded by V18 Theme Split */

/* V17 override removed — superseded by V18 Theme Split below.
   Theme-aware interactive states consolidated here. */

.ghost-btn:hover,
.category-btn:hover,
.quick-filters button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--paper-2));
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 34px rgba(0,0,0,.18);
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
}

.row button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong, var(--accent)));
  border-color: var(--accent);
}

.viewer-head {
  background: color-mix(in srgb, var(--paper-2) 92%, var(--accent) 8%);
  border-bottom-color: var(--line);
}

/* ===== V18 Theme Split Fix ===== */
body:not(.theme-dark) {
  --bg: #f2ecdf;
  --paper: #fff9ee;
  --paper-2: #f7edd9;
  --ink: #221a15;
  --muted: #6f5d49;
  --line: #d7bea0;
  --accent: #b74235;
  --accent-2: #247e5e;
  background:
    radial-gradient(1150px 520px at -10% -18%, rgba(183,66,53,.22), transparent 58%),
    radial-gradient(980px 420px at 112% -22%, rgba(36,126,94,.18), transparent 56%),
    linear-gradient(155deg, #f5ecdc 0%, #f2e8d7 55%, #f6efdf 100%);
}

body:not(.theme-dark) .topbar {
  background:
    linear-gradient(90deg, rgba(255,250,240,.92), rgba(250,242,227,.92)),
    repeating-linear-gradient(90deg, rgba(183,66,53,.06) 0 30px, rgba(36,126,94,.05) 30px 60px);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

body:not(.theme-dark) .sidebar,
body:not(.theme-dark) .content,
body:not(.theme-dark) .meta-panel {
  background: linear-gradient(180deg, rgba(255,250,240,.94), rgba(250,242,227,.96));
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--accent) 20%);
  box-shadow: 0 14px 24px rgba(92, 60, 31, .12);
}

body:not(.theme-dark) .actions input,
body:not(.theme-dark) .actions select,
body:not(.theme-dark) .ghost-btn,
body:not(.theme-dark) .row button,
body:not(.theme-dark) .row a,
body:not(.theme-dark) .category-btn,
body:not(.theme-dark) .pill,
body:not(.theme-dark) .loadmore-btn,
body:not(.theme-dark) .mini-card button {
  background: #fff7e9;
  color: #261d17;
  border-color: #ccb08e;
}

body:not(.theme-dark) .card {
  background: var(--paper);
  border-color: color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
}

body:not(.theme-dark) .card .cover {
  background: linear-gradient(145deg, #f5ece1, #eadcc7);
}

body.theme-dark {
  --bg: #0d1218;
  --paper: #151d26;
  --paper-2: #202a35;
  --ink: #f2f5f8;
  --muted: #aeb8c6;
  --line: #334355;
  --accent: #d64b3b;
  --accent-2: #2f9c75;
  background:
    radial-gradient(1200px 540px at -8% -20%, rgba(214,75,59,.32), transparent 58%),
    radial-gradient(1020px 460px at 112% -24%, rgba(47,156,117,.27), transparent 56%),
    linear-gradient(160deg, #0b1016 0%, #0e141c 48%, #121a24 100%);
}

body.theme-dark .topbar {
  background:
    linear-gradient(90deg, rgba(21,29,38,.92), rgba(32,42,53,.92)),
    repeating-linear-gradient(90deg, rgba(214,75,59,.08) 0 32px, rgba(47,156,117,.06) 32px 64px);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

body.theme-dark .sidebar,
body.theme-dark .content,
body.theme-dark .meta-panel {
  background: linear-gradient(180deg, rgba(21,29,38,.94), rgba(18,25,33,.96));
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--accent) 25%);
  box-shadow: 0 18px 34px rgba(0,0,0,.30);
}

body.theme-dark .actions input,
body.theme-dark .actions select,
body.theme-dark .ghost-btn,
body.theme-dark .row button,
body.theme-dark .row a,
body.theme-dark .category-btn,
body.theme-dark .pill,
body.theme-dark .loadmore-btn,
body.theme-dark .mini-card button {
  background: #1f2730;
  border-color: #3a4a5c;
  color: #eef3f8;
}

body.theme-dark .card {
  background: linear-gradient(180deg, #1a222c, #171e27);
  border-color: #3a4a5c;
}

body.theme-dark .card .cover {
  background: linear-gradient(145deg, #253240, #1b2531);
}

body.theme-dark .stats,
body.theme-dark #resultCount,
body.theme-dark .meta,
body.theme-dark .author-books__more,
body.theme-dark .probar__group label {
  color: #b8c4d3;
}

/* ===== V19 Editorial Structure ===== */
.hero-showcase {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  margin: 4px 0 12px;
}

.hero-lead-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 240px;
}

.hero-lead-card__cover {
  background: var(--paper-2);
}

.hero-lead-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-lead-card__body {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.hero-lead-card__tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  font-size: .76rem;
  color: var(--muted);
}

.hero-lead-card__body h3 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  line-height: 1.34;
}

.hero-lead-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.hero-lead-card__actions {
  display: flex;
  gap: 8px;
}

.hero-lead-card__actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.hero-lead-card__actions button[data-action="read"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.hero-side {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.hero-side h3 {
  margin: 2px 0 10px;
  font-family: "Literata", Georgia, serif;
  font-size: 1rem;
}

.featured-list {
  display: grid;
  gap: 7px;
}

.featured-list__item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  cursor: pointer;
}

.featured-list__item small {
  color: var(--muted);
  font-size: .76rem;
}

.news-strip {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
}

.news-strip span {
  display: inline-block;
  padding-right: 22px;
  font-size: .82rem;
  color: var(--muted);
  animation: stripMove 38s linear infinite;
}

@keyframes stripMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-120%); }
}

.category-rails {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
}

.cat-rail {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
}

.cat-rail__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 8px;
}

.cat-rail__head h3 {
  margin: 0;
  font-size: .95rem;
  font-family: "Literata", Georgia, serif;
}

.cat-rail__head button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: .78rem;
  padding: 6px 9px;
  cursor: pointer;
}

.cat-rail__track {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.cat-rail__book {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.cat-rail__book img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #111;
  display: block;
  transition: transform .28s ease;
}
.cat-rail__book:hover img { transform: scale(1.07); }

.cat-rail__book span {
  display: block;
  padding: 8px;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
}

body.theme-dark .news-strip {
  background: rgba(21, 29, 38, .7);
}

body:not(.theme-dark) .news-strip {
  background: rgba(255, 246, 231, .86);
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cat-rail__track {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .hero-showcase {
    grid-template-columns: 1fr;
  }
  .hero-lead-card {
    grid-template-columns: 130px 1fr;
    min-height: 190px;
  }
  .cat-rail__track {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* ===== V20 Slider + Insights + Weekly ===== */
.hero-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-nav {
  display: inline-flex;
  gap: 6px;
}

.hero-nav button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.hero-side__meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
}

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

.insight-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.insight-card h3 {
  margin: 0 0 8px;
  font-family: "Literata", Georgia, serif;
  font-size: .95rem;
}

.insight-list {
  display: grid;
  gap: 6px;
}

.insight-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 7px 9px;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.insight-item small {
  color: var(--muted);
  font-size: .74rem;
}

.weekly-collection {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 10px;
}

.weekly-collection__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.weekly-collection__head h3 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-size: .98rem;
}

.weekly-collection__head span {
  font-size: .78rem;
  color: var(--muted);
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.weekly-book {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.weekly-book img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #111;
  display: block;
  transition: transform .28s ease;
}
.weekly-book:hover img { transform: scale(1.07); }

.weekly-book span {
  display: block;
  padding: 8px;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
}

#pdfCanvas.turn-next {
  animation: pageTurnNext .32s ease;
  transform-origin: left center;
}

#pdfCanvas.turn-prev {
  animation: pageTurnPrev .32s ease;
  transform-origin: right center;
}

@keyframes pageTurnNext {
  0% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
  45% { transform: perspective(1200px) rotateY(-12deg); opacity: .68; }
  100% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
}

@keyframes pageTurnPrev {
  0% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
  45% { transform: perspective(1200px) rotateY(12deg); opacity: .68; }
  100% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
}

@media (max-width: 1200px) {
  .insights {
    grid-template-columns: 1fr;
  }
  .weekly-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

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

/* V30 final override: categories on top */
.layout {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px) !important;
  grid-template-areas:
    "sidebar sidebar"
    "content meta" !important;
  align-items: start;
}

.sidebar {
  grid-area: sidebar;
  position: static !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 10px 12px;
}

.content { grid-area: content; }
.meta-panel { grid-area: meta; }

.category-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.category-btn {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  align-items: center;
}

.category-btn span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  font-size: 1rem;
  font-weight: 600;
}

.stats { display: none !important; }

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "sidebar"
      "content"
      "meta" !important;
  }
  .category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.ui-simple .layout {
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "sidebar"
    "content" !important;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* V39 UX + mobile + color system pass */
:root {
  --accent: #b51f2e;
  --accent-2: #1a6a4d;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--paper-2));
  --accent-strong: color-mix(in srgb, var(--accent) 62%, #000);
}

.discover-toggle {
  margin: 0 0 10px;
  width: 100%;
  justify-content: center;
  font-weight: 700;
}
.discover-section {
  display: grid;
  gap: 10px;
}
.discover-section.is-collapsed {
  display: none;
}

.overview-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--paper) 88%, transparent), color-mix(in srgb, var(--paper-2) 94%, transparent)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 16%, transparent), transparent 38%);
  box-shadow: 0 18px 38px rgba(0,0,0,.08);
  display: grid;
  gap: 14px;
}
.overview-panel__head,
.overview-panel__foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  flex-wrap: wrap;
}
.overview-panel__eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .7rem;
  font-weight: 800;
}
.overview-panel h3 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-size: 1.18rem;
}
.overview-status {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
}
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.overview-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: color-mix(in srgb, var(--paper) 82%, var(--paper-2));
  display: grid;
  gap: 6px;
}
.overview-stat__label,
.overview-panel__label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.overview-stat__value {
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 800;
  color: var(--ink);
}
.overview-stat__note {
  color: var(--muted);
  font-size: .82rem;
}
.overview-summary {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: .96rem;
  line-height: 1.55;
  max-width: 68ch;
}
.overview-chips,
.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.overview-chip,
.overview-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  font-size: .84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.overview-chip {
  background: color-mix(in srgb, var(--paper-2) 78%, var(--paper));
}
.overview-chip.is-muted {
  color: var(--muted);
}
.overview-action {
  cursor: pointer;
  font-weight: 700;
  transition: transform .16s ease, border-color .2s ease, background .2s ease;
}
.overview-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
}

.news-hub {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 10px;
  background: var(--paper);
}
.news-hub__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.news-hub__head h3 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-size: .95rem;
}
.news-hub__head small {
  color: var(--muted);
  font-size: .76rem;
}
.news-hub__list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}
.news-hub__item {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 8px 9px;
  display: grid;
  gap: 2px;
}
.news-hub__item small {
  color: var(--muted);
  font-size: .74rem;
}

.quick-filters {
  gap: 8px;
}
.quick-filters button {
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-weight: 650;
}
.quick-filters button.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.title {
  font-size: 1.02rem;
  min-height: 2.7em;
  line-height: 1.3;
}
.meta {
  font-size: .9rem;
  color: color-mix(in srgb, var(--muted) 90%, var(--ink) 10%);
}
.row a,
.row button {
  font-size: .92rem;
}
.card .row {
  opacity: .9;
  transition: opacity .18s ease, transform .18s ease;
}
.card:hover .row,
.card:focus-within .row {
  opacity: 1;
  transform: translateY(-1px);
}
.brand h1 {
  font-size: 1.28rem;
}

.row button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong);
}

.pdf-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  z-index: 2;
}
.pdf-progress__bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s ease;
}
.pdf-preview {
  position: absolute;
  max-width: calc(100% - 36px);
  max-height: calc(100% - 56px);
  opacity: 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: opacity .18s ease;
  z-index: 1;
  pointer-events: none;
}
.pdf-preview.is-visible {
  opacity: 1;
}

.viewer-body {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 58px);
}
.viewer-sidebar {
  border-left: 1px solid var(--line);
  background: var(--paper-2);
  padding: 10px;
  overflow: auto;
  display: none;
}
.viewer[open].with-sidebar .viewer-body {
  grid-template-columns: 1fr 300px;
}
.viewer[open].with-sidebar .viewer-sidebar {
  display: block;
}
.viewer-sidebar h4 {
  margin: 0 0 8px;
  font-family: "Literata", Georgia, serif;
  font-size: .92rem;
}
.viewer-sidebar__section {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}
.viewer-sidebar__section h5 {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}
.viewer-sidebar__list {
  display: grid;
  gap: 6px;
}
.viewer-sidebar__list button {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px;
  cursor: pointer;
  font-size: .82rem;
}
.ocr-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .74rem;
  line-height: 1.45;
}

.command-palette {
  width: min(760px, 96vw);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}
.command-palette::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.command-palette__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.command-palette__head input,
.command-palette__head button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 0 10px;
}
.command-results {
  max-height: min(60vh, 460px);
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}
.command-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.command-item small {
  color: var(--muted);
  font-size: .76rem;
}

@media (max-width: 980px) {
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-panel {
    padding: 12px;
  }
  .overview-summary {
    font-size: .9rem;
  }
  .controls-panel {
    width: 100%;
    left: 0;
    right: 0;
  }
  .controls-toggle {
    min-width: 88px;
  }
  .viewer[open].with-sidebar .viewer-body {
    grid-template-columns: 1fr;
  }
  .viewer[open].with-sidebar .viewer-sidebar {
    display: none;
  }
  .viewer-head {
    padding: 8px 44px 8px 8px;
  }
  .viewer-tools {
    gap: 4px;
  }
  .viewer-tools a,
  .viewer-tools button,
  .viewer-tools select,
  .viewer-tools input {
    height: 30px;
    font-size: .72rem;
    padding: 0 6px;
  }
  .viewer-tools input {
    width: 48px;
  }
  .viewer-head h3 {
    font-size: .82rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--paper-2);
  display: grid;
  gap: 10px;
}
.empty-state h3 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
}
.empty-state p {
  margin: 0;
  color: var(--muted);
}
.empty-state__actions,
.empty-state__suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.empty-state button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 7px 11px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .category-list {
    display: flex !important;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .category-btn {
    min-width: 220px;
    min-height: 44px;
    border-radius: 999px;
    justify-content: center;
    scroll-snap-align: start;
  }
  .category-btn span {
    -webkit-line-clamp: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .overview-stats {
    grid-template-columns: 1fr;
  }
  .overview-status {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .overview-action,
  .overview-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ===== V50 Modern Polish Layer ===== */

html {
  scroll-behavior: smooth;
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus {
  top: 0;
}

.topbar {
  transition: box-shadow .3s ease;
}
.topbar.is-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

.actions input {
  transition: border-color .2s ease, box-shadow .2s ease;
}
.actions input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.ghost-btn,
.category-btn,
.pill,
.loadmore-btn,
.row button,
.row a,
.mini-card button,
.fav-btn {
  transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.ghost-btn:active,
.category-btn:active,
.pill:active,
.row button:active,
.fav-btn:active {
  transform: scale(.97);
}

.card {
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease, border-color .25s ease;
}

.card.card-enter {
  opacity: 0;
  transform: translateY(24px);
}
.card.card-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .45s cubic-bezier(.4,0,.2,1), transform .45s cubic-bezier(.4,0,.2,1);
}

.scroll-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background .2s ease, color .2s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  display: grid;
  place-items: center;
}
.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  padding: 32px 18px 28px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
}
.site-footer__inner {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.site-footer__brand {
  font-family: "Literata", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.site-footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.site-footer__links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease;
}
.site-footer__links a:hover {
  text-decoration: underline;
}
.site-footer__copy {
  font-size: .78rem;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.site-footer__kbd {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .78rem;
  margin-top: 4px;
}
.site-footer__kbd kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .74rem;
}

.toast {
  animation: toastSlideIn .32s cubic-bezier(.4,0,.2,1);
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.news-hub__item {
  transition: border-color .2s ease, background .2s ease;
}
.news-hub__item:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--paper-2));
}

.insight-item {
  transition: border-color .2s ease, transform .15s ease;
}
.insight-item:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
}

.featured-list__item {
  transition: border-color .2s ease, background .2s ease;
}
.featured-list__item:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
}

.mini-card {
  transition: border-color .2s ease, box-shadow .2s ease;
}
.mini-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.command-item {
  transition: background .15s ease, border-color .15s ease;
}
.command-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.viewer-close-x {
  transition: background .2s ease, transform .2s ease;
}
.viewer-close-x:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

.loadmore-btn {
  position: relative;
  overflow: hidden;
}
.loadmore-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  transform: translateX(-100%);
  transition: transform .4s ease;
}
.loadmore-btn:hover::after {
  transform: translateX(100%);
}

.brand h1 {
  background: linear-gradient(135deg, var(--ink) 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand h1 .total-badge {
  -webkit-text-fill-color: var(--muted);
  background: var(--paper-2);
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}

body.theme-dark .brand h1 {
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.theme-dark .brand h1 .total-badge {
  -webkit-text-fill-color: var(--muted);
}

@media (max-width: 980px) {
  .scroll-top-btn {
    right: 14px;
    bottom: 68px;
    width: 42px;
    height: 42px;
  }
  .site-footer {
    padding: 24px 14px 80px;
  }
}

/* ===== V60 Professional Features ===== */

/* --- Search Wrap + Autocomplete --- */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap__icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.search-wrap input {
  padding-left: 32px;
  padding-right: 32px;
}
.search-wrap__clear {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  display: none;
  place-items: center;
}
.search-wrap__clear.is-visible {
  display: grid;
}
.search-wrap__clear:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-height: 420px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  z-index: 200;
  padding: 6px;
  display: grid;
  gap: 2px;
}
.search-dropdown[hidden] { display: none; }

.search-dropdown__item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s ease;
}
.search-dropdown__item:hover,
.search-dropdown__item.is-active {
  background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
}
.search-dropdown__item img {
  width: 40px;
  height: 53px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper-2);
}
.search-dropdown__info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.search-dropdown__title {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown__meta {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown__empty {
  padding: 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.search-dropdown__hint {
  padding: 6px 8px;
  font-size: .72rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}

/* --- Icon Button --- */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  padding: 0;
}
.icon-btn svg {
  display: block;
}

/* --- Skeleton Loading --- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.skeleton-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}
.skeleton-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(90deg, var(--paper-2) 25%, color-mix(in srgb, var(--paper-2) 50%, var(--paper)) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
.skeleton-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--paper-2) 25%, color-mix(in srgb, var(--paper-2) 50%, var(--paper)) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
.skeleton-line:nth-child(2) { width: 65%; }
.skeleton-line:nth-child(3) { width: 45%; height: 12px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Card Reading Progress --- */
.card-progress {
  height: 3px;
  background: var(--line);
  border-radius: 0 0 2px 2px;
  overflow: hidden;
  margin-top: auto;
}
.card-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width .3s ease;
}
.card-progress__label {
  font-size: .68rem;
  color: var(--muted);
  padding: 2px 0 0;
}

/* --- Mobile Bottom Nav --- */
.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
    box-shadow: 0 -4px 16px rgba(0,0,0,.1);
  }
  .mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: .64rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 8px;
    transition: color .15s ease;
    min-width: 56px;
  }
  .mobile-nav__item.active,
  .mobile-nav__item:hover {
    color: var(--accent);
  }
  .mobile-nav__item svg {
    display: block;
  }

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

  .search-dropdown {
    min-width: 0;
    left: -60px;
    right: -10px;
    max-height: 60vh;
  }
}

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

/* V61 Simplified Editorial Pass */
.editorial-card .badge-row {
  justify-content: space-between;
  align-items: center;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 96px);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
  color: color-mix(in srgb, var(--ink) 86%, var(--accent));
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editorial-card .fav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: .8rem;
  font-weight: 700;
}

.editorial-card .fav-btn.active {
  color: var(--accent);
  background: transparent;
  border: none;
}

.card-open-meta {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.editorial-card .title {
  min-height: auto;
}

.editorial-card .meta {
  min-height: 0;
}

.editorial-card .row {
  gap: 0;
}

.editorial-card .row button.primary {
  width: 100%;
}

body.ui-simple .layout {
  gap: 12px;
  padding-top: 12px;
}

body.ui-simple .sidebar {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.ui-simple .sidebar-head {
  margin: 0 0 8px;
  padding: 0 2px;
}

body.ui-simple .sidebar-head h2 {
  font-family: "Manrope", system-ui, sans-serif;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

body.ui-simple .sidebar-head .pill {
  padding: 8px 12px;
  font-weight: 700;
}

body.ui-simple .category-list {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scroll-snap-type: x proximity;
}

body.ui-simple .category-btn {
  width: auto;
  min-width: max-content;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 65%, var(--paper-2));
  flex: 0 0 auto;
  box-shadow: none;
  align-items: center;
  scroll-snap-align: start;
}

body.ui-simple .category-btn span {
  display: block;
  -webkit-line-clamp: 1;
  white-space: nowrap;
  font-size: .92rem;
  line-height: 1;
}

body.ui-simple .category-btn small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

body.ui-simple .content {
  border-radius: 18px;
  padding: 14px;
}

body.ui-simple .overview-panel {
  padding: 14px 16px;
  box-shadow: 0 12px 26px rgba(0,0,0,.07);
}

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

body.ui-simple .overview-stat:nth-child(n+3) {
  display: none;
}

body.ui-simple .content-head {
  padding: 8px 2px 14px;
  margin-top: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

body.ui-simple .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
}

body.ui-simple.view-list .grid {
  grid-template-columns: 1fr;
}

body.ui-simple .editorial-card {
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-simple .editorial-card:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

body.ui-simple .editorial-card .cover {
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 96%, transparent), color-mix(in srgb, var(--paper-2) 95%, transparent));
  box-shadow: 0 14px 28px rgba(0,0,0,.08);
  margin-bottom: 12px;
}

body.ui-simple .editorial-card .body {
  padding: 0 2px 8px;
  gap: 8px;
}

body.ui-simple .editorial-card .title {
  font-size: 1.08rem;
  line-height: 1.38;
}

body.ui-simple .editorial-card .meta {
  font-size: .88rem;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink) 12%);
}

body.ui-simple .editorial-card .row {
  padding-top: 4px;
}

body.ui-simple .editorial-card .row button.primary {
  border-radius: 12px;
  padding: 12px 14px;
}

body.ui-simple .editorial-card .card-progress {
  height: 4px;
  margin-top: 2px;
  border-radius: 999px;
}

body.ui-simple .editorial-card .card-progress__label {
  font-size: .72rem;
}

@media (max-width: 860px) {
  body.ui-simple .grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

/* V70 Calibre Focus */
body.ui-simple {
  --bg: #f3efe7;
  --paper: #fbf9f5;
  --paper-2: #f1ece4;
  --ink: #23201c;
  --muted: #6f6559;
  --line: #d8cec0;
  --accent: #7a4f22;
  --accent-2: #475f6f;
  background:
    radial-gradient(1200px 520px at -10% -25%, rgba(122,79,34,.1), transparent 58%),
    radial-gradient(900px 460px at 110% -30%, rgba(71,95,111,.09), transparent 55%),
    linear-gradient(180deg, #f6f2ea 0%, #f2ece3 100%);
}

body.ui-simple .discover-toggle,
body.ui-simple #discoverSection,
body.ui-simple #overviewPanel,
body.ui-simple #newsHub,
body.ui-simple .probar,
body.ui-simple .quick-filters,
body.ui-simple .category-rails,
body.ui-simple .shelf,
body.ui-simple #metaPanel {
  display: none !important;
}

body.ui-simple .layout {
  grid-template-columns: 280px minmax(0, 1fr) !important;
  grid-template-areas: "sidebar content" !important;
  gap: 14px;
  padding: 14px;
}

body.ui-simple .sidebar {
  grid-area: sidebar;
  position: sticky !important;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(249,245,238,.86));
}

body.ui-simple .content {
  grid-area: content;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(251,248,242,.9));
  padding: 14px;
}

body.ui-simple .sidebar-head h2 {
  font-family: "Literata", Georgia, serif;
  font-size: .95rem;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--ink);
}

body.ui-simple .category-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px;
  overflow: visible;
  padding: 0;
}

body.ui-simple .category-btn {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  padding: 10px 12px;
  justify-content: space-between;
  background: rgba(255,255,255,.7);
}

body.ui-simple .category-btn span {
  white-space: normal;
  font-size: .88rem;
  line-height: 1.25;
}

body.ui-simple .category-btn small {
  min-width: 24px;
  padding: 3px 6px;
  font-size: .68rem;
  background: var(--paper);
}

body.ui-simple .content-head {
  padding: 2px 2px 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

body.ui-simple #contentTitle {
  font-family: "Literata", Georgia, serif;
  font-size: 1.08rem;
}

body.ui-simple.view-list .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.ui-simple .editorial-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,.78);
  box-shadow: none !important;
  transform: none !important;
}

body.ui-simple .editorial-card .cover {
  aspect-ratio: 3/4;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  padding: 4px;
  margin: 0;
  box-shadow: none;
}

body.ui-simple .editorial-card .body {
  padding: 0;
  gap: 4px;
}

body.ui-simple .editorial-card .badge-row {
  gap: 8px;
}

body.ui-simple .card-kicker {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .67rem;
  letter-spacing: .06em;
  padding: 0;
  text-transform: uppercase;
}

body.ui-simple .editorial-card .title {
  min-height: 0;
  font-size: .97rem;
  line-height: 1.35;
}

body.ui-simple .editorial-card .meta {
  min-height: 0;
  font-size: .83rem;
}

body.ui-simple .card-open-meta {
  font-size: .68rem;
}

body.ui-simple .editorial-card .fav-btn {
  font-size: .72rem;
}

body.ui-simple .editorial-card .row {
  margin-top: 2px;
  padding-top: 0;
}

body.ui-simple .editorial-card .row button.primary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .82rem;
  font-weight: 700;
}

body.ui-simple .loadmore-wrap {
  padding-top: 10px;
}

body.ui-simple .loadmore-btn {
  border-radius: 8px;
  font-weight: 700;
}

@media (max-width: 980px) {
  body.ui-simple .layout {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "sidebar"
      "content" !important;
  }

  body.ui-simple .sidebar {
    position: static !important;
    max-height: none;
  }

  body.ui-simple .category-list {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body.ui-simple .category-btn {
    min-width: 200px;
    width: auto;
    flex: 0 0 auto;
  }

  body.ui-simple .editorial-card {
    grid-template-columns: 60px minmax(0, 1fr);
  }
}

/* V71 Ultra Minimal Surface */
body.ui-simple::before,
body.ui-simple::after {
  display: none !important;
}

body.ui-simple .topbar {
  padding: 10px 14px;
  gap: 10px;
  border-bottom-color: color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(6px);
}

body.ui-simple .brand h1 {
  font-size: 1.03rem;
  background: none;
  -webkit-text-fill-color: var(--ink);
  color: var(--ink);
}

body.ui-simple .brand p,
body.ui-simple .total-badge,
body.ui-simple #controlsToggleBtn,
body.ui-simple #controlsPanel,
body.ui-simple .mobile-nav,
body.ui-simple .site-footer__kbd {
  display: none !important;
}

body.ui-simple .actions {
  margin-left: auto;
}

body.ui-simple .search-wrap input {
  width: min(64vw, 420px);
  height: 36px;
  border-radius: 8px;
  font-size: .9rem;
}

body.ui-simple .category-btn,
body.ui-simple .editorial-card,
body.ui-simple .editorial-card .row button.primary,
body.ui-simple .loadmore-btn,
body.ui-simple .pill {
  transition: none !important;
  animation: none !important;
}

body.ui-simple .editorial-card:hover {
  box-shadow: none !important;
  transform: none !important;
}

body.ui-simple .site-footer {
  padding: 18px 14px 20px;
  background: transparent;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

body.ui-simple .site-footer__inner {
  gap: 8px;
}

body.ui-simple .site-footer p {
  font-size: .79rem;
  line-height: 1.45;
}

body.ui-simple .scroll-top-btn {
  width: 38px;
  height: 38px;
}

@media (max-width: 980px) {
  body.ui-simple .topbar {
    padding: 10px;
  }

  body.ui-simple .search-wrap {
    flex: 1 1 100%;
  }

  body.ui-simple .search-wrap input {
    width: 100%;
  }

  body.ui-simple .content {
    padding: 10px;
  }
}

/* V72 Calibre Row Layout */
body.ui-simple .editorial-card {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
}

body.ui-simple .editorial-card .cover {
  padding: 3px;
  border-radius: 6px;
}

body.ui-simple .editorial-card .body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  grid-template-areas:
    "title actions"
    "author actions"
    "meta opens";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
}

body.ui-simple .editorial-card .ed-title {
  grid-area: title;
  font-size: .95rem;
  line-height: 1.25;
  font-weight: 700;
}

body.ui-simple .editorial-card .ed-author {
  grid-area: author;
  font-size: .8rem;
  color: var(--muted);
}

body.ui-simple .editorial-card .ed-catfav {
  grid-area: meta;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.ui-simple .editorial-card .ed-opens {
  grid-area: opens;
  justify-self: end;
  font-size: .66rem;
}

body.ui-simple .editorial-card .ed-actions {
  grid-area: actions;
  margin: 0;
  padding: 0;
  justify-self: end;
  width: 132px;
}

body.ui-simple .editorial-card .ed-actions button.primary {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: .78rem;
  border-radius: 7px;
}

body.ui-simple .editorial-card .card-kicker {
  font-size: .62rem;
  letter-spacing: .05em;
}

body.ui-simple .editorial-card .fav-btn {
  font-size: .7rem;
  opacity: .86;
}

body.ui-simple .editorial-card .card-progress,
body.ui-simple .editorial-card .card-progress__label {
  display: none;
}

@media (max-width: 980px) {
  body.ui-simple .editorial-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
  }

  body.ui-simple .editorial-card .body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "author"
      "meta"
      "actions";
    row-gap: 5px;
  }

  body.ui-simple .editorial-card .ed-actions {
    width: 100%;
    justify-self: stretch;
  }

  body.ui-simple .editorial-card .ed-opens {
    display: none;
  }
}

/* V73 Reading-First Simplification */
body.ui-simple .layout {
  grid-template-columns: 1fr;
  max-width: 1320px;
  margin: 0 auto;
  gap: 10px;
  padding: 12px;
}

body.ui-simple .sidebar {
  position: static;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

body.ui-simple .sidebar-head {
  margin: 0 0 8px;
  padding: 0 2px;
}

body.ui-simple .sidebar-head h2 {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

body.ui-simple .stats,
body.ui-simple #clearFiltersBtn {
  display: none;
}

body.ui-simple .category-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

body.ui-simple .category-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 170px;
  padding: 8px 10px;
  border-radius: 999px;
}

body.ui-simple .category-btn span {
  font-size: .8rem;
  font-weight: 700;
}

body.ui-simple .content {
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 10px;
  padding: 10px;
}

body.ui-simple .content-head {
  padding: 2px 2px 10px;
}

body.ui-simple .editorial-card .card-kicker,
body.ui-simple .editorial-card .fav-btn,
body.ui-simple .editorial-card .ed-opens,
body.ui-simple .editorial-card .ed-actions a,
body.ui-simple .editorial-card .ed-actions button:not(.primary),
body.ui-simple .editorial-card .row a,
body.ui-simple .editorial-card .row button:not(.primary) {
  display: none !important;
}

body.ui-simple .editorial-card .ed-actions {
  width: 118px;
}

body.ui-simple .editorial-card .ed-actions button.primary {
  height: 30px;
  font-size: .75rem;
}

@media (max-width: 980px) {
  body.ui-simple .layout {
    padding: 10px;
    gap: 8px;
  }

  body.ui-simple .category-btn {
    min-width: 156px;
  }
}

/* V74 Modern Editorial Polish */
body.ui-simple {
  --paper: #fcfaf6;
  --paper-2: #f4efe6;
  --line: #d8cdbb;
}

body.ui-simple .topbar {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(252,248,241,.92));
}

body.ui-simple .brand h1 {
  font-size: 1.06rem;
  letter-spacing: .01em;
}

body.ui-simple .search-wrap input {
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

body.ui-simple .category-btn {
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(248,243,234,.92));
  box-shadow: 0 1px 0 rgba(255,255,255,.55);
}

body.ui-simple .category-btn.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: linear-gradient(180deg, rgba(255,249,239,.96), rgba(246,236,223,.95));
}

body.ui-simple .editorial-card {
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(250,245,236,.92));
  box-shadow: 0 3px 10px rgba(38, 28, 18, .05);
}

body.ui-simple .editorial-card .ed-title {
  font-size: .98rem;
  line-height: 1.28;
}

body.ui-simple .editorial-card .ed-author {
  font-size: .78rem;
  opacity: .92;
}

body.ui-simple .editorial-card .ed-actions button.primary {
  border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line));
  background: linear-gradient(180deg, #faf5ed, #f0e4d4);
  color: #3e2a18;
  font-weight: 800;
  letter-spacing: .02em;
}

body.ui-simple .editorial-card .ed-actions button.primary:hover {
  filter: brightness(1.02);
}

/* ===== V75 Search + Simplicity ===== */
#resultCount,
.view-pill,
.category-btn small,
.total-badge {
  display: none !important;
}

.category-btn {
  justify-content: flex-start;
  gap: 0;
}

.search-wrap {
  border-radius: 12px;
  overflow: clip;
}

.search-wrap input {
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.search-dropdown {
  max-height: min(62vh, 440px);
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
}

.search-dropdown__title {
  font-size: 0.92rem;
  line-height: 1.3;
}

.search-dropdown__meta {
  font-size: 0.78rem;
}

.stats {
  font-size: 0.84rem;
}
