/* Limes Cineris Mod Review — Curated Warm-Paper Editorial Gallery (Stitch Design System) */
:root {
  --paper: #f6f2ea;
  --surface: #fffdf8;
  --linen: #efe9dc;
  --ink: #1e1915;
  --muted: #5b4f44;
  --caption: #807265;
  --line: #ddd3c4;
  --soft: #e9e0d2;
  --umber: #2e2019;
  --blue: #284b73;
  --blue-soft: #e7eef6;
  --ember: #a84420;
  --amber: #fce09b;
  --wash: #e8f1ee;
  --error-bg: #fee4e2;
  --error-ink: #b42318;
  --ok-bg: #e3f2ea;
  --ok-ink: #255b44;
  --shadow-sm: 0 2px 10px rgba(30, 25, 21, 0.05);
  --shadow-md: 0 8px 24px rgba(30, 25, 21, 0.08);
  --shadow-pop: 0 12px 32px rgba(30, 25, 21, 0.13);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 9999px;
  --gutter: clamp(14px, 2vw, 24px);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --ui: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15.5px/1.64 var(--ui);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

button, select, input, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure { margin: 0; }
p + p { margin-top: 0.6em; }
code { overflow-wrap: anywhere; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 650;
  line-height: 1.18;
  color: var(--ink);
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(28px, 4.2vw, 48px); letter-spacing: -0.015em; }
h2 { font-size: clamp(20px, 2.5vw, 26px); line-height: 1.24; }
h3 { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.28; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -6rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.55rem 0.85rem;
  z-index: 40;
  text-decoration: none;
}
.skip:focus { top: 0.6rem; }

/* Grid & Containers */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  max-width: 1280px;
  margin-inline: auto;
  width: calc(100% - 2 * clamp(16px, 3vw, 40px));
}
.grid > * { min-width: 0; }
.wide, .intro, .catalog-head { grid-column: span 12; }

main.grid {
  padding-top: clamp(22px, 3vw, 36px);
  padding-bottom: 3.5rem;
  align-items: start;
}

