:root {
  --bg: #f6f2ea;
  --panel: #fffaf2;
  --ink: #271f18;
  --muted: #665b50;
  --line: #d7c9b8;
  --accent: #6f3f24;
  --accent-dark: #442415;
  --tag: #efe3d3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.site-header, main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.site-header { padding: 34px 0 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 6px; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); margin-bottom: 4px; }
h3 { margin-bottom: 8px; }
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: Arial, sans-serif;
}
.intro, .meta, .empty, .carousel-count { color: var(--muted); }
.viewer-panel, .library-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(39,31,24,.08);
  margin-bottom: 28px;
  overflow: hidden;
}
.viewer-toolbar, .library-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
button, .actions a, .card-actions a {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 10px 13px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font: 700 .9rem Arial, sans-serif;
}
button:hover, .actions a:hover, .card-actions a:hover { background: var(--accent-dark); }
.pdf-frame-wrap {
  height: min(76vh, 820px);
  min-height: 520px;
  background: #2a2a2a;
}
.pdf-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pdf-frame-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #111;
}
.pdf-frame-wrap:fullscreen iframe { height: 100vh; }
.active-copy { padding: 24px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  background: var(--tag);
  border: 1px solid var(--line);
  color: var(--accent-dark);
  padding: 6px 10px;
  border-radius: 999px;
  font: 700 .78rem Arial, sans-serif;
}
.library-panel { padding-bottom: 20px; }
.search-label {
  min-width: min(420px, 100%);
  font: 700 .9rem Arial, sans-serif;
  color: var(--muted);
}
.search-label span { display: block; margin-bottom: 6px; }
.search-label input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 15px;
  font-size: 1rem;
  background: white;
}
.carousel-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  padding: 22px;
}
.carousel-nav {
  align-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 360px);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 18px;
}
.cards::-webkit-scrollbar { height: 10px; }
.cards::-webkit-scrollbar-track { background: var(--tag); border-radius: 999px; }
.cards::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.card {
  scroll-snap-align: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 310px;
}
.card.active {
  border-color: #6f3f24;
  box-shadow: 0 0 0 10px rgba(111,63,36,.32),0 12px 30px rgba(0,0,0,.12);
  transform: translateY(-3px);
}
.card h3 { font-size: 1.25rem; margin-bottom: 0; }
.card p { color: var(--muted); margin-bottom: 0; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.card-actions button, .card-actions a { padding: 8px 11px; font-size: .82rem; }
.carousel-count { padding: 0 22px; font: 700 .9rem Arial, sans-serif; }
.empty { padding: 0 22px; }
@media (max-width: 760px) {
  .viewer-toolbar, .library-header { flex-direction: column; }
  .actions { justify-content: flex-start; }
  .pdf-frame-wrap { min-height: 420px; height: 65vh; }
  .carousel-shell { grid-template-columns: 1fr; }
  .carousel-nav { display: none; }
  .cards { grid-auto-columns: minmax(260px, 86vw); }
}


.cards {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 18px;
}

.card {
  flex: 0 0 320px;
}