:root {
  --paper: #f6f4ef;
  --paper-deep: #efebe3;
  --card: #fbfaf7;
  --ink: #1a1815;
  --ink-2: #6b665e;
  --rule: #e2ddd2;
  --rule-strong: #c9c2b6;
  --accent: #9e5a45;
  --accent-text: #7d3a3f;
  --accent-soft: #eee7dc;
  --teal: #5d5850;
  --teal-soft: #efebe3;
  --gold: #9e5a45;
  --green: #5d7469;
  --shadow: 0 24px 64px rgba(26, 24, 21, 0.14);
  --display: "Newsreader", Georgia, serif;
  --mono: "Instrument Sans", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E"),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.app-shell {
  width: 100%;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 8px clamp(24px, 3vw, 56px);
  border-bottom: 3px double var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(18px);
}

.media-switch {
  display: inline-flex;
  justify-self: center;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 76%, transparent);
}

.save-status {
  display: inline-flex;
  min-width: 68px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.save-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

.save-status[data-status="saving"] .save-status-dot {
  background: var(--gold);
  animation: save-pulse 850ms ease-in-out infinite alternate;
}

.save-status[data-status="error"] {
  color: var(--accent-text);
}

.save-status[data-status="error"] .save-status-dot {
  background: var(--accent);
}

@keyframes save-pulse {
  to { opacity: 0.38; transform: scale(0.72); }
}

.media-switch button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.media-switch button small {
  display: grid;
  min-width: 22px;
  height: 19px;
  place-items: center;
  padding-inline: 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.media-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.media-switch button.is-active small {
  border-color: color-mix(in srgb, var(--paper) 30%, transparent);
  color: var(--paper);
}

.brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50% 50% 46% 54%;
  color: var(--accent-text);
  font-family: var(--display);
  font-size: 13px;
  font-variation-settings: "WONK" 1;
  transform: rotate(-5deg);
}

.brand-name {
  display: block;
  font-family: var(--display);
  font-size: clamp(25px, 2.3vw, 37px);
  font-weight: 630;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.brand-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.view-toggle,
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.view-toggle button,
.segmented button {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.view-toggle button.is-active,
.segmented button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.icon-button {
  display: grid;
  justify-self: end;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  font-family: var(--display);
  font-size: 18px;
  font-style: italic;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.provenance-popover {
  position: fixed;
  top: 66px;
  right: clamp(24px, 3vw, 56px);
  z-index: 90;
  width: min(390px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px 2px 22px 2px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.provenance-popover p {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.provenance-popover strong {
  color: var(--ink);
}

.provenance-popover .popover-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--display);
  font-style: italic;
}

.provenance-popover .removed-summary {
  padding: 12px;
  border: 1px dotted var(--rule-strong);
  background: color-mix(in srgb, var(--accent-soft) 38%, transparent);
}

main,
.footer {
  padding-inline: clamp(24px, 3vw, 56px);
}

.stat-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(250px, 1fr) minmax(300px, 1.35fr) minmax(280px, 1.1fr);
  gap: 12px;
  padding-block: 22px;
}

.stat-card {
  position: relative;
  min-height: 158px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  box-shadow: 0 6px 20px rgba(75, 55, 31, 0.04);
}

.stat-card:nth-child(1) {
  border-radius: 2px 2px 24px 2px;
}

.stat-card:nth-child(2) {
  border-radius: 2px 24px 2px 2px;
}

.stat-card:nth-child(3) {
  border-radius: 20px 2px 2px 2px;
}

.stat-card:nth-child(4) {
  border-radius: 2px 2px 2px 22px;
}

.eyebrow,
.filter-group legend,
.ledger-table th,
.detail-label {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.big-number {
  margin-top: 8px;
  font-family: var(--display);
  font-size: clamp(52px, 5vw, 78px);
  font-weight: 480;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.split-stat {
  display: flex;
  gap: 14px;
  margin-top: 13px;
  color: var(--ink-2);
  font-size: 12px;
}

.split-stat strong {
  color: var(--ink);
  font-family: var(--mono);
}

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

.card-heading p,
.genre-card p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 11px;
}

.quiet-button {
  padding: 3px 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.rating-chart,
.year-chart {
  display: flex;
  height: 92px;
  align-items: end;
  gap: clamp(5px, 1vw, 14px);
  margin-top: 8px;
}

.chart-bar-button {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 22px;
  flex: 1;
  align-items: end;
  justify-content: center;
  padding: 0 0 20px;
  background: transparent;
}

.chart-bar-button::after {
  position: absolute;
  right: 0;
  bottom: 16px;
  left: 0;
  height: var(--bar-height);
  min-height: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 75%, var(--ink));
  background: var(--accent);
  content: "";
  transform-origin: bottom;
}

.year-chart .chart-bar-button::after {
  border-color: color-mix(in srgb, var(--teal) 80%, var(--ink));
  background: var(--teal);
}

.chart-bar-button:hover::after,
.chart-bar-button[aria-pressed="true"]::after {
  filter: saturate(1.2);
  transform: scaleX(1.08);
}

.chart-bar-button[aria-pressed="false"].has-selection::after {
  opacity: 0.28;
}

.chart-bar-label {
  position: absolute;
  bottom: 0;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.chart-bar-count {
  position: absolute;
  bottom: calc(var(--bar-height) + 19px);
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0;
  transition: opacity 150ms;
}

.chart-bar-button:hover .chart-bar-count,
.chart-bar-button:focus-visible .chart-bar-count,
.chart-bar-button[aria-pressed="true"] .chart-bar-count {
  opacity: 1;
}

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.genre-chip,
.status-pill,
.active-filter {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
}

.genre-chip {
  gap: 6px;
  padding: 5px 6px 5px 9px;
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  color: var(--ink);
  font-size: 9px;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.genre-chip-count {
  display: inline-grid;
  min-width: 20px;
  height: 18px;
  padding-inline: 5px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.genre-chip:hover,
.genre-chip:focus-visible {
  border-color: var(--ink-2);
  background: var(--card);
  transform: translateY(-1px);
}

.genre-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.genre-chip[aria-pressed="true"] .genre-chip-count {
  background: color-mix(in srgb, var(--paper) 18%, transparent);
  color: var(--paper);
}

.genre-chip:disabled {
  cursor: default;
  opacity: 0.35;
  transform: none;
}

.library-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  padding-top: 8px;
  border-top: 3px double var(--rule-strong);
}

.filter-rail {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  padding: 16px 20px 24px 0;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  scrollbar-width: thin;
}

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

.search-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px 14px 2px 2px;
  background: var(--card);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.search-field svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field kbd {
  padding: 2px 5px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
}

.filter-group {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.filter-group legend {
  margin-bottom: 9px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

.segmented button {
  min-width: 0;
  padding-inline: 4px;
  font-size: 9px;
}

.facet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.facet-button {
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 3px 11px 3px 3px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}

.facet-button:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.facet-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.facet-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.filter-note {
  margin: 9px 0 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.45;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
}

.check-item::after {
  width: 15px;
  height: 15px;
  border: 1px solid var(--rule-strong);
  content: "";
}

.check-item[aria-pressed="true"] {
  color: var(--ink);
}

.check-item[aria-pressed="true"]::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper);
}

.results-panel {
  min-width: 0;
}

.results-header {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 91%, transparent);
  backdrop-filter: blur(18px);
}

.results-count {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 530;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.active-filter {
  gap: 5px;
  min-height: 25px;
  padding: 3px 8px;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  background: color-mix(in srgb, var(--accent-soft) 65%, transparent);
  color: var(--accent-text);
  font-size: 9px;
}

.active-filter:hover {
  border-color: var(--accent);
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.select-field select {
  min-height: 42px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--rule);
  border-radius: 3px 12px 3px 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

.mobile-toolbar {
  display: none;
}

.ledger-wrap {
  width: 100%;
  overflow: visible;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ledger-table th {
  position: sticky;
  top: 148px;
  z-index: 20;
  padding: 12px 10px;
  border-bottom: 3px double var(--rule-strong);
  background: var(--paper);
  text-align: left;
}

.ledger-table th:first-child,
.ledger-table td:first-child {
  padding-left: 0;
}

.ledger-table th.sortable {
  cursor: pointer;
}

.ledger-table th.sortable:hover {
  color: var(--accent-text);
}

.ledger-table td {
  height: 74px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.ledger-table tr[data-book-index] {
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}

.ledger-table tr[data-book-index]:hover,
.ledger-table tr[data-book-index]:focus-within {
  background: color-mix(in srgb, var(--accent-soft) 38%, transparent);
}

.ledger-table .title-column {
  width: auto;
}

.ledger-table .category-column,
.ledger-table .category-cell {
  width: 124px;
  max-width: 124px;
}

.category-cell-content {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.category-value,
.add-category-button,
.category-empty,
.book-card-category {
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-value,
.book-card-category {
  border-bottom: 1px dotted var(--rule-strong);
}

.category-value {
  max-width: 100%;
  padding: 3px 0;
  background: transparent;
  text-align: left;
}

.category-value:hover,
.category-value:focus-visible,
.add-category-button:hover,
.add-category-button:focus-visible {
  color: var(--accent-text);
}

.category-empty {
  color: var(--rule-strong);
  transition: opacity 150ms var(--ease);
}

.add-category-button {
  position: absolute;
  left: 0;
  padding: 3px 0;
  border-bottom: 1px dotted var(--rule-strong);
  background: transparent;
  font-size: 9px;
  opacity: 0;
  transition: color 150ms var(--ease), opacity 150ms var(--ease);
}

.ledger-table tr:hover .add-category-button,
.ledger-table tr:focus-within .add-category-button,
.add-category-button:focus-visible {
  opacity: 1;
}

.ledger-table tr:hover .category-empty,
.ledger-table tr:focus-within .category-empty {
  opacity: 0;
}

.category-input-inline {
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px dotted var(--accent);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.ledger-table .rating-column {
  width: 154px;
}

.ledger-table .status-column {
  width: 108px;
}

.ledger-table .date-column {
  width: 112px;
}

.ledger-table .review-column {
  width: 64px;
  text-align: center;
}

.title-cell-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.book-cover-thumb,
.book-card-cover {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 1px 7px 1px 1px;
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--card));
  color: var(--accent-text);
  font-family: var(--display);
}

.book-cover-thumb {
  width: 38px;
  height: 57px;
  font-size: 21px;
}

.book-cover-thumb img,
.book-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-button {
  display: -webkit-box;
  width: 100%;
  padding: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 520;
  line-height: 1.2;
  text-align: left;
}

.book-title-main {
  font-weight: inherit;
}

.book-author {
  color: var(--ink-2);
  font-family: var(--display);
  font-size: 0.88em;
  font-weight: 350;
}

.add-author-button {
  flex: 0 0 auto;
  padding: 3px 0;
  border-bottom: 1px dotted var(--rule-strong);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0;
  transition: color 150ms var(--ease), opacity 150ms var(--ease);
}

.ledger-table tr:hover .add-author-button,
.ledger-table tr:focus-within .add-author-button,
.add-author-button:focus-visible {
  opacity: 1;
}

.add-author-button:hover,
.add-author-button:focus-visible {
  color: var(--accent-text);
}

mark {
  border-bottom: 2px solid var(--accent);
  background: transparent;
  color: inherit;
}

.stars {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.rating-editor {
  position: relative;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  white-space: nowrap;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}

.rating-editor:hover,
.rating-editor:focus-visible {
  background: color-mix(in srgb, var(--gold) 9%, transparent);
}

.rating-star {
  display: inline-grid;
  width: 17px;
  height: 26px;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  transition: transform 150ms var(--ease), color 150ms var(--ease);
}

.rating-star:hover {
  color: color-mix(in srgb, var(--gold) 75%, white);
  transform: translateY(-1px) scale(1.18);
}

.rating-editor-number {
  min-width: 25px;
  margin-left: 4px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  text-align: left;
}

.rating-clear {
  display: grid;
  width: 20px;
  height: 24px;
  place-items: center;
  color: var(--ink-2);
  font-family: var(--mono);
  opacity: 0;
  transition: color 150ms var(--ease), opacity 150ms var(--ease);
}

.rating-editor:hover .rating-clear,
.rating-editor:focus-visible .rating-clear {
  opacity: 1;
}

.rating-clear:hover {
  color: var(--accent-text);
}

.local-edit-dot {
  width: 4px;
  height: 4px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--accent);
}

.rating-number,
.ledger-date {
  margin-left: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
}

.status-pill {
  min-height: 26px;
  padding: 4px 8px;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--rule));
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  color: var(--accent-text);
  font-size: 9px;
}

.status-pill.to-read {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--rule));
  background: var(--teal-soft);
  color: var(--teal);
}

.review-glyph {
  color: var(--accent-text);
  font-family: var(--display);
  font-size: 20px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.row-delete {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 16px;
  opacity: 0;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), opacity 150ms var(--ease);
}

.ledger-table tr:hover .row-delete,
.ledger-table tr:focus-within .row-delete,
.row-delete:focus-visible {
  opacity: 1;
}

.row-delete:hover,
.row-delete:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.card-ledger {
  display: none;
}

.spine-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
  gap: clamp(26px, 2.8vw, 46px) clamp(16px, 2vw, 30px);
  padding: 12px 0 0;
}

.spine {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.spine:hover,
.spine:focus-visible {
  color: var(--accent-text);
}

.book-cover-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 2px 15px 2px 2px;
  background: var(--spine-color);
  box-shadow: 0 11px 25px rgba(53, 37, 23, 0.14);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.book-cover-art::after {
  position: absolute;
  right: 23px;
  bottom: -8px;
  z-index: 2;
  width: 15px;
  height: 15px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.spine:hover .book-cover-art,
.spine:focus-visible .book-cover-art {
  border-color: var(--ink);
  box-shadow: 0 19px 38px rgba(53, 37, 23, 0.22);
  transform: translateY(-4px);
}

.book-cover-art img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  align-items: end;
  padding: 19px;
  color: #fff7e8;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 460;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.book-cover-copy {
  display: grid;
  gap: 4px;
  padding: 12px 1px 0;
}

.spine-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 590;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-align: left;
}

.book-cover-author {
  color: var(--ink-2);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 350;
}

.spine-rating {
  margin-top: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  min-height: 440px;
  place-items: center;
  text-align: center;
}

.empty-state-inner {
  max-width: 420px;
}

.empty-shelf {
  width: 150px;
  color: var(--rule-strong);
}

.empty-state h2 {
  margin: 18px 0 4px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 550;
}

.empty-state p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.5;
}

.text-button {
  padding: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-text);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: 48px;
  padding-block: 22px 34px;
  border-top: 3px double var(--rule-strong);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  text-transform: uppercase;
}

.footer p {
  max-width: 640px;
  margin: 0;
}

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

.movie-view {
  padding-top: 22px;
}

.movie-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, 0.8fr);
  min-height: 270px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 2px 26px 2px 2px;
  background: var(--ink);
  color: var(--paper);
}

.movie-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(30px, 5vw, 72px);
}

.movie-hero .eyebrow {
  color: color-mix(in srgb, var(--paper) 66%, transparent);
}

.movie-hero h1 {
  max-width: 980px;
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(48px, 6.8vw, 104px);
  font-variation-settings: "SOFT" 30, "WONK" 1;
  font-weight: 410;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

.movie-hero-copy > p {
  max-width: 700px;
  margin: 25px 0 0;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-size: 14px;
  line-height: 1.55;
}

.movie-marquee {
  display: grid;
  align-content: center;
  border-left: 1px dashed color-mix(in srgb, var(--paper) 35%, transparent);
  background: var(--accent);
}

.movie-marquee > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) 1fr;
  align-items: baseline;
  gap: 18px;
  padding: 20px clamp(28px, 3vw, 48px);
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
}