/* Sticky Frosted Masthead */
.site {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(246, 242, 234, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.mast {
  align-items: center;
  min-height: 60px;
  font-size: 14px;
}

.brand {
  grid-column: 1 / span 6;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--ember);
  flex: none;
}
.brand strong { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.brand span { color: var(--caption); font-weight: 400; }
.brand small { font-size: 13.5px; color: var(--muted); font-weight: 500; }

.account {
  grid-column: 7 / span 6;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.account form { margin: 0; }

.identity {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 3px 10px 3px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 14rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity:hover { border-color: var(--blue); background: #fff; }

.nav-pill, .nav-link, .nav-ghost, .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-pill, .nav-link {
  color: var(--muted);
  border: 1px solid transparent;
}
.nav-pill:hover, .nav-link:hover {
  color: var(--ink);
  background: var(--linen);
}

.nav-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.nav-ghost:hover {
  color: var(--ink);
  border-color: var(--caption);
  background: var(--surface);
}

.nav-cta {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.nav-cta:hover { background: #1f3c5d; }

/* 10 Distinct Editorial Topic Accents */
[data-tone="0"] { --tone-bg: #e6f0ec; --tone-accent: #266153; --tone-pill: #d3e6df; }
[data-tone="1"] { --tone-bg: #e8ecf6; --tone-accent: #2e4984; --tone-pill: #d7e0f2; }
[data-tone="2"] { --tone-bg: #f5e8e6; --tone-accent: #8c3b38; --tone-pill: #ecd5d2; }
[data-tone="3"] { --tone-bg: #e8f0e5; --tone-accent: #385e33; --tone-pill: #d6e5d0; }
[data-tone="4"] { --tone-bg: #f7efe0; --tone-accent: #8a5a19; --tone-pill: #efe0c2; }
[data-tone="5"] { --tone-bg: #f4e9dd; --tone-accent: #7d4b26; --tone-pill: #e9d7c4; }
[data-tone="6"] { --tone-bg: #f2e5eb; --tone-accent: #7a2e4d; --tone-pill: #e8d0db; }
[data-tone="7"] { --tone-bg: #eaecee; --tone-accent: #455563; --tone-pill: #d8dde2; }
[data-tone="8"] { --tone-bg: #e5f0f5; --tone-accent: #225d78; --tone-pill: #d0e5ef; }
[data-tone="9"] { --tone-bg: #edeae4; --tone-accent: #544e46; --tone-pill: #dfdad0; }

.eyeline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--caption);
}

/* Home Hero & Featured Showcase */
.hero-band {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 10px;
}

.intro .eyeline {
  color: var(--ember);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.intro h1 {
  margin: 0.14em 0 0.18em;
}
.intro > p:last-child {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 44rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  width: 100%;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--tone-accent, var(--blue)) 45%, var(--line));
}

.feature-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.feature-media {
  position: relative;
  background: var(--linen);
  border-bottom: 1px solid var(--soft);
}
.feature .cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}
.feature .cover figcaption {
  display: none;
}

.topic-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 92%, var(--tone-pill));
  color: var(--tone-accent, var(--ink));
  border: 1px solid color-mix(in srgb, var(--tone-accent, var(--line)) 25%, transparent);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.topic-badge.inline-badge {
  position: static;
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
}

.feature-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.feature-body h2 {
  margin: 6px 0 8px;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--ink);
}
.feature:hover .feature-body h2 { color: var(--tone-accent, var(--blue)); }
.feature-lead {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.feature-cta {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tone-accent, var(--blue));
}

/* Filter & Topic Studio */
.catalog-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 76px;
}

.catalog-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.catalog-top h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(19px, 2.2vw, 24px);
}

.count-pill {
  font: 600 12.5px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--linen);
  color: var(--muted);
  border: 1px solid var(--line);
}

.catalog-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) auto;
  gap: 10px;
  flex: 1 1 440px;
  max-width: 640px;
  align-items: center;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--soft);
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--tone-accent, var(--muted));
  background: var(--tone-bg, var(--linen));
  border: 1px solid color-mix(in srgb, var(--tone-accent, var(--line)) 22%, transparent);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topic-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone-accent, var(--caption));
  flex: none;
}
.topic-pill:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--tone-accent, var(--ink)) 50%, transparent);
}
.topic-pill[aria-current="true"] {
  background: var(--tone-accent, var(--umber));
  color: #fff;
  border-color: transparent;
}
.topic-pill[aria-current="true"] i {
  background: #fff;
}

/* Catalog Grid & Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}

.entry {
  --entry-tint: var(--tone-bg, var(--linen));
  --entry-strong: var(--tone-accent, var(--umber));
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--entry-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--entry-strong) 45%, var(--line));
}

.entry a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: color-mix(in srgb, var(--entry-strong) 10%, var(--entry-tint));
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--soft);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.thumb.icon {
  background: linear-gradient(135deg, var(--entry-tint), #fffdf8);
}
.thumb.icon img {
  height: 64%;
  width: auto;
  max-width: 68%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(30, 25, 21, 0.12));
}
.thumb span {
  position: absolute;
  left: 10px;
  bottom: 9px;
  color: #fff;
  background: rgba(30, 25, 21, 0.78);
  backdrop-filter: blur(4px);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
}
.thumb.empty strong {
  font: 600 clamp(26px, 4vw, 38px)/1 var(--serif);
  color: var(--entry-strong);
  letter-spacing: 0.04em;
  opacity: 0.78;
}
.thumb.unavailable::before {
  content: "▧";
  color: var(--entry-strong);
  font-size: 2rem;
  opacity: 0.6;
}

.entry-text {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}
.entry-text .eyeline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--entry-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.topic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--entry-strong);
  flex: none;
}
.entry-text h3 {
  font-size: 18px;
  color: var(--ink);
}
.entry:hover .entry-text h3 {
  color: var(--entry-strong);
}
.entry-use {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}
.entry-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.entry-text .state {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--entry-strong);
  background: var(--entry-tint);
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.entry-arrow {
  font-size: 14px;
  color: var(--caption);
  transition: transform 0.15s ease, color 0.15s ease;
}
.entry:hover .entry-arrow {
  transform: translateX(3px);
  color: var(--entry-strong);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

/* Pagination */
.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.page-btn:hover:not(.disabled) {
  border-color: var(--blue);
  color: var(--blue);
}
.page-btn.disabled {
  opacity: 0.45;
  cursor: default;
}
.page-status {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding: 0 6px;
}

