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

:root {
  --bg:             #080808;
  --surface:        #0f0f0f;
  --surface-hi:     #151515;
  --surface-hover:  #1a1a1a;
  --border:         #1c1c1c;
  --border-hi:      #2a2a2a;
  --text:           #c8c8c8;
  --text-dim:       #6a6a6a;
  --text-muted:     #3a3a3a;
  --green:          #00e676;
  --green-dim:      #0d2b1a;
  --green-glow:     rgba(0,230,118,0.08);
  --amber:          #ffa726;
  --amber-dim:      #2a1e0a;
  --red:            #ef5350;
  --blue:           #42a5f5;
  --font:           'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --radius:         2px;
  --transition:     120ms ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#root {
  height: 100%;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Utilities ── */
.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;
}

/* ── Buttons ── */
button {
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  color: var(--text-dim);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: border-color var(--transition), color var(--transition);
}
.btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.btn-primary {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}
.btn-primary:hover {
  background: rgba(0,230,118,0.15);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: var(--surface-hover);
}

/* ── Inputs ── */
input, textarea, select {
  font-family: var(--font);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 8px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--green);
}
textarea { resize: vertical; min-height: 72px; }
select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a6a6a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

/* ── Category badge ── */
.cat-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: var(--radius);
  border: 1px solid;
  white-space: nowrap;
}
.cat-biography   { color: #ffa726; border-color: #3d2a0a; background: #1e150500; }
.cat-economics   { color: #66bb6a; border-color: #1a3d1a; background: transparent; }
.cat-fiction     { color: #42a5f5; border-color: #0a1f3d; background: transparent; }
.cat-general     { color: #6a6a6a; border-color: #2a2a2a; background: transparent; }
.cat-philosophy  { color: #ab47bc; border-color: #2a0a3d; background: transparent; }
.cat-politics    { color: #ef5350; border-color: #3d0a0a; background: transparent; }
.cat-psychology  { color: #26c6da; border-color: #0a2a3d; background: transparent; }
.cat-religion    { color: #ff8a65; border-color: #3d1a0a; background: transparent; }
.cat-science     { color: #29b6f6; border-color: #0a2a3a; background: transparent; }
.cat-self-help   { color: #f06292; border-color: #3d0a1f; background: transparent; }
.cat-technology  { color: #7c83f7; border-color: #1a1a4a; background: transparent; }

/* ── Animations ── */
@keyframes bookFloat {
  0%, 100% { transform: translateY(0px) rotate(-1.2deg); }
  50%       { transform: translateY(-16px) rotate(1.2deg); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}
@keyframes scanSweep {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(1200%); opacity: 0; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Status pill ── */
.status-pill {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--radius);
  font-weight: 500;
  border: 1px solid;
}
.status-want_to_read { color: var(--text-dim); border-color: var(--border-hi); }
.status-reading      { color: var(--amber); border-color: var(--amber-dim); background: var(--amber-dim); }
.status-read         { color: var(--green); border-color: var(--green-dim); background: var(--green-dim); }

/* Reader aliases. The library chrome below is the Mac app, not a separate theme. */
:root {
  --ink: var(--text);
  --ink-soft: var(--text-dim);
  --ink-faint: var(--text-muted);
  --ground: var(--bg);
  --line: var(--border);
  --line-strong: var(--border-hi);
  --gold: var(--green);
  --gold-dark: var(--green-dim);
  --danger: var(--red);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --surface-raised: var(--surface-hi);
  --font-reading: var(--font);
  --font-ui: var(--font);
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }

.app-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar {
  flex-shrink: 0; padding: 9px 20px; display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.logo { display: flex; align-items: baseline; gap: 8px; margin-right: 4px; }
.logo-mark { color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.logo-count { color: var(--text-muted); font-size: 10px; }
.stat-pills { display: flex; gap: 12px; font-size: 10px; }
.stat-read { color: var(--green); }
.stat-reading { color: var(--amber); }
.stat-want { color: var(--text-muted); }
.topbar-spacer { flex: 1; }
.topbar-search { width: 220px; flex: none; }
.topbar-search input { width: 220px; }
.chip-row, .view-toggle { display: flex; gap: 4px; }
.chip, .icon-btn, .view-toggle a {
  padding: 3px 9px; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text-muted); font-size: 10px; letter-spacing: .04em; white-space: nowrap;
}
.chip.on { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.view-toggle { gap: 2px; padding: 2px; }
.view-toggle a { padding: 3px 7px; border: 0; font-size: 14px; line-height: 1; }
.view-toggle a.on { background: var(--surface-hover); color: var(--green); }
.view-toggle a.kanban.on { color: var(--amber); }
.icon-btn { padding: 4px 10px; font-size: 13px; }
.category-bar {
  flex-shrink: 0; padding: 5px 20px; display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--border); background: var(--surface); scrollbar-width: none;
}
.category-bar .chip { flex-shrink: 0; }
.format-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 7px 20px;
  border-bottom: 1px solid var(--border); background: oklch(11% .005 145);
}
.format-bar > span { margin-right: 10px; color: oklch(54% .01 145); font-size: 9px; letter-spacing: .12em; }
.format-bar .chip { color: oklch(63% .01 145); }
.format-bar .chip.on { color: var(--green); }
.format-bar .chip span { color: inherit; opacity: .7; }
.catalog-preview-note {
  padding: 9px 20px; border-bottom: 1px solid oklch(37% .055 75);
  background: oklch(19% .025 75); color: oklch(81% .025 75); font-size: 11px;
}
.catalog-preview-note span { margin-right: 12px; color: oklch(89% .1 75); font-size: 9px; letter-spacing: .12em; }
.edition-label {
  display: inline-block; color: oklch(75% .08 75); font-size: 9px;
  font-style: normal; font-weight: 600; letter-spacing: .09em;
}
.link-corner {
  position: absolute; right: 0; bottom: 0; padding: 3px 5px;
  background: oklch(24% .025 75); color: oklch(85% .07 75);
  font-size: 8px; font-style: normal; letter-spacing: .08em;
}

.featured {
  position: relative; flex-shrink: 0; overflow: hidden; min-height: 200px;
  display: flex; align-items: center; gap: 32px; padding: 28px 24px;
  border-bottom: 1px solid var(--border); background: var(--surface); animation: fadeSlideIn 400ms ease both;
}
.featured::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px); background-size: 24px 24px;
}
.featured-glow {
  position: absolute; right: 80px; top: 50%; width: 220px; height: 280px; transform: translateY(-50%);
  background: radial-gradient(ellipse, rgba(0,230,118,.13) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite; pointer-events: none;
}
.featured-copy { position: relative; z-index: 1; flex: 1; min-width: 0; }
.featured-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.featured-kicker span, .kicker-reading, .kicker-read, .kicker-want_to_read { font-size: 9px; font-weight: 600; letter-spacing: .14em; }
.kicker-reading { color: var(--amber); }
.kicker-read, .kicker-want_to_read { color: var(--green); }
.kicker-want_to_read { color: var(--text-muted); }
.refresh {
  padding: 1px 6px; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 13px; line-height: 1.4;
}
.featured h1 {
  max-width: 640px; margin-bottom: 6px; color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.featured-author { margin-bottom: 10px; color: var(--text-dim); font-size: 13px; }
.featured-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.note-count { color: var(--green); font-size: 10px; }
.featured-cover {
  position: relative; z-index: 1; width: 150px; flex-shrink: 0; cursor: pointer;
  animation: bookFloat 4s ease-in-out infinite; transform-origin: center bottom;
}
.featured-cover img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; border-radius: 2px;
  border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 20px rgba(0,230,118,.09);
}
.featured-cover .scan {
  position: absolute; left: 0; right: 0; top: 0; height: 20%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0,230,118,.09), transparent);
  animation: scanSweep 3.5s linear infinite;
}
.featured-cover .spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px; pointer-events: none;
  background: linear-gradient(to right, rgba(0,230,118,.19), transparent);
}

.product-main { flex: 1; overflow: auto; padding: 16px 20px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; padding-bottom: 32px; }
.book-tile { display: flex; flex-direction: column; min-width: 0; transition: transform var(--transition); }
.book-tile:hover { transform: translateY(-3px); }
.book-tile .cover {
  position: relative; display: block; aspect-ratio: 2/3; overflow: hidden;
  background: var(--surface-hi); border: 1px solid var(--border); border-radius: var(--radius);
}
.book-tile:hover .cover { border-color: var(--border-hi); }
.book-tile img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(25%) brightness(.88); transition: filter 200ms ease; }
.book-tile:hover img { filter: none; }
.status-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; }
.dot-reading { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.dot-read { background: var(--green); box-shadow: 0 0 4px var(--green); }
.note-badge {
  position: absolute; left: 5px; bottom: 5px; padding: 1px 4px;
  background: rgba(0,0,0,.75); border: 1px solid var(--border-hi); border-radius: var(--radius);
  color: var(--green); font-size: 9px; font-style: normal;
}
.tile-copy { padding: 6px 2px 0; }
.tile-copy strong {
  display: -webkit-box; margin-bottom: 2px; overflow: hidden; color: var(--text);
  font-size: 11px; font-weight: 500; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tile-copy em {
  display: block; margin-bottom: 4px; overflow: hidden; color: var(--text-muted);
  font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap;
}
.kanban { height: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; overflow: hidden; }
.kanban-col { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.kanban-col header { padding: 8px 12px; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--text-muted); }
.tone-reading header { border-color: var(--amber); }
.tone-read header { border-color: var(--green); }
.kanban-col header span { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text-muted); }
.tone-reading header span { color: var(--amber); }
.tone-read header span { color: var(--green); }
.kanban-col header em { color: var(--text-muted); font-size: 10px; font-style: normal; }
.kanban-list { flex: 1; overflow: auto; padding: 0 4px 16px; }
.kanban-card {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 4px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.kanban-card img { width: 36px; height: 48px; object-fit: cover; flex-shrink: 0; background: var(--surface-hi); border: 1px solid var(--border); }
.kanban-card span { min-width: 0; display: grid; }
.kanban-card strong, .kanban-card em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card strong { color: var(--text); font-size: 11px; font-weight: 500; }
.kanban-card em { color: var(--text-dim); font-size: 10px; font-style: normal; }
.kanban-card .cat-badge { width: max-content; margin-top: 4px; }
.kanban-empty { padding: 20px 12px; color: var(--text-muted); font-size: 10px; letter-spacing: .04em; text-align: center; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.88);
}
.book-modal {
  width: 100%; max-width: 920px; height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-hi); border-radius: var(--radius);
}
.modal-bar {
  flex-shrink: 0; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-hi); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 10px; letter-spacing: .06em;
}
.modal-bar a { color: var(--text-muted); font-size: 18px; }
.modal-body { flex: 1; min-height: 0; display: flex; }
.modal-body aside {
  width: 210px; flex-shrink: 0; padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  border-right: 1px solid var(--border);
}
.modal-body aside img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--surface-hi); border: 1px solid var(--border); }
.modal-body h1 { color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.4; }
.modal-author { color: var(--text-dim); font-size: 11px; }
.status-label { color: var(--text-muted); font-size: 10px; letter-spacing: .06em; }
.status-choice {
  display: block; width: 100%; margin-bottom: 3px; padding: 5px 10px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent;
  color: var(--text-muted); font-size: 11px; letter-spacing: .04em;
}
.status-choice.on { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.open-reader { margin-top: 8px; justify-content: center; }
.bookmark-help { margin-top: 10px; padding-top: 12px; display: grid; gap: 6px; border-top: 1px solid var(--border); }
.bookmark-help span { color: var(--text-muted); font-size: 9px; letter-spacing: .08em; }
.bookmark-help a { color: var(--amber); font-size: 10px; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }
.bookmark-help a:hover { color: var(--text); }
.source-intro { color: oklch(72% .01 145); font-size: 11px; line-height: 1.65; }
.link-modal .modal-body aside img { width: min(100%, 150px); align-self: center; }
.link-modal .modal-body aside { gap: 8px; }
.source-review-flag { color: oklch(82% .09 75); font-size: 9px; letter-spacing: .08em; }
.source-edition-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: clamp(24px, 6vw, 64px); }
.source-edition-eyebrow { color: oklch(74% .08 75); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.source-edition-body h2 {
  margin-top: 28px; color: oklch(90% .012 145); font-family: 'Iowan Old Style', Georgia, serif;
  font-size: clamp(34px, 4.3vw, 58px); font-weight: 500; line-height: 1.06; letter-spacing: -.045em;
}
.source-edition-body > p:not(.source-edition-eyebrow) {
  max-width: 53ch; margin-top: 24px; color: oklch(70% .01 145);
  font-size: 12px; line-height: 1.8;
}
.source-edition-body dl {
  width: 100%; margin-top: auto; padding-top: 32px; display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 32px;
}
.source-edition-body dl div { padding-top: 8px; border-top: 1px solid var(--border-hi); }
.source-edition-body dt { color: oklch(55% .01 145); font-size: 9px; letter-spacing: .1em; }
.source-edition-body dd { margin-top: 4px; color: oklch(82% .01 145); font-size: 11px; }
.modal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); }
.modal-tabs span { padding: 10px 16px; color: var(--text-muted); font-size: 11px; letter-spacing: .06em; }
.modal-tabs .on { color: var(--green); border-bottom: 2px solid var(--green); }
.modal-notes { flex: 1; overflow: auto; padding: 18px; }
.modal-notes article {
  margin-bottom: 8px; padding: 8px 10px; background: var(--surface-hi);
  border: 1px solid var(--amber); border-radius: var(--radius);
}
.modal-notes article span { color: var(--amber); font-size: 9px; letter-spacing: .08em; }
.modal-notes blockquote { margin: 6px 0 0; color: var(--amber); font-size: 11px; font-style: italic; line-height: 1.5; }
.modal-notes article p { margin-top: 6px; color: var(--text-dim); font-size: 11px; }
.empty-note { padding: 16px 0; color: var(--text-muted); font-size: 11px; }
.file-facts {
  margin-top: 16px; padding: 10px 12px; background: var(--surface-hi);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: 10px; line-height: 2;
}
.file-facts span { color: var(--text-dim); }
.edition-strip { flex: none; max-height: 180px; overflow: auto; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-hi); }
.edition-strip > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.edition-strip > div span { color: var(--teal); font-size: 9px; letter-spacing: .1em; }
.edition-strip > div strong { color: var(--text-muted); font-size: 9px; font-weight: 400; }
.edition-strip nav { display: grid; gap: 4px; }
.edition-strip a { min-width: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 16px; gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid var(--border); color: var(--text-dim); font-size: 10px; }
.edition-strip a:hover { border-color: var(--teal); color: var(--text); }
.edition-strip a span { color: var(--orange); font-size: 9px; }
.edition-strip a strong { overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.edition-strip a i { color: var(--green); font-style: normal; }

.library-toolbar { padding: 12px 20px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.library-toolbar form { flex: 1; display: flex; gap: 6px; }
.library-toolbar input { max-width: 340px; }
.result-count { margin-left: auto; color: var(--text-muted); font-size: 10px; }
.library-content { padding: 16px 20px 42px; }
.native-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.native-book { min-width: 0; transition: transform var(--transition); }
.native-book:hover { transform: translateY(-3px); }
.native-cover {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block;
  background: var(--surface-hi); border: 1px solid var(--border); border-radius: var(--radius);
  filter: grayscale(25%) brightness(.88); transition: filter 200ms, border-color var(--transition);
}
.native-book:hover .native-cover { filter: none; border-color: var(--border-hi); }
.native-meta { padding: 6px 2px 0; }
.native-title { min-height: 31px; margin-bottom: 2px; color: var(--text); font-size: 11px; font-weight: 500; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.native-author { margin-bottom: 4px; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.saved-dot { position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 4px var(--green); }
.cover-box { position: relative; }

.detail-shell { max-width: 980px; margin: 0 auto; padding: 32px 20px 70px; }
.detail-back { display: inline-block; margin-bottom: 24px; color: var(--text-muted); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 38px; align-items: start; }
.detail-cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; border: 1px solid var(--border-hi); }
.detail-kicker { color: var(--green); font-size: 9px; letter-spacing: .14em; margin-bottom: 10px; }
.detail-title { color: var(--text); font-size: clamp(26px,5vw,48px); line-height: 1.12; margin-bottom: 8px; }
.detail-author { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.detail-copy { max-width: 620px; color: var(--text-dim); font-size: 11px; line-height: 1.8; margin-bottom: 20px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-facts { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; gap: 24px; flex-wrap: wrap; }
.detail-facts div { color: var(--text-muted); font-size: 9px; }
.detail-facts strong { display: block; margin-top: 2px; color: var(--text-dim); font-size: 11px; font-weight: 400; }

.auth-shell { min-height: calc(100vh - 49px); display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 420px); padding: 24px; background: var(--surface); border: 1px solid var(--border-hi); }
.auth-label { margin-bottom: 8px; color: var(--green); font-size: 9px; letter-spacing: .14em; }
.auth-card h1 { margin-bottom: 6px; color: var(--text); font-size: 20px; }
.auth-card > p { color: var(--text-dim); font-size: 11px; margin-bottom: 20px; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { display: grid; gap: 4px; color: var(--text-muted); font-size: 10px; }
.auth-error { padding: 8px; margin-bottom: 12px; color: var(--red); border: 1px solid var(--red); font-size: 10px; }
.auth-switch { margin-top: 14px !important; margin-bottom: 0 !important; }
.auth-switch a { color: var(--green); }

.memory-shell { padding: 24px 20px 60px; }
.memory-head { margin-bottom: 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.memory-head h1 { color: var(--text); font-size: 22px; }
.memory-stats { display: flex; gap: 18px; color: var(--text-muted); font-size: 9px; }
.memory-stats strong { display: block; color: var(--green); font-size: 18px; }
.memory-section { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border); }
.memory-section h2 { margin-bottom: 14px; color: var(--text-dim); font-size: 10px; letter-spacing: .1em; }
.memory-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 8px; }
.memory-entry { padding: 12px; background: var(--surface); border: 1px solid var(--border); }
.memory-source { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 9px; }
.memory-entry blockquote { margin: 10px 0; color: var(--text); font-size: 11px; line-height: 1.65; }
.memory-note, .memory-chat p { color: var(--text-dim); font-size: 10px; }
.memory-note span, .memory-chat span { display: block; margin-bottom: 2px; color: var(--green); font-size: 8px; letter-spacing: .08em; }
.memory-entry summary { color: var(--amber); cursor: pointer; font-size: 9px; }
.empty-native { padding: 48px 0; text-align: center; color: var(--text-muted); font-size: 11px; }

footer { padding: 12px 20px; color: var(--text-muted); border-top: 1px solid var(--border); font-size: 9px; }

@media (max-width: 720px) {
  .product-topbar { padding-inline: 12px; }
  .product-brand span { display: none; }
  .product-nav a:not(.nav-primary) { display: none; }
  .category-bar { padding-inline: 12px; top: 48px; }
  .format-bar { padding-inline: 12px; overflow-x: auto; }
  .format-bar > span, .format-bar .chip { flex: none; }
  .catalog-preview-note { padding-inline: 12px; }
  .featured { padding: 24px 16px; min-height: 280px; }
  .featured-cover-wrap { width: 100px; }
  .featured h1 { font-size: 24px; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .library-toolbar form { width: 100%; }
  .library-toolbar input { max-width: none; }
  .result-count { margin-left: 0; }
  .library-content { padding-inline: 12px; }
  .native-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .detail-grid { grid-template-columns: 110px 1fr; gap: 18px; }
  .link-modal { height: min(92vh, 940px); }
  .link-modal .modal-body { display: block; overflow: auto; }
  .link-modal .modal-body aside { width: auto; overflow: visible; display: grid; grid-template-columns: 98px 1fr; gap: 5px 16px; }
  .link-modal .modal-body aside img { grid-row: span 5; }
  .link-modal .modal-body aside .bookmark-help { grid-column: 1 / -1; }
  .link-modal .source-edition-body { min-height: 300px; }
}

@media (max-width: 420px) {
  .featured { align-items: flex-start; }
  .featured-cover-wrap { width: 76px; }
  .native-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-cover { max-width: 180px; }
}

/* Collection identity: warm paper/orange in dialogue with deep teal. */
:root {
  --bg: oklch(11.5% .009 195);
  --surface: oklch(15% .012 195);
  --surface-hi: oklch(19% .015 195);
  --surface-hover: oklch(22% .018 195);
  --border: oklch(26% .016 195);
  --border-hi: oklch(34% .02 195);
  --text: oklch(90% .01 75);
  --text-dim: oklch(70% .014 75);
  --text-muted: oklch(52% .015 75);
  --orange: oklch(73% .17 53);
  --teal: oklch(73% .11 185);
  --green: oklch(76% .16 145);
  --green-dim: oklch(23% .055 145);
  --amber: oklch(77% .12 78);
  --font-ui: 'Barlow', sans-serif;
  --font-display: 'Literata', Georgia, serif;
}
body { font-family: var(--font-ui); font-size: 14px; }
button, input, textarea, select { font-family: var(--font-ui); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.topbar { min-height: 68px; padding: 12px clamp(16px, 3vw, 48px); gap: clamp(12px, 2vw, 28px); }
.logo-mark { color: var(--orange); font-family: var(--font-ui); font-size: 16px; letter-spacing: .18em; }
.logo-count { color: var(--teal); font-family: var(--font); }
.brand-subtitle { padding-left: 15px; border-left: 1px solid var(--border-hi); color: var(--text-muted); font-family: var(--font-display); font-size: 12px; font-style: italic; white-space: nowrap; }
.topbar-search { width: clamp(180px, 24vw, 350px); }
.topbar-search input { width: 100%; padding: 9px 12px; border-color: var(--border-hi); border-radius: 0; font-size: 13px; }
.topbar-search input:focus { border-color: var(--teal); }
.topbar-link, .topbar-signout { color: var(--text-dim); font-family: var(--font-ui); font-size: 13px; white-space: nowrap; }
.topbar-link:hover, .topbar-signout:hover { color: var(--teal); }
.topbar-join { padding: 9px 13px; border: 1px solid var(--orange); color: var(--orange); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background 180ms, color 180ms; }
.topbar-join:hover { background: var(--orange); color: var(--bg); }
.topbar-join span { margin-left: 8px; }
.product-main { padding: 0 clamp(16px, 3vw, 48px) 64px; }
.catalog-preview-note { padding-inline: clamp(16px, 3vw, 48px); }

.discovery { padding: clamp(24px, 3vw, 46px) clamp(16px, 3vw, 48px) 36px; border-bottom: 1px solid var(--border); background: radial-gradient(circle at 72% 20%, oklch(20% .04 195 / .42), transparent 45%), var(--bg); }
.discovery-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.discovery-eyebrow, .collection-eyebrow { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .12em; }
.discovery-heading h1 { margin: 7px 0 2px; color: var(--text); font-family: var(--font-display); font-size: clamp(31px, 3.8vw, 58px); font-weight: 500; letter-spacing: -.05em; line-height: 1.1; }
.discovery-heading p:last-child { color: var(--text-dim); font-family: var(--font-display); font-size: 14px; }
.discovery-controls { display: flex; align-items: center; gap: 11px; flex: none; }
.discovery-controls button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border-hi); color: var(--orange); font-family: var(--font-ui); font-size: 20px; transition: background 180ms, border-color 180ms; }
.discovery-controls button:hover { border-color: var(--orange); background: oklch(25% .045 53); }
.discovery-controls span { min-width: 66px; color: var(--text-muted); font-family: var(--font); font-size: 10px; text-align: center; }
.discovery-accordion { display: flex; gap: 7px; height: clamp(260px, 29vw, 400px); overflow: hidden; touch-action: pan-y; }
.discovery-book { display: flex; flex: 1 1 12%; min-width: 0; overflow: hidden; border: 1px solid var(--border-hi); background: var(--surface); transition: flex-grow 550ms cubic-bezier(.16, 1, .3, 1), border-color 260ms; }
.discovery-book.is-active { flex-grow: 6; border-color: oklch(53% .08 185); background: oklch(17% .017 195); }
.discovery-select { display: flex; flex-direction: column; align-items: center; justify-content: space-between; flex: none; width: clamp(48px, 6.6vw, 86px); padding: 16px 8px; border-right: 1px solid var(--border-hi); text-align: left; }
.discovery-select:hover { background: var(--surface-hover); }
.discovery-index { color: var(--orange); font-family: var(--font); font-size: 11px; }
.discovery-vertical-title { max-height: 74%; overflow: hidden; color: var(--text-dim); font-family: var(--font-display); font-size: clamp(12px, 1.4vw, 17px); line-height: 1.15; writing-mode: vertical-rl; transform: rotate(180deg); text-overflow: ellipsis; }
.is-active .discovery-vertical-title { color: var(--teal); }
.discovery-panel { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 42px); min-width: 0; flex: 1; padding: clamp(16px, 2vw, 30px); opacity: 0; transition: opacity 190ms; }
.is-active .discovery-panel { opacity: 1; transition-delay: 160ms; }
.discovery-panel img { display: block; flex: none; width: min(33%, 210px); max-height: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 13px 18px 26px oklch(5% .005 195 / .5); }
.discovery-book-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.discovery-type { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.discovery-type span { color: var(--orange); }
.discovery-book-copy h2 { max-width: 14ch; margin-top: 15px; color: var(--text); font-family: var(--font-display); font-size: clamp(22px, 2.9vw, 45px); font-weight: 500; letter-spacing: -.04em; line-height: 1.15; overflow-wrap: anywhere; }
.discovery-book-copy p { margin-top: 10px; color: var(--text-dim); font-family: var(--font-display); font-size: 15px; }
.discovery-book-copy a { margin-top: 28px; padding: 10px 14px; border: 1px solid var(--green); color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; }
.discovery-book-copy a:hover { background: var(--green-dim); }
.discovery-book-copy a span { margin-left: 20px; }

.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 31px 0 23px; }
.collection-heading h2 { margin-top: 4px; color: var(--text); font-family: var(--font-display); font-size: clamp(27px, 3vw, 38px); font-weight: 500; letter-spacing: -.04em; }
.origin-credit { color: var(--text-muted); font-family: var(--font-display); font-size: 11px; font-style: italic; letter-spacing: 0; text-transform: none; }
.collection-actions { display: flex; align-items: center; gap: 20px; }
.browse-switch { display: flex; gap: 18px; border-bottom: 1px solid var(--border-hi); }
.browse-switch a { padding: 7px 0 9px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.browse-switch a:hover { color: var(--text); }
.browse-switch a.is-current { margin-bottom: -1px; border-bottom: 2px solid var(--teal); color: var(--teal); }
.collection-submit { color: var(--orange); font-size: 12px; white-space: nowrap; }
.collection-submit:hover { text-decoration: underline; text-underline-offset: 4px; }
.book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(18px, 2vw, 30px) clamp(12px, 1.8vw, 24px); }
.book-tile .cover { border-color: var(--border-hi); }
.book-tile img { filter: saturate(.8) brightness(.9); }
.book-tile:hover img { filter: none; }
.tile-copy { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; }
.tile-copy strong { margin: 0; color: var(--text); font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: 1.28; }
.tile-copy em { margin: 0; color: var(--text-dim); font-family: var(--font-ui); font-size: 12px; }
.tile-format { align-self: flex-start; margin-top: 4px; color: var(--teal); font-family: var(--font); font-size: 9px; font-weight: 600; letter-spacing: .11em; }
.tile-format.is-link { color: var(--orange); }
#book-grid-sentinel { height: 1px; }
.author-index { max-width: 1100px; border-top: 1px solid var(--border-hi); }
.author-group { border-bottom: 1px solid var(--border); }
.author-group summary { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 17px 4px; color: var(--text); cursor: pointer; list-style: none; }
.author-group summary::-webkit-details-marker { display: none; }
.author-group summary > span:first-child { font-family: var(--font-display); font-size: 21px; }
.author-group summary > span:last-child { color: var(--text-muted); font-family: var(--font); font-size: 10px; white-space: nowrap; }
.author-group summary i { margin-left: 14px; color: var(--orange); font-size: 16px; font-style: normal; }
.author-group[open] summary { color: var(--teal); }
.author-group[open] summary i { display: inline-block; transform: rotate(90deg); }
.author-books { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; padding: 0 0 17px; }
.author-books a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px; background: var(--surface); }
.author-books a:hover { background: var(--surface-hover); }
.author-books img { width: 42px; height: 60px; flex: none; object-fit: cover; }
.author-books a > span { display: grid; gap: 5px; min-width: 0; }
.author-books strong { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.author-books small { color: var(--teal); font-family: var(--font); font-size: 9px; }
.author-books b { margin-left: auto; color: var(--orange); font-size: 17px; font-weight: 400; }

@media (max-width: 760px) {
  .app-page { height: auto; min-height: 100vh; overflow: auto; }
  .topbar { flex-wrap: wrap; gap: 10px 14px; }
  .brand-subtitle { display: none; }
  .topbar-spacer { flex: 1; }
  .topbar-search { order: 10; width: 100%; }
  .topbar-link, .topbar-signout { font-size: 12px; }
  .discovery { padding-bottom: 22px; }
  .discovery-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .discovery-controls { align-self: flex-end; }
  .discovery-accordion { height: 330px; gap: 4px; }
  .discovery-book { flex-basis: 10%; }
  .discovery-book.is-active { flex-grow: 8; }
  .discovery-select { width: 36px; padding: 10px 4px; }
  .discovery-panel { flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 12px; }
  .discovery-panel img { width: 90px; height: 125px; }
  .discovery-book-copy h2 { max-width: 20ch; margin-top: 6px; font-size: 20px; }
  .discovery-book-copy p { margin-top: 3px; font-size: 12px; }
  .discovery-book-copy a { margin-top: 10px; padding: 6px 8px; }
  .collection-heading { align-items: flex-start; flex-direction: column; }
  .collection-actions { width: 100%; justify-content: space-between; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .topbar-join { padding: 6px 8px; font-size: 11px; }
  .topbar-login { display: none; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-panel img { width: 68px; height: 94px; }
  .discovery-book-copy h2 { font-size: 17px; }
  .discovery-type { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .discovery-book, .discovery-panel, .book-tile { transition-duration: 0ms; }
}

.btn-primary { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.btn-primary:hover { background: oklch(31% .07 145); }
.auth-card { width: min(100%, 480px); padding: clamp(24px, 4vw, 42px); border-color: var(--border-hi); }
.auth-label { color: var(--teal); }
.auth-card h1 { font-family: var(--font-display); font-size: 31px; font-weight: 500; letter-spacing: -.04em; }
.auth-card > p { font-family: var(--font-display); font-size: 13px; line-height: 1.6; }
.auth-card label { color: var(--text-dim); font-family: var(--font-ui); font-size: 12px; }
.auth-card input { padding: 10px; font-family: var(--font-ui); font-size: 14px; }
.auth-card .btn-primary { justify-content: space-between; margin-top: 8px; padding: 11px 13px; font-size: 13px; }
.auth-switch a { color: var(--orange); }
.auth-browse { display: inline-block; margin-top: 13px; color: var(--teal); font-size: 12px; }

.contribute-shell { max-width: 1150px; margin: 0 auto; display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); padding: clamp(28px, 6vw, 84px) 0 80px; }
.contribute-intro { position: sticky; top: 24px; align-self: start; }
.contribute-intro h1 { max-width: 10ch; margin-top: 12px; color: var(--text); font-family: var(--font-display); font-size: clamp(42px, 5vw, 68px); font-weight: 500; letter-spacing: -.06em; line-height: 1.08; }
.contribute-intro > p:not(.collection-eyebrow) { max-width: 45ch; margin-top: 21px; color: var(--text-dim); font-family: var(--font-display); font-size: 15px; line-height: 1.75; }
.contribute-intro > a { display: inline-block; margin-top: 28px; color: var(--teal); font-size: 12px; }
.contribute-gate { align-self: start; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--border-hi); background: var(--surface); }
.contribute-gate > span, .contribute-form-head > span { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .12em; }
.contribute-gate h2, .contribute-form-head h2 { margin-top: 8px; color: var(--text); font-family: var(--font-display); font-size: clamp(22px, 2.5vw, 30px); font-weight: 500; letter-spacing: -.04em; }
.contribute-gate p { max-width: 45ch; margin-top: 15px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.contribute-gate > div { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 27px; }
.contribute-gate > div > a:last-child { color: var(--orange); font-size: 12px; }
.contribute-column { display: grid; gap: 40px; }
.contribute-form { display: grid; gap: 19px; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--border-hi); background: var(--surface); }
.contribute-form-head { margin-bottom: 4px; }
.contribute-source-head { margin-top: 17px; padding-top: 26px; border-top: 1px solid var(--border-hi); }
.contribute-form label { display: grid; gap: 7px; color: var(--text); font-size: 13px; }
.contribute-form label span { color: var(--text-muted); font-size: 11px; }
.contribute-form input, .contribute-form textarea { padding: 11px 12px; border-color: var(--border-hi); font-family: var(--font-ui); font-size: 14px; }
.contribute-form input:focus, .contribute-form textarea:focus { border-color: var(--teal); }
.contribute-form input[type=file] { padding: 13px; color: var(--text-dim); }
.contribute-form input::file-selector-button { margin-right: 12px; padding: 6px 9px; border: 1px solid var(--teal); background: transparent; color: var(--teal); font: inherit; cursor: pointer; }
.contribute-caution { color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.contribute-form > button { justify-content: space-between; padding: 12px 14px; font-size: 13px; }
.contribute-success { padding: 13px; border: 1px solid var(--green); background: var(--green-dim); color: var(--green); font-size: 13px; }
.contribute-history { padding-top: 5px; }
.submission-list { margin-top: 17px; border-top: 1px solid var(--border-hi); }
.submission-list article { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.submission-list article > div { display: grid; gap: 4px; }
.submission-list strong { color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 500; }
.submission-list span, .submission-list small { color: var(--text-muted); font-size: 11px; }
.submission-list b { color: var(--orange); font-family: var(--font); font-size: 10px; font-weight: 500; text-transform: uppercase; }
.contribute-empty { margin-top: 16px; color: var(--text-muted); font-family: var(--font-display); font-size: 13px; }
.source-finder { display: grid; gap: 12px; padding: 16px; border: 1px solid oklch(38% .045 185); background: oklch(19% .023 185); }
.source-finder > div:first-child p { color: var(--teal); font-family: var(--font-display); font-size: 16px; }
.source-finder > div:first-child span { display: block; margin-top: 4px; color: var(--text-dim); font-size: 11px; line-height: 1.5; }
.source-finder > button { justify-self: start; padding: 8px 11px; border: 1px solid var(--teal); color: var(--teal); font-size: 12px; }
.source-finder > button:disabled { opacity: .45; cursor: wait; }
#source-finder-status { color: var(--text-dim); font-size: 11px; }
#source-finder-status:empty { display: none; }
#source-finder-results { display: grid; gap: 1px; }
.source-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-hi); }
.source-result > div { display: grid; gap: 4px; min-width: 0; }
.source-result strong { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.source-result small { color: var(--text-muted); font-size: 10px; }
.source-result > div:last-child { display: flex; align-items: center; gap: 10px; flex: none; }
.source-result a, .source-result button { color: var(--orange); font-size: 11px; white-space: nowrap; }
.source-result button { color: var(--green); }
.finder-history { margin-top: clamp(36px, 6vw, 76px); }
.finder-history ol { margin-top: 19px; list-style: none; border-top: 1px solid var(--border-hi); }
.finder-history li { border-bottom: 1px solid var(--border); }
.finder-history li > a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; padding: 16px 2px; }
.finder-history li > a > span { color: var(--orange); font-family: var(--font); font-size: 9px; }
.finder-history li > a > div { display: grid; gap: 3px; }
.finder-history strong { color: var(--text); font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.finder-history small { color: var(--text-muted); font-size: 10px; }
.finder-history em { color: var(--teal); font-style: normal; }
@media (max-width: 760px) {
  .contribute-shell { grid-template-columns: 1fr; gap: 30px; padding-top: 34px; }
  .contribute-intro { position: static; }
  .contribute-intro h1 { max-width: none; }
  .source-result { align-items: flex-start; flex-direction: column; }
}

/* Personal shelf: a reading board, not another catalog grid. */
.shelf-shell, .memory-shell { max-width: 1580px; margin: 0 auto; padding: clamp(28px, 4vw, 60px) 0 88px; }
.shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding-bottom: 32px; }
.shelf-eyebrow { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .14em; }
.shelf-head h1, .memory-head h1 { margin-top: 8px; color: var(--text); font-family: var(--font-display); font-size: clamp(36px, 4vw, 54px); font-weight: 500; letter-spacing: -.055em; line-height: 1.1; }
.shelf-period { color: var(--orange); }
.shelf-head > div:first-child > p:last-child, .memory-head > div:first-child > p:last-child { max-width: 53ch; margin-top: 12px; color: var(--text-dim); font-family: var(--font-display); font-size: 15px; line-height: 1.55; }
.shelf-head-actions { display: flex; align-items: center; gap: 24px; padding-bottom: 3px; }
.shelf-head-actions > span { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.shelf-head-actions strong { margin-right: 5px; color: var(--text); font-family: var(--font-display); font-size: 23px; font-weight: 500; }
.shelf-head-actions a, .shelf-first-run a { padding: 11px 14px; border: 1px solid var(--green); color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background 160ms ease; }
.shelf-head-actions a:hover, .shelf-first-run a:hover { background: var(--green-dim); }
.shelf-head-actions a span, .shelf-first-run a span { margin-left: 18px; }
.shelf-view-nav { display: flex; gap: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--border-hi); }
.shelf-view-nav a { padding: 0 1px 13px; color: var(--text-dim); font-size: 13px; }
.shelf-view-nav a:hover { color: var(--text); }
.shelf-view-nav a[aria-current=page] { margin-bottom: -1px; border-bottom: 2px solid var(--orange); color: var(--text); }
.shelf-view-nav span { margin-left: 6px; color: var(--teal); font-family: var(--font); font-size: 10px; }
.reading-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: clamp(12px, 1.7vw, 24px); }
.reading-lane { min-width: 0; border-top: 1px solid var(--border-hi); }
.lane-head { display: flex; align-items: baseline; gap: 10px; min-height: 68px; padding: 18px 0 16px; }
.lane-number { color: var(--orange); font-family: var(--font); font-size: 10px; }
.lane-head h2 { color: var(--text); font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.lane-reading .lane-number { color: var(--teal); }
.lane-read .lane-number { color: var(--green); }
.lane-count { margin-left: auto; color: var(--text-muted); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.lane-list { display: grid; gap: 0; list-style: none; }
.lane-list > li { border-top: 1px solid var(--border); }
.shelf-entry { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 15px; padding: 16px 3px 18px; }
.shelf-entry-cover { align-self: start; display: block; width: 66px; aspect-ratio: 2 / 3; background: var(--surface-hi); }
.shelf-entry-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shelf-entry-content { min-width: 0; }
.shelf-entry-kind { display: block; color: var(--teal); font-family: var(--font); font-size: 9px; font-weight: 600; letter-spacing: .11em; }
.shelf-entry-kind.is-link { color: var(--orange); }
.shelf-entry-title { display: block; margin-top: 4px; color: var(--text); font-family: var(--font-display); font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.shelf-entry-title:hover { color: var(--teal); }
.shelf-entry-author { margin-top: 5px; color: var(--text-dim); font-size: 12px; overflow-wrap: anywhere; }
.shelf-entry-progress { margin-top: 7px; color: var(--green); font-family: var(--font); font-size: 10px; }
.shelf-move { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.shelf-move label { color: var(--text-muted); font-size: 11px; }
.shelf-move select { min-width: 0; max-width: 145px; padding: 7px 8px; border: 1px solid var(--border-hi); background: var(--surface); color: var(--text); font-size: 11px; }
.shelf-move button { min-height: 34px; padding: 7px 9px; border: 1px solid var(--border-hi); color: var(--teal); font-size: 11px; }
.shelf-move button:hover { border-color: var(--teal); background: var(--surface-hover); }
.lane-empty { padding: 24px 10px 28px; border-top: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-display); font-size: 14px; line-height: 1.5; }
.shelf-first-run { max-width: 680px; padding: clamp(30px, 6vw, 70px) 0; }
.shelf-first-run > span { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .12em; }
.shelf-first-run h2 { max-width: 16ch; margin-top: 14px; color: var(--text); font-family: var(--font-display); font-size: clamp(30px, 3.8vw, 48px); font-weight: 500; letter-spacing: -.05em; line-height: 1.14; }
.shelf-first-run p { max-width: 48ch; margin: 18px 0 30px; color: var(--text-dim); font-size: 15px; line-height: 1.6; }
.memory-head { align-items: end; margin-bottom: 32px; padding-bottom: 0; }
.memory-list { margin-top: 23px; gap: 12px; }
.memory-companion { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); min-height: 520px; margin: 36px 0 44px; border-top: 1px solid var(--border-hi); border-bottom: 1px solid var(--border-hi); background: oklch(13.5% .015 195); }
.memory-companion-intro { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(26px, 4vw, 52px); background: radial-gradient(circle at 12% 8%, oklch(24% .05 53 / .26), transparent 42%); }
.memory-companion-intro h2 { max-width: 12ch; margin-top: 12px; color: var(--text); font-family: var(--font-display); font-size: clamp(31px, 3.5vw, 48px); font-weight: 500; letter-spacing: -.05em; line-height: 1.08; }
.memory-companion-intro > p:not(.shelf-eyebrow) { max-width: 43ch; margin-top: 20px; color: var(--text-dim); font-family: var(--font-display); font-size: 14px; line-height: 1.7; }
.memory-privacy { margin-top: auto; padding-top: 34px; }
.memory-privacy span { color: var(--green); font-family: var(--font); font-size: 9px; letter-spacing: .11em; }
.memory-privacy p { max-width: 45ch; margin-top: 7px; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.memory-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.memory-prompts button { padding: 7px 9px; border: 1px solid var(--border-hi); color: var(--teal); font-size: 10px; }
.memory-prompts button:hover { border-color: var(--teal); background: var(--surface-hover); }
.memory-companion-workspace { min-width: 0; padding: clamp(22px, 3vw, 40px); border-left: 1px solid var(--border-hi); }
.memory-thread { display: flex; flex-direction: column; gap: 18px; height: 350px; padding-right: 10px; overflow: auto; scrollbar-color: var(--border-hi) transparent; }
.memory-thread-empty { max-width: 48ch; margin: auto 0; }
.memory-thread-empty span, .memory-message > span { color: var(--teal); font-family: var(--font); font-size: 9px; letter-spacing: .11em; }
.memory-thread-empty p { margin-top: 10px; color: var(--text-dim); font-family: var(--font-display); font-size: 17px; line-height: 1.55; }
.memory-message { max-width: min(88%, 680px); }
.memory-message-user { align-self: flex-end; padding: 13px 15px; background: var(--surface-hi); }
.memory-message-user > span { color: var(--orange); }
.memory-message p { margin-top: 7px; color: var(--text-dim); font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.memory-message-assistant p { color: var(--text); font-family: var(--font-display); font-size: 14px; }
.memory-message-sources { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.memory-message-sources a { padding: 5px 7px; border: 1px solid var(--border); color: var(--green); font-size: 10px; }
.memory-message-sources a:hover { border-color: var(--green); }
.memory-ask { display: grid; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-hi); }
.memory-ask > label { color: var(--text); font-size: 12px; }
.memory-ask textarea { width: 100%; min-height: 78px; padding: 11px 12px; resize: vertical; border-color: var(--border-hi); background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.5; }
.memory-ask textarea:focus { border-color: var(--teal); }
.memory-ask > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.memory-ask small { color: var(--text-muted); font-size: 10px; }
.memory-ask button { flex: none; padding: 9px 11px; font-size: 11px; }
.memory-ask button:disabled, .memory-ask textarea:disabled { opacity: .45; cursor: not-allowed; }
.memory-companion-error { min-height: 18px; margin-top: 8px; color: var(--orange); font-size: 11px; }
.memory-filter { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto minmax(160px, .55fr) auto auto; align-items: center; gap: 9px; margin: 0 0 24px; }
.memory-filter label { color: var(--text-muted); font-size: 10px; }
.memory-filter input, .memory-filter select { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-hi); background: var(--surface); color: var(--text); font-size: 12px; }
.memory-filter button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--teal); color: var(--teal); font-size: 11px; }
.memory-filter a { color: var(--orange); font-size: 11px; }
@media (max-width: 1050px) {
  .reading-board { grid-template-columns: 1fr; gap: 32px; }
  .lane-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); column-gap: 18px; }
  .memory-companion { grid-template-columns: 1fr; }
  .memory-companion-workspace { border-top: 1px solid var(--border-hi); border-left: 0; }
  .memory-privacy { margin-top: 28px; padding-top: 0; }
}
@media (max-width: 650px) {
  .shelf-head, .memory-head { align-items: flex-start; flex-direction: column; gap: 24px; }
  .shelf-head-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .shelf-view-nav { gap: 20px; }
  .shelf-view-nav a { font-size: 12px; }
  .memory-stats { align-self: stretch; }
  .memory-companion { margin-inline: -16px; }
  .memory-thread { height: 390px; }
  .memory-message { max-width: 94%; }
  .memory-ask > div { align-items: stretch; flex-direction: column; gap: 10px; }
  .memory-filter { grid-template-columns: 1fr; }
  .memory-filter label { margin-top: 5px; }
}
@media (pointer: coarse) {
  .shelf-move select, .shelf-move button { min-height: 44px; }
}

/* Account: a personal bookplate, with quiet, legible settings beside it. */
.topbar-account { display: grid; place-items: center; flex: none; width: 36px; height: 36px; overflow: hidden; border: 1px solid var(--teal); border-radius: 50%; color: var(--teal); font-family: var(--font-display); font-size: 17px; }
.topbar-account img { width: 100%; height: 100%; object-fit: cover; }
.account-shell { max-width: 1040px; margin: 0 auto; padding: 64px 0 96px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 80px; }
.account-intro h1 { margin-top: 16px; font-family: var(--font-display); font-size: 42px; font-weight: 500; line-height: 1.16; letter-spacing: -.045em; }
.account-intro h1 span { color: var(--orange); }
.account-intro > p:not(.collection-eyebrow) { max-width: 32ch; margin-top: 16px; color: var(--text-dim); font-size: 15px; }
.account-intro > a { display: inline-block; margin-top: 24px; color: var(--teal); font-size: 13px; }
.account-portrait { display: grid; place-items: center; width: 116px; height: 116px; margin-top: 48px; overflow: hidden; border: 1px solid var(--border-hi); border-radius: 50%; background: var(--surface); color: var(--orange); font-family: var(--font-display); font-size: 52px; }
.account-portrait img { width: 100%; height: 100%; object-fit: cover; }
.account-reader-name { display: block; margin-top: 16px; font-family: var(--font-display); font-size: 21px; font-weight: 500; overflow-wrap: anywhere; }
.account-handle { color: var(--teal); font-size: 13px; }
.account-column { min-width: 0; }
.account-form { display: grid; gap: 24px; }
.section-heading { padding-top: 20px; border-top: 1px solid var(--border-hi); }
.section-heading > span { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .12em; }
.section-heading h2 { margin-top: 8px; font-family: var(--font-display); font-size: 25px; font-weight: 500; letter-spacing: -.035em; }
.account-form label { display: grid; gap: 8px; color: var(--text); font-size: 14px; }
.account-form input { min-height: 44px; padding: 10px 12px; border-color: var(--border-hi); font-family: var(--font-ui); font-size: 15px; }
.account-form label small { color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.account-form input::file-selector-button { margin-right: 12px; padding: 6px 9px; border: 1px solid var(--teal); background: transparent; color: var(--teal); font: inherit; cursor: pointer; }
.account-form .check-label { display: flex; align-items: center; gap: 10px; }
.account-form .check-label input { width: 18px; min-height: 18px; accent-color: var(--teal); }
.account-form > button { justify-content: space-between; min-height: 46px; padding: 12px 16px; font-size: 14px; }
.account-access { display: grid; gap: 16px; margin-top: 48px; }
.account-access > p { max-width: 55ch; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.account-access .account-email { color: var(--text); overflow-wrap: anywhere; }
.text-action, .account-review-link { min-height: 44px; color: var(--teal); font-family: var(--font-ui); font-size: 14px; }
.account-review-link { display: inline-flex; align-items: center; color: var(--orange); }
.form-feedback { padding: 14px 16px; margin-bottom: 24px; border: 1px solid var(--border-hi); font-size: 14px; }
.form-feedback.success { color: var(--green); background: var(--green-dim); }
.form-feedback.error { color: var(--orange); background: var(--surface-hi); }
.auth-google { display: flex; justify-content: space-between; gap: 20px; padding: 13px 15px; margin-top: 24px; border: 1px solid var(--teal); color: var(--text); font-family: var(--font-ui); font-size: 15px; }
.auth-google:hover { background: var(--surface-hover); }
.auth-card > .auth-divider { margin: 16px 0; text-align: center; color: var(--text-dim); font-family: var(--font-ui); font-size: 12px; }
.review-shell { max-width: 1280px; margin: 0 auto; padding: 48px 0 96px; }
.review-list { list-style: none; }
.review-list li { border-bottom: 1px solid var(--border-hi); }
.review-list li > a { display: flex; align-items: center; gap: 24px; padding: 24px 0; color: var(--text); }
.review-list li > a:hover h2 { color: var(--teal); }
.review-number { flex: none; color: var(--orange); font-family: var(--font); font-size: 11px; }
.review-list h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; line-height: 1.3; }
.review-list p { margin-top: 8px; color: var(--text-dim); font-size: 13px; }
.review-list p > span { color: var(--text-muted); }
.review-row-meta { display: grid; justify-items: end; gap: 8px; margin-left: auto; flex: none; font-size: 12px; color: var(--text-dim); }
.review-status { color: var(--orange); font-family: var(--font); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.review-status.status-approved { color: var(--green); }
.review-status.status-declined { color: var(--text-dim); }
.review-back { display: inline-block; margin-bottom: 28px; color: var(--teal); font-size: 13px; }
.review-detail .shelf-head h1 { max-width: 24ch; overflow-wrap: anywhere; font-size: 38px; line-height: 1.2; }
.review-contributor-note { display: grid; gap: 8px; max-width: 75ch; margin-bottom: 36px; }
.review-contributor-note > span, .review-record > span { color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .1em; }
.review-contributor-note p, .review-record p { color: var(--text-dim); font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 64px; }
.review-sources, .review-decision { display: grid; gap: 20px; min-width: 0; }
.review-hint { max-width: 62ch; color: var(--text-dim); font-size: 13px; line-height: 1.65; }
.review-source { display: grid; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--border-hi); }
.review-source-top { display: flex; align-items: center; gap: 10px; }
.review-source-top input { width: 18px; height: 18px; accent-color: var(--teal); }
.review-source-top label, .review-source-top strong { font-size: 15px; font-weight: 500; }
.review-source-top > span { margin-left: auto; color: var(--teal); font-size: 12px; }
.review-source > p { color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }
.review-source > a { justify-self: start; display: inline-flex; gap: 28px; padding: 10px 0; color: var(--orange); font-size: 14px; }
.review-decision > label { display: grid; gap: 8px; font-size: 14px; }
.review-decision input, .review-decision textarea { min-height: 44px; padding: 10px 12px; border-color: var(--border-hi); font-family: var(--font-ui); font-size: 15px; }
.review-decision > .btn { min-height: 46px; padding: 12px 16px; justify-content: space-between; font-size: 14px; }
.review-decision > .text-action { justify-self: start; color: var(--text-dim); }
.review-record { display: grid; gap: 12px; padding: 20px 0; border-top: 1px solid var(--border-hi); }
@media (max-width: 760px) {
  .account-shell { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
  .account-intro h1 { font-size: 34px; }
  .account-portrait { width: 72px; height: 72px; margin-top: 28px; font-size: 34px; }
  .account-reader-name { margin-top: 12px; }
  .review-workspace { grid-template-columns: 1fr; gap: 40px; }
  .review-detail .shelf-head h1 { font-size: 30px; }
  .review-list li > a { flex-wrap: wrap; gap: 12px; }
  .review-list li > a > div:first-of-type { flex-basis: calc(100% - 44px); }
  .review-row-meta { display: flex; margin-left: 32px; margin-right: auto; }
  .review-shell .shelf-view-nav { overflow-x: auto; white-space: nowrap; }
}

.nav-compact { display: none; }
/* Durable finder: a compact working desk for one title or fifty. */
.finder-shell { max-width: 1180px; margin: 0 auto; padding: clamp(42px, 6vw, 82px) 0 96px; }
.finder-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); align-items: end; gap: 34px 72px; margin-bottom: 40px; }
.finder-head .collection-eyebrow { grid-column: 1 / -1; margin-bottom: -21px; }
.finder-head h1, .finder-job-head h1 { max-width: 13ch; font-family: var(--font-display); font-size: clamp(42px, 6vw, 72px); font-weight: 500; letter-spacing: -.06em; line-height: 1.03; }
.finder-head > p:last-child, .finder-job-head p { max-width: 45ch; color: var(--text-dim); font-family: var(--font-display); font-size: 15px; line-height: 1.7; }
.finder-form { display: grid; gap: 18px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--border-hi); background: var(--surface); }
.finder-form > label { display: flex; justify-content: space-between; gap: 20px; color: var(--text); font-size: 14px; }
.finder-form > label span { color: var(--text-muted); font-size: 11px; }
.finder-form textarea { min-height: 330px; padding: 18px; border-color: var(--border-hi); font-family: var(--font-ui); font-size: 14px; line-height: 1.7; resize: vertical; }
.finder-form textarea:focus { border-color: var(--teal); }
.finder-form > div { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.finder-form > div p { max-width: 55ch; color: var(--text-dim); font-size: 12px; line-height: 1.6; }
.finder-form button { flex: none; min-height: 46px; padding: 12px 16px; }
.finder-job-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.finder-job-head h1 { margin-top: 8px; font-size: clamp(36px, 5vw, 58px); }
.finder-job-head p { margin-top: 12px; }
.finder-job-head > div:last-child { display: flex; align-items: center; gap: 20px; padding-bottom: 7px; }
.finder-job-head a, .finder-job-head button { color: var(--teal); font-size: 13px; }
.finder-job-head button { color: var(--orange); }
.finder-progress { height: 3px; margin-top: 34px; overflow: hidden; background: var(--border); }
.finder-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--teal), var(--green)); transition: width 300ms ease; }
.finder-live { padding: 14px 0 22px; color: var(--teal); font-family: var(--font); font-size: 11px; }
.finder-items { border-top: 1px solid var(--border-hi); }
.finder-item { border-bottom: 1px solid var(--border-hi); }
.finder-item summary { display: grid; grid-template-columns: 36px minmax(180px, 1fr) minmax(120px, .6fr) auto; align-items: center; gap: 16px; min-height: 72px; padding: 13px 0; cursor: pointer; list-style: none; }
.finder-item summary::-webkit-details-marker { display: none; }
.finder-item summary > span { color: var(--orange); font-family: var(--font); font-size: 10px; }
.finder-item summary > strong { min-width: 0; color: var(--text); font-family: var(--font-display); font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.finder-item summary > small { color: var(--text-dim); font-size: 12px; overflow-wrap: anywhere; }
.finder-state { color: var(--text-muted); font-family: var(--font); font-size: 9px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.finder-state.state-running { color: var(--teal); }
.finder-state.state-complete { color: var(--green); }
.finder-state.state-failed { color: var(--orange); }
.finder-item[open] summary > strong { color: var(--teal); }
.finder-item-body { padding: 0 0 28px 52px; }
.finder-item-body form { display: grid; gap: 18px; }
.finder-candidates { display: grid; gap: 1px; background: var(--border); }
.finder-candidate { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; background: var(--surface); }
.finder-candidate input { width: 17px; height: 17px; accent-color: var(--green); }
.finder-candidate > span { display: grid; gap: 4px; min-width: 0; }
.finder-candidate strong { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.finder-candidate small { color: var(--teal); font-size: 10px; }
.finder-candidate em { color: var(--text-muted); font-size: 10px; font-style: normal; line-height: 1.4; }
.finder-candidate > a { padding: 10px; color: var(--orange); font-size: 12px; }
.finder-item-body form > button { justify-self: end; min-height: 42px; padding: 10px 14px; }
.finder-no-result { padding: 10px 0; color: var(--text-dim); font-family: var(--font-display); font-size: 14px; }
@media (max-width: 760px) {
  .nav-wide { display: none; }
  .nav-compact { display: inline; }
  .finder-head { grid-template-columns: 1fr; gap: 24px; }
  .finder-head .collection-eyebrow { grid-column: auto; margin-bottom: 0; }
  .finder-form > label, .finder-form > div, .finder-job-head { align-items: flex-start; flex-direction: column; }
  .finder-form textarea { min-height: 280px; }
  .finder-form button { width: 100%; justify-content: space-between; }
  .finder-item summary { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; }
  .finder-item summary > small { grid-column: 2 / -1; grid-row: 2; }
  .finder-state { grid-column: 3; grid-row: 1; }
  .finder-item-body { padding-left: 36px; }
  .finder-candidate { grid-template-columns: 18px minmax(0, 1fr); }
  .finder-candidate > a { grid-column: 2; padding: 6px 0; }
}

/* 2026 public reading room: light paper, one clear invitation, A-Z shelves. */
:root {
  color-scheme: light;
  --bg: oklch(96.5% .016 78);
  --surface: oklch(99% .007 78);
  --surface-hi: oklch(93.5% .018 78);
  --surface-hover: oklch(91% .025 78);
  --border: oklch(84% .022 78);
  --border-hi: oklch(70% .03 78);
  --text: oklch(24% .025 204);
  --text-dim: oklch(43% .025 204);
  --text-muted: oklch(57% .02 204);
  --orange: oklch(58% .17 46);
  --teal: oklch(43% .09 190);
  --green: oklch(45% .13 147);
  --green-dim: oklch(91% .045 147);
  --amber: oklch(58% .12 70);
  --amber-dim: oklch(91% .04 70);
  --red: oklch(52% .16 28);
  --font: 'Azeret Mono', monospace;
  --font-ui: 'Albert Sans', sans-serif;
  --font-display: 'Hedvig Letters Serif', Georgia, serif;
  --font-reading: 'Hedvig Letters Serif', Georgia, serif;
}

html { scroll-behavior: smooth; background: var(--bg); }
body { background: var(--bg); }
.app-page { min-height: 100dvh; height: auto; overflow: visible; }
.topbar { position: sticky; top: 0; z-index: 60; background: color-mix(in oklch, var(--surface) 94%, transparent); box-shadow: 0 1px 0 var(--border); }
.product-main { overflow: visible; }
.topbar-search input, input, textarea, select { background: var(--surface); }
.btn { min-height: 42px; padding: 9px 13px; background: var(--surface); color: var(--text-dim); }
.btn-primary { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.btn-primary:hover { background: color-mix(in oklch, var(--green-dim) 72%, var(--green)); color: oklch(25% .08 147); }

.library-hero {
  max-width: 1520px; margin: 0 auto; padding: clamp(42px, 7vw, 112px) clamp(16px, 4vw, 64px) clamp(52px, 7vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); align-items: center; gap: clamp(42px, 7vw, 112px);
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 80% 28%, oklch(91% .055 190 / .55), transparent 30%);
}
.hero-copy { max-width: 780px; }
.hero-copy h1 { max-width: 12ch; margin-top: 18px; color: var(--text); font-family: var(--font-display); font-size: clamp(48px, 7vw, 104px); font-weight: 400; letter-spacing: -.065em; line-height: .96; text-wrap: balance; }
.hero-copy > p:nth-of-type(2) { max-width: 62ch; margin-top: 28px; color: var(--text-dim); font-size: clamp(16px, 1.45vw, 20px); line-height: 1.65; text-wrap: pretty; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 32px; }
.hero-actions a { min-height: 44px; display: inline-flex; align-items: center; color: var(--teal); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--teal) 35%, transparent); text-underline-offset: 5px; }
.hero-actions .hero-primary { padding: 10px 15px; border: 1px solid var(--orange); background: var(--orange); color: var(--surface); text-decoration: none; }
.hero-actions .hero-primary:hover { transform: translateY(-2px); }
.hero-principle { max-width: 68ch; margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted) !important; font-family: var(--font-display); font-size: 14px !important; line-height: 1.65 !important; }
.hero-principle strong { color: var(--text); font-weight: 400; }

.random-book { width: min(100%, 420px); justify-self: center; transition: opacity 180ms ease, transform 220ms cubic-bezier(.16,1,.3,1); }
.random-book.is-changing { opacity: .2; transform: translateY(5px); }
.random-book-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; color: var(--teal); font-family: var(--font); font-size: 10px; letter-spacing: .1em; }
.random-book-label button { min-width: 44px; min-height: 44px; color: var(--orange); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.random-book-cover { position: relative; display: block; width: min(72%, 280px); margin: 0 auto; aspect-ratio: 2 / 3; background: var(--surface-hi); box-shadow: 18px 24px 0 color-mix(in oklch, var(--teal) 14%, transparent); }
.random-book-cover::after { content: ""; position: absolute; inset: 0; border: 1px solid color-mix(in oklch, var(--text) 25%, transparent); pointer-events: none; }
.random-book-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.random-book-copy { margin-top: 28px; text-align: center; }
.random-book-copy > p { color: var(--teal); font-family: var(--font); font-size: 9px; letter-spacing: .1em; }
.random-book-copy h2 { max-width: 24ch; margin: 8px auto 0; color: var(--text); font-family: var(--font-display); font-size: clamp(25px, 3vw, 38px); font-weight: 400; letter-spacing: -.035em; line-height: 1.1; text-wrap: balance; }
.random-book-copy > span { display: block; margin-top: 7px; color: var(--text-dim); font-size: 13px; }
.random-book-copy > a { min-height: 44px; margin-top: 15px; display: inline-flex; align-items: center; color: var(--orange); font-size: 13px; font-weight: 600; }

.collection-heading { scroll-margin-top: 92px; max-width: 1520px; margin: 0 auto; padding-top: clamp(42px, 6vw, 80px); }
.collection-heading h2 { font-weight: 400; }
.alphabet-jump { position: sticky; top: 68px; z-index: 45; max-width: 1520px; margin: 0 auto 38px; padding: 11px 0; display: flex; gap: 2px; overflow-x: auto; background: color-mix(in oklch, var(--bg) 95%, transparent); border-block: 1px solid var(--border); scrollbar-width: none; }
.alphabet-jump a { flex: 1 0 37px; min-width: 37px; min-height: 37px; display: grid; place-items: center; color: var(--text-muted); font-family: var(--font); font-size: 10px; }
.alphabet-jump a:hover, .alphabet-jump a:focus-visible { background: var(--teal); color: var(--surface); }
.alphabet-catalog { max-width: 1520px; margin: 0 auto; }
.alphabet-shelf { scroll-margin-top: 130px; display: grid; grid-template-columns: clamp(70px, 8vw, 120px) minmax(0, 1fr); gap: clamp(20px, 4vw, 64px); padding: 0 0 clamp(58px, 8vw, 100px); }
.alphabet-shelf > header { position: sticky; top: 130px; align-self: start; padding-top: 3px; }
.alphabet-shelf > header h3 { color: var(--orange); font-family: var(--font-display); font-size: clamp(58px, 8vw, 110px); font-weight: 400; line-height: .8; }
.alphabet-shelf > header span { display: block; margin-top: 16px; color: var(--text-muted); font-family: var(--font); font-size: 9px; }
.alphabet-shelf .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: clamp(28px, 3vw, 52px) clamp(14px, 2vw, 28px); padding: 0; }
.book-tile { min-height: 44px; }
.book-tile .cover { border-color: var(--border); background: linear-gradient(135deg, var(--surface-hi), var(--surface)); }
.book-tile img { filter: saturate(.92); }
.tile-copy strong { font-weight: 400; }