.movie-marquee > div:last-child {
  border-bottom: 0;
}

.movie-marquee strong {
  font-family: var(--display);
  font-size: clamp(42px, 4vw, 70px);
  font-weight: 430;
  letter-spacing: -0.06em;
  line-height: 0.8;
}

.movie-marquee span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.movie-toolbar {
  position: sticky;
  top: 72px;
  z-index: 28;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 13px 0;
  border-bottom: 3px double var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}

.movie-search-field {
  width: min(560px, 100%);
  margin: 0;
}

.movie-filter {
  display: flex;
  gap: 6px;
}

.movie-filter button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.movie-filter button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.movie-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0 16px;
}

.movie-history-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 3.2fr);
  gap: clamp(24px, 4vw, 70px);
  align-items: center;
  margin-top: 14px;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--rule-strong);
  border-radius: 2px 18px 2px 2px;
  background: var(--card);
}

.movie-history-copy h2 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: clamp(27px, 2.7vw, 42px);
  font-weight: 540;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.movie-history-copy p {
  max-width: 36ch;
  margin: 12px 0 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  text-transform: uppercase;
}

.movie-history-chart {
  min-width: 0;
}

.movie-history-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.movie-chart-baseline {
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.movie-chart-average {
  stroke: var(--ink-2);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  opacity: 0.52;
}

.movie-chart-average-label,
.movie-chart-value,
.movie-chart-year-label {
  fill: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.movie-chart-average-label {
  font-size: 9px;
  text-transform: uppercase;
}

.movie-chart-year rect {
  fill: color-mix(in srgb, var(--ink-2) 76%, transparent);
  transition: fill 180ms var(--ease), opacity 180ms var(--ease);
}

.movie-chart-year.is-peak rect,
.movie-chart-year:hover rect,
.movie-chart-year:focus rect {
  fill: var(--accent);
}

.movie-chart-year:focus {
  outline: none;
}

.movie-chart-year:focus .movie-chart-year-label,
.movie-chart-year.is-peak .movie-chart-value {
  fill: var(--accent-text);
}

.movie-results-heading p {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 225px), 1fr));
  gap: clamp(24px, 2.4vw, 42px) clamp(17px, 1.8vw, 30px);
}