/* Chapter Detail Page */
.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.back-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.15s ease;
}
.back-pill:hover { border-color: var(--blue); color: var(--blue); }
.chapter-meta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--linen);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: var(--r-pill);
}

.chapter-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2.5vw, 28px);
  box-shadow: var(--shadow-sm);
}

.hero-art {
  grid-column: span 6;
}
.hero-art img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--linen);
  border-radius: var(--r-md);
  border: 1px solid var(--soft);
}
.hero-art img[src^="data:"] {
  max-height: 290px;
  image-rendering: pixelated;
}

.chapter-title {
  grid-column: span 6;
}
.chapter-title.prose {
  grid-column: span 12;
  max-width: 780px;
}
.chapter-title h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0.16em 0 0.22em;
  display: inline;
  vertical-align: middle;
}
.chapter-title h1 + .note-marker {
  margin-left: 8px;
}
.chapter-title > p:not(.eyeline) { margin-top: 10px; }
.chapter-title > p,
.draft,
.subcard > p {
  overflow-wrap: anywhere;
}
.subcard > p:not(.eyeline) { margin-top: 8px; }

figcaption {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  align-items: baseline;
  color: var(--caption);
  font-size: 12.5px;
  margin-top: 6px;
}

.takeaways {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.takeaways li {
  border-top: 1px solid var(--soft);
  padding: 8px 0;
  font-size: 14.5px;
}
.takeaways li:last-child {
  border-bottom: 1px solid var(--soft);
}

.opinion, .decision {
  background: #f3ede1;
  border-left: 3px solid var(--umber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 14.5px;
}
.opinion strong, .decision strong {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--umber);
  margin-bottom: 4px;
}

.chapter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px;
}
.chapter-quick a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.chapter-quick a:hover { background: #dbe6f3; }

.official-row {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* Accordion Folds & Subcards */
.fold {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 76px;
}

.fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 18px;
  color: var(--ink);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "▾";
  font-size: 14px;
  color: var(--caption);
  transition: transform 0.16s ease;
}
.fold[open] > summary::after { transform: rotate(180deg); }
.fold[open] > summary { padding-bottom: 12px; border-bottom: 1px solid var(--soft); }

.subgrid {
  width: 100%;
  margin-top: 14px;
  align-items: start;
}

.subcard {
  grid-column: span 6;
  padding: 16px 18px;
  background: #fffcf6;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  scroll-margin-top: 76px;
  overflow-wrap: anywhere;
}
.subcard h3 {
  display: inline;
  vertical-align: middle;
}
.subcard h3 + .note-marker { margin-left: 6px; }

.editor-note {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.editor-note summary {
  font-weight: 600;
  color: var(--umber);
}
.editor-note .decision { margin: 8px 0 0; }

.source-link {
  margin-top: 10px;
  font-size: 13px;
}

.media {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.small-art {
  grid-column: span 6;
  min-width: 0;
}
.small-art img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--linen);
  border-radius: var(--r-sm);
  border: 1px solid var(--soft);
}
.small-art img[src^="data:"] {
  image-rendering: pixelated;
  max-height: 112px;
}

.capture-art { grid-column: span 4; }
.capture-art:only-child { grid-column: span 6; }
.capture-art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--soft);
}

.clip-screen {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: #232a30;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 8px;
}
.clip-play {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--r-pill);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}
.clip-play:hover { background: #fff; }
.clip-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.clip-credit {
  font-size: 12.5px;
  color: var(--caption);
  margin-top: 8px;
}
.clip-credit a { margin-inline-start: 0.4em; }

.registry {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 14px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.registry li {
  grid-column: span 4;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--soft);
  padding: 6px 0;
  font-size: 13.5px;
}
.draft { margin: 10px 0; }
.draft > h3 { margin: 14px 0 4px; }

/* Micro-Avatar Pins & Lightweight Frosted Comment Popover */
.note-marker {
  display: inline-flex;
  vertical-align: middle;
  margin: 2px 4px 2px 0;
}

.note-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 24px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-pill);
  padding: 2px 5px;
  color: var(--muted);
  transition: background 0.14s ease, border-color 0.14s ease;
}
.note-pin.new {
  min-width: 24px;
  line-height: 1;
  font-size: 14px;
  color: var(--caption);
}
.note-pin:is(:hover, :focus-visible) {
  background: var(--linen);
  border-color: var(--line);
  color: var(--ink);
}

