:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #e9ece7;
  --ink: #171a17;
  --muted: #687068;
  --line: #d7dcd5;
  --accent: #28613f;
  --accent-ink: #164029;
  --accent-soft: #dcebe0;
  --danger: #ad3e35;
  --tier-s: #d8a63e;
  --tier-a: #5c9b75;
  --tier-b: #6d8fb0;
  --tier-c: #8f80ad;
  --tier-d: #9a7664;
  --shadow: 0 18px 50px rgba(33, 43, 34, .07);
  --radius: 14px;
  --page: min(1200px, calc(100vw - 48px));
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b0a;
  --surface: #121512;
  --surface-soft: #1b201c;
  --ink: #f0f3ed;
  --muted: #9ea79f;
  --line: #262d27;
  --accent: #8cc7a0;
  --accent-ink: #a7dab8;
  --accent-soft: #203a29;
  --danger: #ef8b81;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 132px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
code { font-size: .9em; }
.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-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 20; top: 0; display: flex; justify-content: space-between; align-items: center; min-height: 64px; padding: 0 max(24px, calc((100vw - 1200px) / 2)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; font-size: 20px; font-weight: 820; letter-spacing: -.06em; text-decoration: none; }
.brand span { color: var(--accent); }
.primary-nav { position: sticky; z-index: 19; top: 64px; display: flex; gap: 28px; margin: 16px 0 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg); scrollbar-width: thin; }
.primary-nav a { flex: none; padding: 14px 2px 13px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.primary-nav a.active, .primary-nav a:hover { border-color: var(--accent); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .outline-button, .text-button, .segmented button { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.icon-button, .outline-button { min-height: 36px; padding: 7px 11px; font-size: 11px; font-weight: 750; }
.outline-button:hover { border-color: var(--accent); color: var(--accent-ink); }
.primary-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 16px; border: 0; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 800; text-decoration: none; }
.primary-button:hover { opacity: .86; }
.text-button, .text-link { padding: 0; border: 0; background: transparent; color: var(--accent-ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.text-link:hover, .text-button:hover { text-decoration: underline; }

.page-shell { width: var(--page); margin: 0 auto; padding: 0 0 88px; }
.search-intro { max-width: 780px; padding: 48px 0 20px; }
.search-intro h1 { margin: 0; font: 500 clamp(36px, 5.4vw, 64px)/1.05 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.search-intro > p:last-child { max-width: 660px; margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.notice { min-height: 28px; padding: 8px 0 0; color: var(--muted); font-size: 11px; }
.notice[data-state="error"], .form-message[data-state="error"] { color: var(--danger); }
.notice:empty { display: none; }
body[data-view]:not([data-view="discover"]) .search-intro,
body[data-view]:not([data-view="discover"]) #discover-search,
body[data-view]:not([data-view="discover"]) #demo-banner,
body[data-view]:not([data-view="discover"]) #preview-banner { display: none; }
body[data-view]:not([data-view="discover"]) .primary-nav { margin-top: 0; }

.view { display: none; min-height: 420px; padding-top: 24px; }
.view.active { display: block; animation: appear .2s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(3px); } }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin: 0 0 22px; }
.section-heading h1, .section-heading h2 { margin: 0; font: 500 clamp(27px, 3vw, 42px)/1.1 Georgia, serif; letter-spacing: -.04em; }
.section-heading p:not(.eyebrow) { max-width: 670px; margin: 7px 0 0; color: var(--muted); }
.subtle { color: var(--muted); font-size: 11px; }
.empty { grid-column: 1 / -1; padding: 48px 22px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.search-bar { display: flex; gap: 10px; margin: 0; }
.search-input { flex: 1; }
.search-bar input { min-height: 48px; font-size: 15px; }
.search-bar .primary-button, .search-bar .outline-button { min-height: 48px; padding-inline: 20px; font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--surface); }
input, select { min-height: 40px; padding: 8px 11px; }
textarea { min-height: 90px; padding: 10px 11px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-banner { margin-top: 16px; color: var(--muted); font-size: 12px; }
.preview-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.preview-banner[hidden] { display: none; }
.preview-banner p { margin: 0; color: var(--muted); font-size: 13px; }
.preview-banner .outline-button { flex: none; }
.selected-tags { display: flex; min-height: 0; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.selected-tags:empty { display: none; }
.selected-tags button { padding: 4px 8px; border: 0; border-radius: 20px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; font-weight: 700; }

.discover-layout { display: block; }
.filter-dialog { position: fixed; inset: 0 0 0 auto; width: min(430px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 24px; overflow: hidden; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: -18px 0 50px #0003; }
.filter-dialog[open] { display: flex; flex-direction: column; }
.filter-dialog::backdrop { background: #0009; }
.filter-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.filter-heading h2 { margin: 0; font: 500 28px Georgia, serif; }
.filter-heading .icon-button { min-width: 40px; font-size: 24px; line-height: 1; }
.filter-dialog > p { color: var(--muted); font-size: 13px; }
.tag-search { display: block; margin: 8px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.tag-search input { min-height: 44px; margin-top: 6px; font-size: 14px; }
#tag-summary { margin: 8px 0; }
.tag-cloud { display: flex; flex: 1; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; padding: 8px 2px; }
.tag-cloud button { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--muted); font-size: 12px; line-height: 1.25; }
.tag-cloud button:hover, .tag-cloud button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.tag-cloud small { font-size: 10px; }
.filter-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.catalogue-panel { min-width: 0; }
.results-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 14px; }
.results-toolbar h2 { margin: 0; font-size: 16px; }
.results-toolbar p { margin: 2px 0 0; }
.toolbar-controls { display: flex; gap: 8px; align-items: center; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.segmented button { min-height: 28px; padding: 5px 8px; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #00000010; }
.sort-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 750; }
.sort-control select { width: auto; min-height: 32px; padding: 4px 24px 4px 7px; font-size: 10px; }

.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; min-width: 0; padding: 12px; border-radius: 10px; background: var(--surface); }
.cover { display: block; width: 76px; height: 108px; border-radius: 6px; background: var(--surface-soft); object-fit: cover; }
.cover-empty { display: grid; place-items: center; color: var(--muted); font: 25px Georgia, serif; }
.result-main { min-width: 0; }
.result-top { display: flex; justify-content: space-between; gap: 8px; }
.result-title { display: -webkit-box; margin: 0; overflow: hidden; font-size: 14px; font-weight: 780; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.author, .alias { color: var(--muted); font-size: 11px; }
.alias { overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; }
.author { margin-top: 3px; font-weight: 650; }
.reason { display: -webkit-box; overflow: hidden; margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chips { display: flex; overflow: hidden; gap: 4px; margin: 6px 0; white-space: nowrap; }
.chip { padding: 3px 7px; border: 0; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.chip:hover { color: var(--accent-ink); }
.result-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.result-actions select { width: auto; min-height: 34px; padding: 5px 21px 5px 7px; font-size: 11px; }
.small-button { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 11px; font-weight: 700; }
.source { margin-left: auto; color: var(--accent-ink); font-size: 11px; text-decoration: none; }
.result details { grid-column: 1 / -1; margin-top: 7px; color: var(--muted); font-size: 10px; }
.result summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.results.grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.results.grid .result { display: block; padding: 12px; }
.results.grid .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; margin-bottom: 8px; }
.results.grid .reason, .results.grid .chips, .results.grid details, .results.grid .alias { display: none; }
.results.grid .result-actions { margin-top: 10px; }
.results.grid .source { display: none; }
.results.dense { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
.results.dense .result { display: block; padding: 5px; border-radius: 7px; }
.results.dense .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; margin-bottom: 5px; }
.results.dense .result-title { font-size: 12px; -webkit-line-clamp: 2; }
.results.dense .author { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.results.dense .reason, .results.dense .chips, .results.dense details, .results.dense .alias { display: none; }
.results.dense .result-actions { display: grid; grid-template-columns: 1fr; margin-top: 5px; }
.results.dense .result-actions .small-button, .results.dense .result-actions .source { display: none; }
.results.dense .result-actions select { width: 100%; min-height: 32px; padding-block: 4px; font-size: 11px; }
.pagination { display: flex; justify-content: center; gap: 12px; align-items: center; min-height: 70px; }

.status-filters { display: flex; max-width: 740px; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.status-filters button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.status-filters button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.library-book { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 9px; min-height: 102px; padding: 9px; border-radius: 9px; background: var(--surface); }
.library-book .cover { width: 50px; height: 74px; }
.library-book h3 { display: -webkit-box; overflow: hidden; margin: 0; font-size: 10px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.library-book p { margin: 4px 0; color: var(--muted); font-size: 8px; line-height: 1.3; }
.book-controls { display: flex; flex-wrap: wrap; gap: 4px; }
.book-controls select { width: auto; min-height: 25px; padding: 2px 20px 2px 5px; font-size: 8px; }
.book-controls button { min-height: 25px; }
.cache-button { position: absolute; right: 7px; bottom: 6px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 8px; }

.tierboard { display: grid; gap: 7px; }
.tier-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-height: 104px; overflow: hidden; border-radius: 10px; background: var(--surface); }
.tier-label { display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 900; }
.tier-row[data-tier="S"] .tier-label { background: var(--tier-s); }
.tier-row[data-tier="A"] .tier-label { background: var(--tier-a); }
.tier-row[data-tier="B"] .tier-label { background: var(--tier-b); }
.tier-row[data-tier="C"] .tier-label { background: var(--tier-c); }
.tier-row[data-tier="D"] .tier-label { background: var(--tier-d); }
.dropzone { display: flex; min-width: 0; min-height: 104px; flex-wrap: wrap; gap: 7px; align-content: center; padding: 9px; }
.dropzone.drag-over { background: var(--accent-soft); }
.tier-card { display: flex; width: 180px; min-height: 62px; gap: 7px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); cursor: grab; touch-action: none; }
.tier-card.dragging { opacity: .4; }
.tier-card .cover { width: 34px; height: 50px; }
.tier-card .card-name { display: -webkit-box; overflow: hidden; font-size: 9px; font-weight: 750; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.tier-card .suggested { color: var(--accent-ink); font-size: 7px; }
.tier-quick { display: none; }
.tier-card.cover-mode { position: relative; display: block; width: 66px; min-height: 98px; padding: 3px; }
.tier-card.cover-mode .cover { width: 100%; height: 96px; }
.tier-card.cover-mode .card-name { position: absolute; right: 5px; bottom: 5px; left: 5px; display: block; max-height: 29px; padding: 2px; overflow: hidden; border-radius: 3px; background: #000b; color: #fff; font-size: 7px; }

.analytics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.metric-card { min-height: 105px; padding: 14px; border-radius: 10px; background: var(--surface); }
.metric-card span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 8px; font: 500 28px Georgia, serif; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.chart-panel { padding: 18px; border-radius: 10px; background: var(--surface); }
.chart-panel h2 { margin: 0 0 16px; font-size: 13px; }
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 105px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 9px; }
.bar-track { height: 7px; overflow: hidden; border-radius: 5px; background: var(--surface-soft); }
.bar-value { height: 100%; min-width: 2px; border-radius: 5px; background: var(--accent); }
.storage-stack { display: flex; height: 18px; overflow: hidden; border-radius: 6px; background: var(--surface-soft); }
.storage-stack span:nth-child(1) { background: #5c9b75; }.storage-stack span:nth-child(2) { background: #6d8fb0; }.storage-stack span:nth-child(3) { background: #8f80ad; }.storage-stack span:nth-child(4) { background: #d8a63e; }.storage-stack span:nth-child(5) { background: #9a7664; }
.storage-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: var(--muted); font-size: 9px; }

.how-page { max-width: 1080px; margin-inline: auto; padding-top: 48px; }
.how-intro { max-width: 820px; margin-bottom: 42px; }
.how-intro h1 { max-width: 760px; margin: 0; font: 500 clamp(36px, 4.5vw, 56px)/1.08 Georgia, serif; letter-spacing: -.045em; }
.how-intro > p:last-child { max-width: 620px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.how-section { display: grid; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr); gap: 12px 46px; padding: 30px 0 36px; border-top: 1px solid var(--line); }
.how-section-heading { display: flex; gap: 20px; align-items: flex-start; }
.how-index { color: var(--accent-ink); font: 500 43px/1 Georgia, serif; letter-spacing: -.05em; }
.how-section-heading .eyebrow { margin: 2px 0 6px; }
.how-section-heading h2 { margin: 0; font: 500 27px/1.15 Georgia, serif; letter-spacing: -.035em; }
.how-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.how-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 16px; padding: 0 0 19px; }
.how-steps li + li { padding-top: 19px; border-top: 1px solid var(--line); }
.how-step-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 750; }
.how-steps h3 { margin: 1px 0 5px; font-size: 17px; line-height: 1.3; }
.how-steps p { max-width: 690px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.how-detail { grid-column: 2; margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-soft); color: var(--muted); font-size: 13px; line-height: 1.5; }
.how-detail strong { margin-right: 8px; color: var(--ink); }

.split-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.form-panel { display: grid; gap: 10px; padding: 18px; border-radius: 11px; background: var(--surface); }
.form-panel h2 { margin: 0; font-size: 14px; }
.form-panel p { margin: 0; color: var(--muted); font-size: 10px; }
.form-panel label, .modal-panel label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 750; }
.form-divider { height: 1px; margin: 7px 0; background: var(--line); }
.collection-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.collection-card { padding: 14px; border-radius: 10px; background: var(--surface); }
.collection-card h2 { margin: 0; font-size: 13px; }
.collection-card .byline { color: var(--muted); font-size: 9px; }
.collection-card p { min-height: 32px; color: var(--muted); font-size: 10px; }
.collection-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.account-panels, .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.catalogue-editor { grid-column: 1 / -1; }
.editor-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }.editor-heading span { color: var(--muted); font-size: 9px; }
.editor-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.profile-summary { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 12px; }
.profile-card { min-height: 190px; padding: 22px; border-radius: 11px; background: var(--surface); }
.profile-avatar { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font: 500 24px Georgia, serif; }
.profile-card h2 { margin: 12px 0 2px; }
.taste-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.taste-tags span { padding: 4px 7px; border-radius: 20px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.jobs-panel { display: grid; gap: 7px; margin-top: 18px; }
.job-row { display: grid; grid-template-columns: 110px 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.job-row code { max-height: 68px; overflow: auto; color: var(--muted); white-space: pre-wrap; }

.faq { padding-top: 42px; }
.faq > h2 { margin: 0 0 22px; font: 500 30px Georgia, serif; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.faq details { padding: 15px 0; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 12px; font-weight: 750; }
.faq details p { color: var(--muted); font-size: 11px; }
.site-footer { display: grid; grid-template-columns: auto 1fr auto; gap: 30px; align-items: center; width: var(--page); margin: 0 auto; padding: 28px 0 45px; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; justify-content: center; gap: 20px; }
.site-footer nav a, .site-footer p { color: var(--muted); font-size: 10px; text-decoration: none; }

.modal { position: fixed; z-index: 50; inset: 0; display: none; place-items: center; overflow: auto; padding: 18px; background: #0009; }
.modal.open { display: grid; }
.modal-panel { position: relative; display: grid; width: min(410px, 100%); gap: 11px; padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.modal-panel h2 { margin: 0; font: 500 25px Georgia, serif; }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 24px; }
.form-message { min-height: 18px; margin: 0; color: var(--muted); font-size: 10px; }
.recovery-code { display: block; overflow-wrap: anywhere; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--accent-ink); font: 700 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }
.discussion { width: min(620px, 100%); }
.discussion-list { display: grid; max-height: 300px; gap: 9px; overflow: auto; }
.review-entry { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 11px; }
.review-entry small { color: var(--muted); }
.collection-detail { width: min(850px, 100%); }
.collection-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 7px; }
.collection-detail-book { padding: 6px; border-radius: 7px; background: var(--bg); font-size: 9px; }
.collection-detail-book .cover { width: 100%; height: auto; aspect-ratio: 2 / 3; margin-bottom: 5px; }
.shared-tierboard .tier-row { grid-template-columns: 36px minmax(0,1fr); min-height: 90px; }
.shared-tierboard .dropzone { min-height: 90px; }
.shared-tierboard .collection-detail-book { width: 72px; cursor: grab; }
.shared-tierboard .collection-detail-book.dragging { opacity: .4; }
.comment-list { display: grid; max-height: 220px; gap: 6px; overflow: auto; margin-top: 12px; }
.comment { padding: 7px; border-radius: 6px; background: var(--bg); font-size: 10px; }
.error-page { display: grid; width: min(680px, calc(100vw - 40px)); min-height: 100vh; align-content: center; justify-items: start; margin: auto; }
.error-code { margin: 50px 0 0; color: var(--accent); font: 700 13px ui-monospace, monospace; }
.error-page h1 { margin: 10px 0; font: 500 clamp(42px, 7vw, 72px)/1 Georgia, serif; }
.error-page > p:not(.error-code) { margin: 0 0 28px; color: var(--muted); }
.skeleton { height: 80px; border-radius: 9px; background: linear-gradient(90deg, var(--surface-soft), var(--surface), var(--surface-soft)); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
.skeleton-grid { display: contents; }.skeleton-grid div, .skeleton.wide { min-height: 120px; border-radius: 9px; background: linear-gradient(90deg, var(--surface-soft), var(--surface), var(--surface-soft)); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

@media (max-width: 1120px) {
  :root { --page: calc(100vw - 40px); }
  .site-header { padding: 0 20px; }
  .results.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --page: calc(100vw - 28px); }
  .site-header { padding: 0 14px; }
  .primary-nav { top: 64px; gap: 20px; }
  .primary-nav a { padding: 12px 2px; font-size: 12px; }
  .header-actions { justify-self: end; }
  .search-intro { padding-top: 32px; }
  .search-intro h1 { font-size: clamp(36px, 8vw, 54px); }
  .results { grid-template-columns: 1fr; }
  .results.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout, .profile-summary { grid-template-columns: 1fr; }
  .how-section { grid-template-columns: 1fr; gap: 24px; }
  .how-detail { grid-column: 1; }
  .site-footer { grid-template-columns: 1fr; justify-items: center; padding-bottom: 36px; }
}

@media (max-width: 560px) {
  .how-page { padding-top: 32px; }
  .how-intro { margin-bottom: 32px; }
  .how-section { padding-block: 26px 32px; }
  .preview-banner { align-items: flex-start; flex-direction: column; }
  .search-bar { flex-wrap: wrap; }
  .search-input { flex-basis: 100%; }
  .search-bar .primary-button, .search-bar .outline-button { flex: 1; }
  .results-toolbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; justify-content: space-between; }
  .results.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-grid, .collection-list, .account-panels, .admin-grid, .chart-grid, .faq-grid, .editor-columns { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-filters { justify-content: flex-start; }
  .tier-row { grid-template-columns: 38px minmax(0, 1fr); }
  .tier-card { width: 145px; }
  .tier-card { position: relative; padding-bottom: 27px; }
  .tier-card .tier-quick { position: absolute; right: 5px; bottom: 4px; display: block; width: 42px; min-height: 20px; padding: 0 14px 0 4px; font-size: 8px; }
  .tier-card.cover-mode { padding-bottom: 24px; }
  .tier-card.cover-mode .cover { height: 73px; }
  .site-footer nav { flex-wrap: wrap; }
  .job-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