.movie-ticket {
  position: relative;
  min-width: 0;
}

.movie-poster-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 2px 19px 2px 2px;
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--card));
  box-shadow: 0 12px 28px rgba(58, 42, 24, 0.11);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.movie-poster-button::before,
.movie-poster-button::after {
  position: absolute;
  right: 27px;
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper);
  content: "";
  transform: translateX(50%);
}

.movie-poster-button::before { top: -9px; }
.movie-poster-button::after { bottom: -9px; }

.movie-poster-button > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 360ms var(--ease), filter 240ms var(--ease);
}

.movie-poster-button:hover,
.movie-poster-button:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 20px 44px rgba(58, 42, 24, 0.18);
  transform: translateY(-4px);
}

.movie-poster-button:hover > img,
.movie-poster-button:focus-visible > img {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.025);
}

.movie-poster-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: end start;
  padding: 24px;
  background:
    radial-gradient(circle at 72% 22%, color-mix(in srgb, var(--accent) 34%, transparent) 0 12%, transparent 13%),
    linear-gradient(145deg, color-mix(in srgb, var(--ink) 92%, #40362e), var(--ink));
  color: var(--paper);
  text-align: left;
}

.movie-poster-fallback span {
  max-width: 10ch;
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 430;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.movie-poster-cue {
  position: absolute;
  right: 13px;
  bottom: 13px;
  z-index: 3;
  padding: 8px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 91%, transparent);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(5px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.movie-poster-button:hover .movie-poster-cue,
.movie-poster-button:focus-visible .movie-poster-cue {
  opacity: 1;
  transform: translateY(0);
}

.movie-ticket-body {
  min-width: 0;
  padding: 14px 2px 0;
}

.movie-title-button {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.movie-title-button span {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(21px, 1.6vw, 28px);
  font-weight: 590;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.movie-drawer-poster {
  display: block;
  width: 100%;
  max-height: 520px;
  margin-top: 20px;
  border: 1px solid var(--rule);
  border-radius: 2px 15px 2px 2px;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--card));
  object-fit: contain;
}

.movie-title-button:hover span,
.movie-title-button:focus-visible span {
  color: var(--accent-text);
}

.movie-card-date {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
  text-transform: uppercase;
}

.movie-rating {
  display: flex;
  min-height: 29px;
  align-items: center;
  gap: 1px;
  margin-top: 10px;
}

.movie-rating button {
  display: grid;
  width: 25px;
  height: 27px;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.movie-rating button:hover,
.movie-rating button:focus-visible {
  color: var(--accent-text);
  transform: scale(1.1);
}

.movie-rating .movie-rating-clear {
  width: 21px;
  margin-left: 3px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
}

.movie-rating-value {
  margin-left: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.movie-empty {
  grid-column: 1 / -1;
  min-height: 320px;
  padding: clamp(40px, 8vw, 110px);
  border: 1px dashed var(--rule-strong);
  text-align: center;
}

.movie-empty h2 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 520;
}

.movie-empty p {
  color: var(--ink-2);
}

.movie-drawer-title {
  text-transform: none;
}

.movie-drawer-meta {
  justify-content: space-between;
}

.movie-rating-drawer {
  margin-top: 0;
}

.movie-rating-drawer button {
  width: 35px;
  height: 42px;
  font-size: 25px;
}

.movie-rating-drawer .movie-rating-clear {
  width: 28px;
}

.movie-record-lede {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 2px 17px 2px 2px;
  background: color-mix(in srgb, var(--accent-soft) 33%, transparent);
}

.movie-record-date {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 540;
  letter-spacing: -0.025em;
}

.movie-record-lede p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
}

.movie-source-record dl {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
}

.movie-source-record dl > div {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--rule);
}

.movie-source-record dt {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.movie-source-record dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(19, 16, 14, 0.48);
  backdrop-filter: blur(2px);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 110;
  width: min(540px, 100vw);
  height: 100dvh;
  padding: 58px 32px 32px;
  overflow-y: auto;
  border-left: 1px solid var(--rule-strong);
  background: var(--card);
  box-shadow: -18px 0 60px rgba(34, 27, 20, 0.2);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.drawer-title {
  margin: 6px 0 12px;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1;
}

.book-drawer-cover-wrap {
  width: min(270px, 100%);
  margin: 22px 0 24px;
}

.book-drawer-cover-wrap a {
  color: inherit;
}

.book-drawer-cover {
  display: block;
  width: 100%;
  max-height: 430px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px 16px 2px 2px;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--card));
  box-shadow: 0 13px 30px rgba(53, 37, 23, 0.15);
  object-fit: contain;
}

.book-drawer-cover-wrap figcaption {
  margin-top: 8px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
  text-transform: uppercase;
}

.book-drawer-cover-wrap figcaption a {
  border-bottom: 1px dotted var(--rule-strong);
}

.drawer-author-inline {
  display: inline;
  font-size: 0.62em;
  letter-spacing: -0.02em;
}

.annotation-fields {
  display: grid;
  gap: 14px;
  margin: 18px 0 20px;
}

.author-field,
.category-field {
  display: grid;
  gap: 5px;
}

.local-input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px dotted var(--rule-strong);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 350;
}