.face {
  display: inline-grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e3c8af;
  color: #4a2e20;
  overflow: hidden;
  flex: none;
  text-align: center;
  vertical-align: middle;
  font-weight: 650;
}
.face img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.face.tiny { width: 24px; font-size: 11.5px; }
.face.micro { width: 20px; font-size: 10.5px; }
.face.preview { width: 64px; font-size: 20px; }

.note-pin .face + .face {
  margin-left: -6px;
  border: 1.5px solid var(--surface);
}
.extra-faces { font-size: 11px; color: var(--muted); margin-left: 2px; }

.drawer {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(20.5rem, calc(100vw - 16px));
  max-height: min(23rem, 58svh);
  overflow: hidden;
  padding: 0;
  border: 1px solid #dfd4c3;
  border-radius: var(--r-lg);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  grid-template-rows: auto minmax(0, 1fr);
  z-index: 25;
  font-size: 13px;
}
.drawer[open] { display: grid; }

.drawer-head {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px 6px 12px;
  border-bottom: 1px solid var(--soft);
  background: rgba(246, 242, 234, 0.55);
}
.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.drawer-head h2 {
  font: 600 13px/1.3 var(--ui);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--linen);
  color: var(--muted);
  flex: none;
}
.close-note {
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  color: var(--muted);
  min-width: 26px;
  min-height: 26px;
  font-size: 18px;
  line-height: 1;
}
.close-note:hover { background: var(--linen); color: var(--ink); }

.drawer-scroll {
  overflow: auto;
  padding: 6px 10px 10px;
}

.notes-list { list-style: none; padding: 0; margin: 0; }

.note {
  border: 0;
  border-left: 2px solid transparent;
  border-radius: var(--r-sm);
  text-align: left;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.note:hover { background: rgba(239, 233, 220, 0.6); }
.note[aria-pressed="true"] {
  background: #fbf0da;
  border-left-color: var(--ember);
}

.note-copy { min-width: 0; line-height: 1.38; overflow-wrap: anywhere; }
.note-copy > * { display: block; }
.note-author { font-size: 12px; }
.note-author time { font-size: 11px; color: var(--caption); margin-left: 4px; font-variant-numeric: tabular-nums; }
.note-target, .note-quote, [data-picked], .note-empty, .drawer-guest {
  font-size: 11.5px;
  color: var(--caption);
}
.note-target, .note-quote, [data-picked] { margin: 2px 0; }
.note-quote, [data-picked] {
  display: block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding: 2px 6px;
  border-left: 2px solid var(--amber);
  background: rgba(252, 224, 155, 0.28);
  border-radius: 0 3px 3px 0;
  color: var(--muted);
}
.note-body { white-space: pre-wrap; margin-top: 3px; color: var(--ink); }
.note-empty, .drawer-guest { padding: 6px 4px; }

.composer {
  border-top: 1px solid var(--soft);
  margin-top: 6px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
}
.composer q { grid-column: 1 / -1; }
.composer textarea {
  font-size: 12.5px;
  padding: 6px 8px;
  border-color: var(--line);
  min-height: 36px;
}

.send-note {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
}
.send-note:hover { background: #1f3c5d; }

.selection-note {
  position: fixed;
  z-index: 26;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--umber);
  color: #fffdf8;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  box-shadow: 0 4px 14px rgba(30, 25, 21, 0.25);
  white-space: nowrap;
  touch-action: manipulation;
}
.selection-note:hover { background: #1e1410; }

.annotation-current {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
  background: #fff0c7;
  border-radius: 4px;
}

::highlight(review-note) {
  background: var(--amber);
  color: var(--ink);
}

.range-paint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}
.range-paint i {
  display: block;
  position: absolute;
  background: rgba(252, 224, 155, 0.65);
  border-radius: 2px;
}

/* Auth, Profile & Onboarding Access Cards */
.access {
  grid-column: 3 / span 8;
  max-width: 560px;
  width: 100%;
  justify-self: center;
}

.access-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-sm);
}