.modal-backdrop { padding: clamp(8px, 3vw, 28px); background: oklch(28% .03 204 / .48); }
.book-modal { background: var(--surface); box-shadow: 0 28px 80px oklch(28% .03 204 / .26); }
.modal-cover-link { display: grid; gap: 8px; }
.modal-cover-link > span { color: var(--orange); font-size: 10px; text-decoration: underline; text-underline-offset: 4px; }
.source-intro, .source-edition-body > p:not(.source-edition-eyebrow) { color: var(--text-dim); }
.source-edition-body h2 { color: var(--text); font-family: var(--font-display); }
.source-edition-body dd { color: var(--text); }

.contribution-paths { display: grid; gap: 0; margin-top: 28px; border-top: 1px solid var(--border); }
.contribution-paths p { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contribution-paths strong { color: var(--teal); font-size: 12px; }
.contribution-paths span { color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.contribute-gate hr { width: 100%; height: 1px; margin: 26px 0 8px; border: 0; background: var(--border); }
.contribute-gate a { color: var(--teal); }
.source-finder { border-color: color-mix(in oklch, var(--teal) 42%, var(--border)); background: oklch(95% .025 190); }

.quick-finder { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end; gap: 16px; padding: clamp(22px, 4vw, 42px); border: 1px solid var(--border-hi); background: var(--surface); }
.quick-finder > div:first-child { align-self: start; }
.quick-finder > div:first-child span, .finder-account-note span, .finder-form-title span { color: var(--teal); font-family: var(--font); font-size: 9px; letter-spacing: .1em; }
.quick-finder h2, .finder-account-note h2, .finder-form-title h2 { margin-top: 7px; color: var(--text); font-family: var(--font-display); font-size: 25px; font-weight: 400; }
.quick-finder > div:first-child p, .finder-account-note p { max-width: 45ch; margin-top: 8px; color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.quick-finder label { display: grid; gap: 7px; color: var(--text-dim); font-size: 12px; }
.quick-finder label small { color: var(--text-muted); font-size: 10px; }
.quick-finder input { min-height: 44px; padding: 10px 12px; border-color: var(--border-hi); font-size: 15px; }
.quick-finder button { min-height: 44px; white-space: nowrap; }
#quick-finder-status { grid-column: 1 / -1; min-height: 20px; color: var(--text-dim); font-size: 12px; }
#quick-finder-results { grid-column: 1 / -1; display: grid; }
.quick-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 15px 0; border-top: 1px solid var(--border); }
.quick-result > div { min-width: 0; display: grid; gap: 4px; }
.quick-result strong { overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.quick-result span { color: var(--teal); font-size: 11px; }
.quick-result small { color: var(--text-muted); font-size: 10px; }
.quick-result > a { min-height: 44px; display: inline-flex; align-items: center; color: var(--orange); font-size: 12px; font-weight: 600; }
.finder-account-note { margin-top: 34px; padding: clamp(22px, 4vw, 42px); display: flex; align-items: end; justify-content: space-between; gap: 30px; background: var(--surface-hi); }
.finder-account-note > div:last-child { display: flex; align-items: center; gap: 20px; }
.finder-account-note > div:last-child > a:last-child { color: var(--teal); }
.finder-form { margin-top: 42px; }
.finder-form-title { display: block !important; }

@media (max-width: 900px) {
  .library-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, .58fr); gap: 38px; }
  .quick-finder { grid-template-columns: 1fr 1fr; }
  .quick-finder > div:first-child, .quick-finder button { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar { gap: 8px 12px; }
  .topbar-join { display: none; }
  .library-hero { grid-template-columns: 1fr; padding-top: 42px; }
  .hero-copy h1 { font-size: clamp(46px, 15vw, 74px); }
  .random-book { width: min(100%, 330px); }
  .random-book-cover { width: min(68vw, 230px); }
  .alphabet-jump { top: 112px; }
  .alphabet-shelf { grid-template-columns: 1fr; gap: 22px; }
  .alphabet-shelf > header { position: static; display: flex; align-items: baseline; gap: 14px; }
  .alphabet-shelf > header h3 { font-size: 64px; }
  .alphabet-shelf > header span { margin-top: 0; }
  .alphabet-shelf .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 13px; }
  .collection-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .quick-finder { grid-template-columns: 1fr; }
  .quick-finder > * { grid-column: 1 !important; }
  .finder-account-note { align-items: flex-start; flex-direction: column; }
  .finder-account-note > div:last-child { align-items: flex-start; flex-direction: column; }
  .quick-result { align-items: start; grid-template-columns: 1fr; }
  .quick-result > a { justify-self: start; }
}

/* Alexandrian identity: carved glyph, archival display face, living collection. */
:root {
  --font: 'Commissioner', 'Segoe UI', sans-serif;
  --font-ui: 'Commissioner', 'Segoe UI', sans-serif;
  --font-display: 'Faculty Glyphic', Georgia, serif;
  --font-reading: 'Faculty Glyphic', Georgia, serif;
}

body {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-kerning: normal;
}

button, input, textarea, select { font-family: var(--font-ui); }
.logo { align-items: center; gap: 10px; }
.logo-cartouche {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 39px;
  border: 1px solid var(--teal);
  border-radius: 48% 48% 44% 44%;
  color: var(--orange);
}
.logo-cartouche::before,
.logo-cartouche::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 1px;
  background: color-mix(in oklch, var(--teal) 52%, transparent);
}
.logo-cartouche::before { top: 4px; }
.logo-cartouche::after { bottom: 4px; }
.logo-glyph {
  position: absolute;
  font-family: 'Noto Sans Egyptian Hieroglyphs', sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(3px) scale(.92);
  animation: glyphCycle 12s cubic-bezier(.22, 1, .36, 1) infinite;
}
.logo-glyph:nth-child(2) { animation-delay: 3s; }
.logo-glyph:nth-child(3) { animation-delay: 6s; }
.logo-glyph:nth-child(4) { animation-delay: 9s; }
.logo-mark {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: .095em;
}
.logo-count { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }

@keyframes glyphCycle {
  0%, 20% { opacity: 1; transform: translateY(0) scale(1); }
  25%, 95% { opacity: 0; transform: translateY(-3px) scale(.92); }
  100% { opacity: 0; transform: translateY(3px) scale(.92); }
}

.hero-copy { max-width: 850px; }
.hero-tool-line {
  max-width: 31ch !important;
  margin-top: 28px !important;
  color: var(--teal) !important;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 2.05rem) !important;
  line-height: 1.24 !important;
  text-wrap: balance;
}
.hero-copy h1 {
  max-width: 14ch;
  margin-top: 22px;
  font-size: clamp(3.2rem, 7vw, 7rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .94;
}
.hero-count {
  display: inline-block;
  min-width: 2.7ch;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.hero-manifesto {
  max-width: 35ch !important;
  margin-top: 26px !important;
  color: var(--text) !important;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.75rem) !important;
  line-height: 1.32 !important;
}
.hero-manifesto strong { font-weight: 400; color: var(--orange); }
.hero-principle {
  max-width: 62ch;
  margin-top: 42px;
  color: var(--text) !important;
  font-family: var(--font-ui);
  font-size: .92rem !important;
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1.65 !important;
  text-transform: uppercase;
}
.hero-principle strong { font-weight: 600; }
.hero-wink { display: inline-block; font-size: 1.05rem; transform: translateY(1px); }
.alexandria-note {
  max-width: 62ch;
  margin-top: 26px;
  border-block: 1px solid var(--border);
}
.alexandria-note summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-family: var(--font-display);
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
}
.alexandria-note summary::-webkit-details-marker { display: none; }
.alexandria-note summary::after { content: "𓂀"; color: var(--orange); font-family: 'Noto Sans Egyptian Hieroglyphs', sans-serif; transition: transform 240ms cubic-bezier(.25, 1, .5, 1); }
.alexandria-note[open] summary::after { transform: rotate(180deg); }
.alexandria-note p {
  max-width: 61ch;
  padding: 4px 0 22px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
}