.local-input:focus {
  border-bottom-color: var(--accent);
}

.local-input::placeholder {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding-bottom: 20px;
  border-bottom: 3px double var(--rule-strong);
}

.drawer-rating-wrap {
  display: grid;
  gap: 3px;
}

.rating-editor-drawer {
  min-height: 48px;
  margin-left: -6px;
  padding-inline: 6px;
}

.rating-editor-drawer .rating-star {
  width: 34px;
  height: 44px;
  font-size: 24px;
}

.rating-editor-drawer .rating-editor-number {
  min-width: 32px;
  font-size: 11px;
}

.rating-editor-drawer .rating-clear {
  width: 30px;
  height: 44px;
}

.local-edit-note,
.relative-date {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}

.book-profile {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 2px 18px 2px 2px;
  background: color-mix(in srgb, var(--paper) 34%, transparent);
}

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

.confidence-badge {
  padding: 4px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.confidence-badge.is-high {
  border-color: color-mix(in srgb, var(--teal) 38%, var(--rule));
  color: var(--teal);
}

.confidence-badge.is-low,
.confidence-badge.is-unverified {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  color: var(--accent-text);
}

.profile-release {
  margin-top: 18px;
}

.book-description {
  margin: 16px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
}

.profile-sources,
.profile-note {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
}

.profile-sources a {
  border-bottom: 1px dotted currentColor;
  color: var(--teal);
}

.profile-sources a:hover,
.profile-sources a:focus-visible {
  color: var(--accent-text);
}

.profile-note {
  padding-top: 12px;
  border-top: 1px dotted var(--rule);
  font-style: italic;
}

.export-record-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.export-record-heading > span,
.record-time,
.missing-value,
.empty-record-value {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}

.record-time {
  display: block;
  margin-top: 3px;
}

.missing-value,
.empty-record-value {
  font-style: italic;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-top: 22px;
}

.detail-value {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 12px;
}

.drawer-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.drawer-section h3 {
  margin: 3px 0 10px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 550;
}

.drawer-section blockquote {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
}

.empty-record-value {
  margin: 7px 0 0;
}

.remove-book-button {
  margin-top: 34px;
  padding: 10px 0;
  border-bottom: 1px dotted currentColor;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.remove-book-button:hover,
.remove-book-button:focus-visible {
  color: var(--accent-text);
}

.mobile-filter-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  max-height: 90dvh;
  padding: 12px 20px 0;
  overflow-y: auto;
  border-top: 1px solid var(--rule-strong);
  border-radius: 20px 20px 0 0;
  background: var(--card);
  box-shadow: 0 -18px 50px rgba(34, 27, 20, 0.2);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: var(--rule-strong);
}

.mobile-filter-sheet > header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-filter-sheet > header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
}

.mobile-filter-sheet > header .drawer-close {
  position: static;
}

.sheet-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
  margin: 24px -20px 0;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  background: var(--card);
}