.access-head { margin-bottom: 16px; }
.access-head h1 { font-size: clamp(24px, 3.2vw, 34px); margin: 6px 0 6px; }
.access-tip { color: var(--muted); font-size: 14.5px; }

.stack { display: grid; gap: 13px; }
.stack label, .catalog-head label { display: grid; gap: 5px; font-size: 14px; font-weight: 500; }
.field-hint { font-size: 12px; font-weight: 400; color: var(--caption); }

.primary {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--r-md);
  min-height: 40px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.primary:hover { background: #1f3c5d; }
.access-card .stack .primary { width: 100%; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 8px 11px;
  min-width: 0;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
}
textarea { resize: vertical; }

.stack .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
}
.remember input { width: auto; }

.avatar-upload {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}
.avatar-upload label { min-width: 0; flex: 1; font-size: 13.5px; }
.avatar-upload small { font-size: 12px; color: var(--caption); font-weight: 400; }

.profile-current {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--paper);
  border-radius: var(--r-md);
}

.access-switch {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--soft);
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.error {
  background: var(--error-bg);
  color: var(--error-ink);
  border-left: 3px solid var(--error-ink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 8px 12px;
  margin: 8px 0 12px;
  font-size: 13.5px;
}

.notice {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-left: 3px solid var(--ok-ink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 8px 12px;
  margin: 8px 0 12px;
  font-size: 13.5px;
}

/* Onboarding Tutorial Stage */
.onboarding { max-width: 680px; }

.lesson-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--linen);
  border-radius: var(--r-pill);
  margin-bottom: 14px;
}
.comment-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 14px;
}
.comment-toggle[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.lesson {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: 12px;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  min-height: 176px;
}
.lesson-page, .lesson-drawer {
  display: grid;
  align-content: start;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 11px 12px;
  position: relative;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.lesson-page small { font-size: 11.5px; color: var(--caption); }
.lesson-page span:not(.demo-pointer), .lesson-drawer span { font-size: 13px; }
.lesson-drawer { animation: lesson-drawer 5s ease infinite; }
.lesson-page > span:not(.demo-pointer) {
  animation: lesson-highlight 5s ease infinite;
  padding: 2px 4px;
  border-radius: 3px;
}
.demo-pointer {
  position: absolute;
  right: 14%;
  bottom: 18%;
  width: 26px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ember);
  font-size: 14px;
  animation: lesson-pointer 5s ease infinite;
}
.lesson[data-mode="mobile"] {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  max-width: 260px;
  margin-inline: auto;
  min-height: 210px;
}
.lesson[data-mode="mobile"] .lesson-drawer { margin-top: -2px; }

.lesson-steps {
  margin: 16px 0 18px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14.5px;
}
.lesson-steps li { padding: 4px 0; }

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
}
.tutorial-go {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@keyframes lesson-pointer {
  0%, 15% { transform: translate(1.5em, 0.9em); opacity: 0; }
  35%, 65% { transform: none; opacity: 1; }
  90%, 100% { opacity: 0; }
}
@keyframes lesson-highlight {
  0%, 29%, 96%, 100% { background: transparent; }
  38%, 85% { background: var(--amber); }
}
@keyframes lesson-drawer {
  0%, 32% { transform: translateY(1.1em); opacity: 0.25; }
  51%, 88% { transform: none; opacity: 1; }
  100% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .lesson * { animation: none !important; }
  .demo-pointer { display: none; }
  .lesson-page span:not(.demo-pointer) { background: var(--amber); }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .feature-grid, .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .brand { grid-column: span 5; }
  .account { grid-column: span 7; gap: 6px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-art, .chapter-title, .chapter-title.prose, .subcard, .access { grid-column: span 12; }
  .access { max-width: 100%; }
  .registry li { grid-column: span 6; }
  .capture-art, .capture-art:only-child { grid-column: span 12; }
}

@media (max-width: 520px) {
  .brand small, .brand span { display: none; }
  .catalog-form { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .registry li { grid-column: span 12; }
  .small-art { grid-column: span 12; }
  .avatar-upload { align-items: start; }
}

@media (pointer: coarse) {
  .note-pin, .selection-note, .close-note, .send-note { min-height: 34px; }
}