.finder-head h1,
.finder-job-head h1 {
  font-size: clamp(3.25rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
}
.finder-head > p:last-child,
.finder-job-head p {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
}
.quick-finder h2,
.finder-account-note h2,
.finder-form-title h2,
.finder-item summary > strong,
.finder-candidate strong,
.quick-result strong { letter-spacing: -.015em; }

.finder-selection-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--text-dim);
  font-size: .86rem;
  line-height: 1.55;
  transition: background 220ms cubic-bezier(.25, 1, .5, 1), border-color 220ms cubic-bezier(.25, 1, .5, 1), color 220ms cubic-bezier(.25, 1, .5, 1);
}
.finder-selection-note > span { color: var(--text-muted); font-size: 1rem; }
.finder-selection-note strong { color: var(--text); }
.finder-selection-note.is-valid {
  border-color: color-mix(in oklch, var(--green) 58%, var(--border));
  background: var(--green-dim);
  color: oklch(33% .07 147);
}
.finder-selection-note.is-valid > span,
.finder-selection-note.is-valid strong { color: var(--green); }
.finder-credit-options {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 15px;
  border: 0;
}
.finder-credit-options.is-visible { display: flex; animation: creditReveal 260ms cubic-bezier(.25, 1, .5, 1) both; }
.finder-credit-options legend { width: 100%; margin-bottom: 7px; color: var(--text-dim); font-size: .78rem; }
.finder-credit-options label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .82rem; }
.finder-credit-options input { width: 17px; height: 17px; accent-color: var(--green); }
.finder-item form > .btn { margin-top: 16px; }
.finder-item form > .btn:disabled { cursor: not-allowed; opacity: .42; }

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

@media (max-width: 680px) {
  .logo { gap: 7px; }
  .logo-cartouche { width: 30px; height: 34px; }
  .logo-count { display: none; }
  .hero-copy h1 { font-size: clamp(3.35rem, 17vw, 5.4rem); }
  .hero-tool-line { max-width: 25ch !important; }
  .hero-principle { font-size: .78rem !important; }
  .finder-credit-options { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-glyph { animation: none; opacity: 0; transform: none; }
  .logo-glyph:first-child { opacity: 1; }
}