.primary-button,
.secondary-button,
.mobile-filter-button {
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid var(--ink);
  border-radius: 3px 14px 3px 3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.primary-button {
  background: var(--ink);
  color: var(--paper);
}

.secondary-button {
  background: transparent;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: min(390px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px 16px 3px 3px;
  background: var(--ink);
  box-shadow: var(--shadow);
  color: var(--paper);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.4;
}

.toast-action {
  min-height: 32px;
  margin-left: 10px;
  padding: 3px 2px;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

body.night-circus {
  --paper: #14121c;
  --card: #1c1928;
  --ink: #ece7f4;
  --ink-2: #aaa3b9;
  --rule: #37324a;
  --rule-strong: #5a536e;
  --accent: #ff6b3d;
  --accent-text: #ff8c67;
  --accent-soft: #3b211f;
  --teal: #76bfb2;
  --teal-soft: #1b3434;
  --gold: #e0a82e;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

body.night-circus::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 22% 41%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.5px),
    radial-gradient(circle at 38% 7%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 11%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 83% 37%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.5px),
    radial-gradient(circle at 94% 9%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.5px);
  background-size: 190px 170px;
  content: "";
  opacity: 0.36;
}

body.night-circus .brand-name,
body.night-circus .big-number,
body.night-circus h1,
body.night-circus h2,
body.night-circus h3 {
  font-variation-settings: "SOFT" 45, "WONK" 1;
}

.is-highlighted {
  animation: highlight-pulse 1.2s var(--ease);
}

@keyframes highlight-pulse {
  0%, 100% { background: transparent; }
  35% { background: var(--accent-soft); }
}

@media (prefers-reduced-motion: no-preference) {
  .stat-card {
    animation: reveal 500ms var(--ease) both;
  }

  .stat-card:nth-child(2) { animation-delay: 60ms; }
  .stat-card:nth-child(3) { animation-delay: 120ms; }
  .stat-card:nth-child(4) { animation-delay: 180ms; }

  .chart-bar-button::after {
    animation: grow-bar 520ms var(--ease) both;
  }

  .detail-drawer:not([hidden]) {
    animation: drawer-in 240ms var(--ease) both;
  }

  .mobile-filter-sheet:not([hidden]) {
    animation: sheet-in 240ms var(--ease) both;
  }

  .toast:not([hidden]) {
    animation: toast-in 250ms var(--ease) both;
  }

  body.night-circus::before {
    animation: twinkle 4s ease-in-out infinite alternate;
  }
}

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

@keyframes grow-bar {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

@keyframes twinkle {
  from { opacity: 0.22; transform: translateY(0); }
  to { opacity: 0.44; transform: translateY(4px); }
}

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

  .library-view {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    display: none;
  }

  .mobile-toolbar {
    display: block;
    padding: 10px 0 0;
  }

  .mobile-filter-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-color: var(--rule-strong);
    background: var(--card);
  }

  .filter-badge {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 9px;
  }

  .ledger-table .updated-column {
    display: none;
  }

  .results-header {
    top: 72px;
  }

  .ledger-table th {
    top: 148px;
  }

  .movie-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  }

  .movie-hero-copy {
    padding: 42px;
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  }
}

@media (max-width: 900px) {
  .movie-hero {
    grid-template-columns: 1fr;
  }

  .movie-marquee {
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px dashed color-mix(in srgb, var(--paper) 35%, transparent);
    border-left: 0;
  }

  .movie-marquee > div {
    grid-template-columns: 1fr;
    gap: 8px;
    border-right: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
    border-bottom: 0;
  }

  .movie-marquee > div:last-child {
    border-right: 0;
  }

  .movie-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .movie-sort-field {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  .ledger-table .category-column,
  .ledger-table .category-cell {
    width: 96px;
    max-width: 96px;
  }

  .ledger-table .rating-column {
    width: 136px;
  }

  .ledger-table .status-column {
    width: 92px;
  }

  .ledger-table .date-column {
    width: 90px;
  }

  .ledger-table .review-column {
    width: 46px;
  }

  .ledger-table td,
  .ledger-table th {
    padding-inline: 6px;
  }
}

@media (max-width: 767px) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr) 24px 44px;
  }

  .masthead {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 62px;
    padding-inline: 16px;
    backdrop-filter: none;
  }

  .brand-mark,
  .brand-subtitle {
    display: none;
  }

  .brand-name {
    font-size: 21px;
    letter-spacing: -0.055em;
  }

  .media-switch {
    justify-self: center;
  }

  .media-switch button {
    min-height: 34px;
    gap: 5px;
    padding: 6px 8px;
    font-size: 8px;
  }

  .media-switch button small {
    min-width: 18px;
    height: 17px;
    padding-inline: 3px;
    font-size: 7px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .save-status {
    min-width: 20px;
  }

  .save-status span:last-child {
    display: none;
  }

  .provenance-popover {
    top: 58px;
    right: 16px;
  }

  main,
  .footer {
    padding-inline: 16px;
  }

  .stat-strip {
    display: flex;
    margin-right: -16px;
    padding-block: 16px;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .stat-card {
    width: 78vw;
    min-width: 78vw;
    min-height: 150px;
    scroll-snap-align: start;
  }

  .count-card {
    width: 54vw;
    min-width: 54vw;
  }

  .big-number {
    font-size: 62px;
  }

  .results-header {
    position: static;
    display: block;
    min-height: auto;
    padding: 15px 0 12px;
  }

  .results-controls {
    display: none;
  }

  .ledger-wrap {
    display: none;
  }

  .card-ledger {
    display: grid;
    gap: 8px;
  }

  .book-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-height: 104px;
    padding: 15px 0;
    border-bottom: 1px solid var(--rule);
    background: transparent;
    text-align: left;
  }

  .book-card-cover {
    width: 54px;
    height: 81px;
    font-size: 25px;
  }

  .book-card-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-family: var(--display);
    font-size: 19px;
    font-weight: 540;
    line-height: 1.15;
  }

  .book-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .book-card-date {
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
  }

  .book-card-index {
    padding-top: 3px;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 9px;
  }

  .spine-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    min-height: 0;
    gap: 28px 14px;
    padding: 16px 0 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .spine {
    width: 100%;
    height: auto;
    min-width: 0;
  }

  .spine-title {
    font-size: 18px;
  }

  .detail-drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(86dvh, 760px);
    padding: 54px 20px 90px;
    border-top: 1px solid var(--rule-strong);
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

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

  .footer {
    display: grid;
  }

  .movie-view {
    padding-top: 16px;
  }

  .movie-hero {
    min-height: 0;
    border-radius: 2px 18px 2px 2px;
  }

  .movie-hero-copy {
    padding: 34px 24px 30px;
  }

  .movie-hero h1 {
    font-size: clamp(43px, 14vw, 66px);
  }

  .movie-hero-copy > p {
    margin-top: 18px;
    font-size: 12px;
  }

  .movie-marquee > div {
    min-width: 0;
    padding: 17px 12px;
  }

  .movie-marquee strong {
    font-size: 37px;
  }

  .movie-marquee span {
    font-size: 7px;
  }

  .movie-toolbar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0;
    backdrop-filter: none;
  }

  .movie-search-field {
    width: 100%;
  }

  .movie-filter {
    flex: 1;
  }

  .movie-filter button {
    flex: 1;
    padding-inline: 8px;
    font-size: 8px;
  }

  .movie-sort-field {
    width: 100%;
    justify-content: space-between;
  }

  .movie-sort-field select {
    min-width: 0;
    flex: 1;
  }

  .movie-results-heading {
    display: block;
    padding-top: 20px;
  }

  .movie-history-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 16px 17px;
  }

  .movie-history-chart {
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .movie-history-chart svg {
    width: 740px;
    max-width: none;
  }

  .movie-results-heading p {
    margin-top: 5px;
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 26px 14px;
  }

  .movie-ticket {
    min-height: 0;
  }

  .movie-ticket-body {
    padding: 12px 1px 0;
  }

  .movie-title-button span {
    font-size: 22px;
  }

  .movie-rating button {
    width: 23px;
  }

  .movie-rating-value {
    display: none;
  }

  .movie-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

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

  .spine {
    height: auto;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Sam Gaddis editorial system ------------------------------------------------ */

body {
  background: var(--paper);
  letter-spacing: -0.005em;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

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

.masthead {
  grid-template-columns: minmax(220px, 1fr) auto 88px 48px;
  min-height: 80px;
  gap: 24px;
  padding: 16px max(24px, 3vw);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
}

.brand {
  gap: 0;
}

.brand-name {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-switch,
.view-toggle,
.segmented {
  padding: 4px;
  border-color: var(--rule-strong);
  background: transparent;
}

.media-switch button,
.view-toggle button,
.segmented button {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.media-switch button small {
  min-width: 24px;
  height: 20px;
  border-color: currentColor;
  font-size: 9px;
}

.save-status {
  min-width: 88px;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.save-status-dot {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-color: var(--ink);
  font-size: 20px;
}

.icon-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.provenance-popover {
  top: 72px;
  right: max(24px, 3vw);
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border-color: var(--ink);
  border-radius: 0;
  background: var(--paper);
}

.provenance-popover p {
  font-size: 14px;
  line-height: 1.6;
}

main,
.footer {
  padding-inline: max(24px, 3vw);
}

.stat-strip {
  grid-template-columns: minmax(176px, 0.64fr) minmax(240px, 1fr) minmax(320px, 1.36fr) minmax(280px, 1.12fr);
  gap: 0;
  margin: 32px 0 40px;
  padding: 0;
  border: 1px solid var(--rule);
}

.stat-card,
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4) {
  min-height: 192px;
  padding: 24px;
  border: 0;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.stat-card:last-child {
  border-right: 0;
}

.eyebrow,
.filter-group legend,
.ledger-table th,
.detail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.big-number {
  margin-top: 8px;
  font-size: clamp(64px, 6vw, 96px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.split-stat {
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
}

.card-heading {
  gap: 16px;
}

.card-heading p,
.genre-card p {
  margin-top: 4px;
  font-size: 12px;
}

.rating-chart,
.year-chart {
  height: 112px;
  gap: clamp(4px, 0.8vw, 12px);
  margin-top: 8px;
}

.chart-bar-button {
  min-width: 20px;
  padding-bottom: 20px;
}

.chart-bar-button::after {
  bottom: 16px;
  border: 0;
  background: var(--accent);
}

.year-chart .chart-bar-button::after {
  border: 0;
  background: var(--ink-2);
}

.chart-bar-button:hover::after,
.chart-bar-button[aria-pressed="true"]::after {
  background: var(--accent-text);
  filter: none;
}

.chart-bar-label,
.chart-bar-count {
  font-size: 9px;
  font-weight: 500;
}

.genre-chips {
  gap: 8px;
  margin-top: 16px;
}

.genre-chip {
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px 4px 12px;
  background: transparent;
  font-size: 10px;
}

.genre-chip-count {
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
}

.genre-chip:hover,
.genre-chip:focus-visible {
  border-color: var(--ink);
  background: var(--paper-deep);
  transform: translateY(-2px);
}

.library-view {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  padding-top: 0;
  border-top: 1px solid var(--ink);
}

.filter-rail {
  top: 96px;
  max-height: calc(100vh - 112px);
  padding: 24px 24px 40px 0;
  scrollbar-width: none;
}

.filter-rail::-webkit-scrollbar {
  display: none;
}

.rail-heading {
  gap: 12px;
}

.search-field {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 48px;
  margin-top: 20px;
  padding: 0 12px;
  border-color: var(--rule-strong);
  border-radius: 0;
  background: transparent;
}

.search-field:focus-within {
  border-color: var(--ink);
  box-shadow: none;
}

.search-field svg {
  width: 20px;
  stroke-width: 1.5;
}

.search-field input {
  padding-block: 12px;
}

.search-field kbd {
  padding: 0 4px;
  border-radius: 0;
  font-size: 9px;
}

.filter-group {
  margin-top: 24px;
}

.filter-group legend {
  margin-bottom: 12px;
}

.facet-list {
  gap: 8px;
}

.facet-button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 10px;
}

.facet-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.filter-note {
  margin-top: 12px;
  font-size: 10px;
  line-height: 1.5;
}

.check-list {
  gap: 4px;
}

.check-item {
  min-height: 40px;
  gap: 8px;
  padding-block: 8px;
  font-size: 12px;
}

.check-item::after {
  width: 16px;
  height: 16px;
}

.results-header {
  top: 80px;
  min-height: 80px;
  gap: 24px;
  padding: 16px 0;
  border-bottom-color: var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
}

.results-count {
  font-size: 24px;
  font-weight: 500;
}

.active-filters {
  gap: 8px;
  margin-top: 8px;
}

.active-filter {
  min-height: 28px;
  padding: 4px 8px;
  border-color: var(--rule-strong);
  background: var(--paper-deep);
  color: var(--ink);
  font-size: 9px;
}

.results-controls {
  gap: 12px;
}

.select-field {
  gap: 8px;
  font-size: 9px;
}

.select-field select {
  min-height: 44px;
  padding: 0 36px 0 16px;
  border-color: var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
}

.ledger-table th {
  top: 160px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.ledger-table td {
  height: 72px;
  padding: 8px 12px;
}

.ledger-table tr[data-book-index]:hover,
.ledger-table tr[data-book-index]:focus-within {
  background: var(--paper-deep);
}

.title-cell-wrap {
  gap: 12px;
}

.book-cover-thumb,
.book-card-cover,
.book-cover-art,
.movie-poster-button,
.movie-drawer-poster,
.book-drawer-cover {
  border-radius: 0;
}

.book-cover-thumb {
  width: 40px;
  height: 60px;
  font-size: 20px;
}

.title-button {
  display: block;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.18;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.book-author {
  font-weight: 400;
}

.category-value,
.add-category-button,
.category-empty,
.book-card-category {
  font-size: 10px;
}

.rating-editor {
  min-height: 36px;
  padding: 4px;
}

.rating-star {
  width: 20px;
  height: 28px;
  font-size: 16px;
}

.rating-star:hover {
  color: var(--accent-text);
  transform: translateY(-2px);
}

.status-pill {
  min-height: 28px;
  border-color: var(--rule-strong);
  background: transparent;
  color: var(--accent-text);
}

.status-pill.to-read {
  border-color: var(--rule-strong);
  background: var(--paper-deep);
  color: var(--ink-2);
  font-size: 12px;
}

.row-delete {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.row-delete:hover,
.row-delete:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.spine-shelf {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 40px 24px;
  padding-top: 24px;
}

.book-cover-art {
  box-shadow: none;
}

.book-cover-art::after {
  display: none;
}

.spine:hover .book-cover-art,
.spine:focus-visible .book-cover-art {
  border-color: var(--accent-text);
  box-shadow: none;
  transform: translateY(-4px);
}

.book-cover-fallback {
  padding: 20px;
  font-size: 24px;
  font-weight: 500;
}

.book-cover-copy {
  gap: 4px;
  padding-top: 12px;
}

.spine-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.book-cover-author {
  font-size: 14px;
  font-weight: 400;
}

.footer {
  gap: 32px;
  margin-top: 64px;
  padding-block: 32px 48px;
  border-top: 1px solid var(--ink);
  font-size: 9px;
}

.movie-view {
  padding-top: 32px;
}

.movie-hero {
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 0.75fr);
  min-height: 360px;
  border-radius: 0;
  background: var(--ink);
}

.movie-hero-copy {
  padding: clamp(40px, 6vw, 80px);
}

.movie-hero h1 {
  max-width: 880px;
  margin-top: 16px;
  font-size: clamp(56px, 7vw, 104px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.movie-hero-copy > p {
  max-width: 680px;
  margin-top: 28px;
  font-size: 16px;
  line-height: 1.6;
}

.movie-marquee {
  border-left: 1px solid color-mix(in srgb, var(--paper) 28%, transparent);
  background: var(--accent-text);
}

.movie-marquee > div {
  gap: 24px;
  padding: 24px clamp(28px, 3vw, 48px);
  border-bottom-style: solid;
}

.movie-marquee strong {
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 500;
}

.movie-marquee span {
  font-size: 10px;
}

.movie-history-panel {
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 3.2fr);
  gap: 48px;
  margin-top: 24px;
  padding: 32px;
  border-color: var(--rule);
  border-radius: 0;
  background: transparent;
}

.movie-history-copy h2 {
  margin-top: 12px;
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 500;
}

.movie-history-copy p {
  margin-top: 16px;
  font-size: 10px;
  line-height: 1.6;
}

.movie-toolbar {
  top: 80px;
  gap: 24px;
  min-height: 80px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink);
  backdrop-filter: saturate(180%) blur(12px);
}

.movie-filter {
  gap: 8px;
}

.movie-filter button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 10px;
}

.movie-results-heading {
  gap: 24px;
  padding: 32px 0 20px;
}

.movie-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 48px 24px;
}

.movie-poster-button {
  box-shadow: none;
}

.movie-poster-button::before,
.movie-poster-button::after {
  display: none;
}

.movie-poster-button:hover,
.movie-poster-button:focus-visible {
  border-color: var(--accent-text);
  box-shadow: none;
  transform: translateY(-4px);
}

.movie-poster-fallback {
  padding: 24px;
  background: var(--ink);
}

.movie-poster-fallback span {
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 500;
}

.movie-ticket-body {
  padding: 16px 0 0;
}

.movie-title-button span {
  font-size: clamp(24px, 1.8vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.movie-card-date {
  margin-top: 8px;
  font-size: 9px;
}

.movie-rating {
  min-height: 32px;
  margin-top: 8px;
}

.movie-rating button {
  width: 28px;
  height: 28px;
  font-size: 20px;
}

.movie-record-lede,
.book-profile {
  padding: 24px;
  border-radius: 0;
  background: var(--paper-deep);
}

.scrim {
  background: color-mix(in srgb, var(--ink) 52%, transparent);
  backdrop-filter: blur(4px);
}

.detail-drawer {
  width: min(600px, 100vw);
  padding: 64px 40px 40px;
  border-left-color: var(--ink);
  background: var(--paper);
  box-shadow: -24px 0 64px rgba(26, 24, 21, 0.16);
}

.drawer-close {
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-color: var(--ink);
  font-size: 24px;
}

.drawer-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.drawer-title {
  margin: 8px 0 16px;
  font-size: clamp(40px, 4vw, 56px);
  font-weight: 500;
  line-height: 0.98;
}

.book-drawer-cover-wrap {
  width: min(280px, 100%);
  margin: 24px 0 28px;
}

.book-drawer-cover {
  box-shadow: none;
}

.annotation-fields {
  gap: 16px;
  margin: 20px 0 24px;
}

.local-input {
  font-size: 18px;
}

.drawer-meta {
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

.detail-grid {
  gap: 20px 24px;
  margin-top: 24px;
}

.drawer-section {
  margin-top: 32px;
  padding-top: 24px;
}

.drawer-section h3 {
  margin: 4px 0 12px;
  font-size: 28px;
  font-weight: 500;
}

.mobile-filter-sheet {
  padding: 16px 24px 0;
  border-radius: 0;
  background: var(--paper);
}

.primary-button,
.secondary-button,
.mobile-filter-button {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
}

.toast {
  right: 24px;
  bottom: 24px;
  padding: 16px 20px;
  border-radius: 0;
  font-size: 16px;
}

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

  .stat-card:nth-child(1),
  .stat-card:nth-child(3) {
    border-right: 1px solid var(--rule);
  }

  .stat-card:nth-child(2),
  .stat-card:nth-child(4) {
    border-right: 0;
  }

  .stat-card:nth-child(1),
  .stat-card:nth-child(2) {
    border-bottom: 1px solid var(--rule);
  }

  .results-header {
    top: 80px;
  }

  .ledger-table th {
    top: 160px;
  }
}

@media (max-width: 900px) {
  .movie-hero {
    grid-template-columns: 1fr;
  }

  .movie-marquee {
    border-top-style: solid;
  }

  .movie-history-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 767px) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr) 24px 40px;
    min-height: 80px;
    gap: 8px;
    padding-inline: 20px;
  }

  .brand-name {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  .media-switch {
    justify-self: end;
  }

  .media-switch button {
    min-height: 36px;
    padding: 8px;
    font-size: 9px;
  }

  .media-switch button small {
    min-width: 20px;
    height: 20px;
  }

  .save-status {
    min-width: 24px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  main,
  .footer {
    padding-inline: 20px;
  }

  .stat-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 24px 0 32px;
    padding: 0;
    overflow: visible;
  }

  .stat-card,
  .count-card {
    width: auto;
    min-width: 0;
    min-height: 168px;
  }

  .years-card,
  .genre-card {
    grid-column: 1 / -1;
  }

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .big-number {
    font-size: 64px;
  }

  .results-header {
    padding: 20px 0 16px;
  }

  .card-ledger {
    gap: 0;
  }

  .book-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 112px;
    padding: 16px 0;
  }

  .book-card-cover {
    width: 56px;
    height: 84px;
    font-size: 24px;
  }

  .book-card-title {
    display: block;
    font-size: 20px;
    font-weight: 500;
    overflow: visible;
    -webkit-line-clamp: unset;
  }

  .spine-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
    padding-top: 20px;
  }

  .detail-drawer {
    height: min(88dvh, 760px);
    padding: 64px 24px 88px;
    border-radius: 0;
  }

  .movie-view {
    padding-top: 24px;
  }

  .movie-hero {
    border-radius: 0;
  }

  .movie-hero-copy {
    padding: 40px 24px;
  }

  .movie-hero h1 {
    font-size: clamp(52px, 14vw, 72px);
  }

  .movie-hero-copy > p {
    margin-top: 20px;
    font-size: 14px;
  }

  .movie-marquee > div {
    padding: 20px 12px;
  }

  .movie-marquee strong {
    font-size: 40px;
  }

  .movie-toolbar {
    gap: 12px;
    padding: 16px 0;
  }

  .movie-history-panel {
    gap: 20px;
    padding: 24px 16px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
  }

  .movie-ticket-body {
    padding-top: 12px;
  }

  .movie-title-button span {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr) 44px;
  }

  .masthead {
    grid-template-columns: auto minmax(0, 1fr) 40px;
    padding-inline: 16px;
  }

  .save-status {
    display: none;
  }

  .brand-name {
    font-size: 18px;
  }

  .media-switch button {
    min-width: 0;
    padding-inline: 8px;
  }

  main,
  .footer {
    padding-inline: 16px;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .years-card,
  .genre-card {
    grid-column: 1;
    border-right: 0 !important;
    border-bottom: 1px solid var(--rule);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

  .movie-grid {
    gap-inline: 12px;
  }

  .movie-title-button span {
    font-size: 20px;
  }
}

/* Consumption: archival index refinement */
.stat-strip {
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.35fr) minmax(360px, 1.1fr);
}

.stat-card {
  min-height: 176px;
  padding: 24px;
}

.card-heading {
  min-height: 20px;
}

.genre-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin-top: 12px;
}

.genre-chip {
  min-width: 0;
  min-height: 36px;
  justify-content: space-between;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.genre-chip > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-chip-count {
  min-width: 24px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  text-align: right;
}

.genre-chip:hover,
.genre-chip:focus-visible,
.genre-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: transparent;
  color: var(--accent-text);
  transform: none;
}

.library-view {
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 32px;
}

.filter-rail {
  padding-right: 24px;
  border-right: 1px solid var(--rule);
}

.search-field {
  min-width: 0;
  margin-top: 16px;
}

.search-field input {
  min-width: 0;
}

.facet-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.facet-list-years {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}

.facet-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
}

.facet-button strong {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.facet-button:hover,
.facet-button:focus-visible {
  border-color: var(--ink);
  background: transparent;
  color: var(--accent-text);
}

.facet-button[aria-pressed="true"] {
  padding-inline: 12px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.facet-button[aria-pressed="true"] strong {
  color: var(--paper);
}

.genre-chip:active:not(:disabled),
.facet-button:active:not(:disabled) {
  transform: scale(0.98);
}

.ledger-table {
  table-layout: fixed;
}

.ledger-table .title-column {
  width: 48%;
}

.ledger-table .category-column {
  width: 16%;
}

.ledger-table .rating-column {
  width: 16%;
}

.ledger-table .date-column {
  width: 10%;
}

.ledger-table .row-action-column {
  width: 40px;
}

.ledger-table td,
.ledger-table th {
  padding-inline: 8px;
}

.title-button {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.category-value {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
}

.rating-display,
.movie-rating-readonly {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-text);
  font-size: 14px;
  white-space: nowrap;
}

.rating-display .rating-number {
  color: var(--ink-2);
  font-size: 10px;
}

.big-number,
.results-count,
.ledger-date,
.rating-number,
.genre-chip-count {
  font-variant-numeric: tabular-nums;
}

.annotation-fields-readonly > div {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.annotation-fields-readonly strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.mobile-sort-field {
  justify-content: space-between;
  margin-top: 24px;
}

.book-card-category,
.book-card-date {
  border: 0;
  background: transparent;
  color: var(--ink-2);
}

body[data-can-edit="false"] .save-status-dot {
  background: var(--ink-2);
}

.movie-view {
  padding-top: 0;
}

.movie-history-panel {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
  padding: 24px 0 18px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

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

  .library-view {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
  }

  .genre-card {
    grid-column: 1 / -1;
    border-top: 1px solid var(--rule);
    border-right: 0;
  }
}

@media (max-width: 767px) {
  .brand,
  .media-switch button,
  .icon-button,
  .view-toggle button,
  .genre-chip,
  .mobile-filter-sheet .facet-button {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .stat-strip {
    grid-template-columns: 1fr;
    margin-block: 20px 28px;
  }

  .stat-card,
  .years-card,
  .genre-card {
    grid-column: 1;
    min-height: 148px;
    padding: 20px;
    border-top: 0;
    border-right: 0 !important;
    border-bottom: 1px solid var(--rule);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

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

  .mobile-filter-sheet .facet-list {
    grid-template-columns: 1fr;
  }

  .mobile-filter-sheet .facet-list-years {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movie-history-panel {
    padding-block: 18px 12px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .movie-history-chart {
    min-width: 700px;
  }
}

@media (max-width: 480px) {
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .rating-chart,
  .year-chart {
    height: 88px;
  }
}

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