/* Ayer Flock Records — main stylesheet */

:root {
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --bg-sidebar: #1a1a1a;
  --bg-code: #f3f3ee;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-inverse: #f5f5f0;
  --text-inverse-muted: #a8a8a0;
  --border: #d8d8d0;
  --link: #1b4b7a;
  --link-hover: #2563a8;
  --accent-red: #a31515;
  --accent-amber: #b8860b;
  --accent-green: #2d7a3d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --sidebar-width: 260px;
  --max-content: 920px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Charter, Cambria, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  padding: 1.5rem 1.25rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
}

.main {
  margin-left: var(--sidebar-width);
  padding: 2.5rem 3rem;
  max-width: calc(var(--max-content) + 6rem);
  width: 100%;
}

/* === SIDEBAR === */

.sidebar-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #333;
  position: relative;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: -0.4rem;
  right: -0.25rem;
  background: transparent;
  border: 1px solid #444;
  color: var(--text-inverse);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
}

.sidebar-close:hover {
  background: #333;
  border-color: #666;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.sidebar-subtitle {
  font-size: 0.78rem;
  color: var(--text-inverse-muted);
  margin: 0.35rem 0 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar nav { display: flex; flex-direction: column; gap: 0.05rem; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.3;
  transition: background 0.1s, color 0.1s;
}

.sidebar nav a:hover { background: #2a2a2a; }

.sidebar nav a.active {
  background: #2563a8;
  font-weight: 600;
  color: #fff;
}

.sidebar nav a .nav-icon {
  flex-shrink: 0;
  flex-grow: 0;
  width: 16px;
  min-width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: opacity 0.1s;
}

.sidebar nav a:hover .nav-icon,
.sidebar nav a.active .nav-icon {
  opacity: 1;
}

/* Nested submenu (e.g. document subpages under "All Documents") */
.sidebar nav .nav-sub {
  margin: 0.1rem 0 0.25rem 0.95rem;
  padding-left: 0.65rem;
  border-left: 1px solid #2f2f2f;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.sidebar nav .nav-sub a {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  color: var(--text-inverse-muted);
}

.sidebar nav .nav-sub a:hover {
  color: var(--text-inverse);
}

.sidebar nav .nav-sub a.active {
  color: #fff;
}

.sidebar nav .nav-sub a .nav-icon {
  width: 13px;
  min-width: 13px;
  height: 13px;
  max-width: 13px;
  max-height: 13px;
  stroke-width: 1.6;
}

.sidebar-section-header {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-inverse-muted);
  margin: 1.1rem 0.75rem 0.3rem;
  font-weight: 700;
}

.sidebar-section-header:first-of-type {
  margin-top: 0.25rem;
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.78rem;
  color: var(--text-inverse-muted);
  line-height: 1.5;
}

.sidebar-footer a { color: var(--text-inverse); text-decoration: underline; }

/* === TYPOGRAPHY === */

h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
  line-height: 1.15;
}

h1 + .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.page-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 2rem 0;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.page-updated::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}

.page-updated time {
  color: var(--text);
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 0.75rem 0;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem 0;
}

h4 {
  font-size: 1rem;
  margin: 1rem 0 0.4rem 0;
  font-weight: 700;
}

p { margin: 0.75rem 0; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

.prose {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 70ch;
}

.prose p { margin: 0.85rem 0; }

/* === COMPONENTS === */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

.callout {
  border-left: 4px solid var(--link);
  background: #f0f6fb;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}

.callout.warn { border-color: var(--accent-amber); background: #fcf8e8; }
.callout.alert { border-color: var(--accent-red); background: #fbecec; }
.callout.ok { border-color: var(--accent-green); background: #ecf6ee; }

.callout strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }

.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.tag-ok { background: #ecf6ee; color: var(--accent-green); border-color: #b8d8be; }
.tag-warn { background: #fcf8e8; color: var(--accent-amber); border-color: #e0d090; }
.tag-bad { background: #fbecec; color: var(--accent-red); border-color: #e0b0b0; }
.tag-info { background: #eaf2f8; color: var(--link); border-color: #b0c8db; }

/* === TABLES === */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.93rem;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th {
  text-align: left;
  background: #f0eee8;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f7f2; }

td.date, th.date { white-space: nowrap; font-family: var(--font-mono); font-size: 0.85rem; }
td.amount, th.amount { text-align: right; font-family: var(--font-mono); }

/* === CODE === */

code {
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

pre {
  background: var(--bg-code);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

pre code { background: none; padding: 0; }

/* === TIMELINE === */

.timeline {
  position: relative;
  margin: 2rem 0;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 1.5rem 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.55rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--link);
}

.timeline-item.key::before { background: var(--accent-red); border-color: var(--accent-red); width: 13px; height: 13px; left: -1.7rem; }

.timeline-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.timeline-date-link {
  text-decoration: none;
}
.timeline-date-link .timeline-date {
  color: var(--link);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.timeline-date-link:hover .timeline-date {
  color: var(--link-hover);
  text-decoration-style: solid;
}

.timeline-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.3rem 0;
}

.timeline-body {
  font-size: 0.93rem;
  color: var(--text);
  margin: 0.2rem 0;
}

.timeline-cite {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.timeline-cite a { color: var(--text-muted); }

/* === DOCUMENT VIEWER === */

.doc-viewer-wrap {
  background: #2a2a2a;
  border-radius: 6px;
  padding: 0.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-lg);
}

.doc-viewer {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: none;
  background: #fff;
  border-radius: 4px;
  display: block;
}

/* Mobile PDF fallback: on small screens, iOS Safari and most mobile
   browsers can't render PDFs inside an <iframe> properly — they freeze on
   the first page and #page=N is ignored. We hide the iframe and show a
   prominent "Open PDF" button that uses the browser's native PDF handling. */
.doc-viewer-mobile-fallback {
  display: none;
  padding: 2rem 1.5rem;
  background: #2a2a2a;
  color: #f5f5f0;
  border-radius: 4px;
  text-align: center;
}

.doc-viewer-mobile-fallback p {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #c8c8c0;
}

.doc-viewer-mobile-fallback .btn {
  background: #ffd166;
  color: #1a1a1a;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

.doc-viewer-mobile-fallback .btn:hover {
  background: #ffdc8a;
  color: #1a1a1a;
}

@media (max-width: 800px) {
  .doc-viewer { display: none; }
  .doc-viewer-mobile-fallback { display: block; }
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.doc-meta dt { font-weight: 700; color: var(--text-muted); margin: 0; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; }
.doc-meta dd { margin: 0.15rem 0 0 0; }

.doc-meta-group { display: flex; flex-direction: column; }

/* === FIGURE / SCREENSHOT === */

figure {
  margin: 1.5rem 0;
  padding: 0.5rem;
  background: #f0eee8;
  border-radius: 6px;
  border: 1px solid var(--border);
}

figure img { display: block; max-width: 100%; height: auto; border-radius: 3px; box-shadow: var(--shadow); }

figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  font-style: italic;
}

/* === MONEY FLOW DIAGRAM === */

.flow {
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow-step {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  text-align: center;
  min-width: 280px;
  max-width: 100%;
  margin: 0.25rem 0;
  box-shadow: var(--shadow);
}

.flow-step.federal { border-color: #1b4b7a; background: #eaf2f8; }
.flow-step.state { border-color: #5d4b9e; background: #f0ecf8; }
.flow-step.local { border-color: #b8860b; background: #fcf8e8; }
.flow-step.vendor { border-color: #a31515; background: #fbecec; }
.flow-step.hardware { border-color: #2d7a3d; background: #ecf6ee; }

.flow-step strong { display: block; margin-bottom: 0.2rem; font-family: var(--font-sans); font-size: 0.95rem; }
.flow-step small { color: var(--text-muted); display: block; margin-top: 0.2rem; }

.flow-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
  margin: 0.1rem 0;
}

.flow-note {
  font-style: italic;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  margin: 0.25rem 0;
}

/* === HERO === */

.hero {
  margin: 0 0 2.5rem 0;
  padding: 2rem 0 1.5rem 0;
  border-bottom: 2px solid var(--border);
}

.hero-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-deck {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  max-width: 65ch;
}

/* === STAT CARDS === */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: block;
  line-height: 1.1;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
  display: block;
  font-weight: 600;
}

/* === RED FLAGS === */

.flag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-red);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  box-shadow: var(--shadow);
}

.flag.warn { border-left-color: var(--accent-amber); }
.flag.info { border-left-color: var(--link); }
.flag.ok { border-left-color: var(--accent-green); }

.flag-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.flag-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.flag-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
}

.flag-body { font-size: 0.93rem; line-height: 1.55; }

/* === MOBILE === */

.mobile-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 85%;
    max-width: 320px;
    padding-top: 1.25rem;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main { margin-left: 0; padding: 3.5rem 1.25rem 2rem; }
  .mobile-toggle { display: block; }
  /* Hide the hamburger toggle while the sidebar is open (otherwise it
     overlaps the sidebar header). The body class is toggled by main.js. */
  body.sidebar-open .mobile-toggle { display: none; }
  /* Subtle backdrop behind open sidebar so taps elsewhere close it */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9;
  }
  .hero h1 { font-size: 1.9rem; }
  table { font-size: 0.85rem; }
  .doc-viewer { height: 60vh; }
}

/* === HIGHLIGHT (visual evidence callout) === */

.highlight {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) 1fr;
  gap: 0;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
}

.highlight-image {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  position: relative;
}

.highlight-image a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  position: relative;
}

.highlight-image picture, .highlight-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.highlight-image a:hover img,
.highlight-image a:hover picture img { transform: scale(1.02); }

.highlight-image .zoom-hint {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.highlight-image a:hover .zoom-hint { opacity: 1; }

.highlight-body {
  padding: 1.5rem 1.75rem;
  color: #f5f5f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.highlight-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #ffd166;
  margin-bottom: 0.5rem;
}

.highlight-body h3 {
  color: #fff;
  margin: 0 0 0.65rem 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.highlight-body p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d5d5d0;
}

.highlight-body blockquote {
  margin: 0.65rem 0;
  padding: 0.5rem 0 0.5rem 0.85rem;
  border-left: 3px solid #ffd166;
  font-style: italic;
  color: #f0f0e8;
  font-size: 0.95rem;
}

.highlight-body a:not(.highlight-cta) { color: #9cc6ec; }

.highlight-cta {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  background: #ffd166;
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  align-self: flex-start;
}

.highlight-cta:hover { background: #ffdc8a; color: #1a1a1a; }

.highlight-source {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
}

@media (max-width: 700px) {
  .highlight { grid-template-columns: 1fr; }
  .highlight-image { min-height: 200px; }
}

/* === SUMMARY BLOCK (top-of-page conclusion) === */

.summary-block {
  position: relative;
  background: linear-gradient(180deg, #fbfaf4 0%, #f5f3ea 100%);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent-green);
  border-radius: 6px;
  padding: 1.25rem 1.5rem 1.1rem;
  margin: 0 0 2rem 0;
  box-shadow: var(--shadow);
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.6;
}

.summary-block .summary-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-green);
  color: #fff;
  border-radius: 3px;
}

.summary-block p {
  margin: 0;
  color: var(--text);
}

.summary-block strong {
  color: var(--text);
  font-weight: 700;
}

/* === PDF SIDEBAR VIEWER === */

.pdf-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60%;
  min-width: 520px;
  max-width: 1100px;
  background: #2a2a2a;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.22);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.25s ease-out;
  visibility: hidden;
}

.pdf-panel.open {
  transform: translateX(0);
  visibility: visible;
}

.pdf-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  background: #1a1a1a;
  color: var(--text-inverse);
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.pdf-panel-title {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-inverse);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pdf-panel-title .pdf-panel-page {
  color: #ffd166;
  font-weight: 700;
  margin-left: 0.5rem;
}

.pdf-panel-btn {
  background: transparent;
  border: 1px solid #444;
  color: var(--text-inverse);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: background 0.1s, border-color 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pdf-panel-btn:hover {
  background: #333;
  border-color: #666;
  color: var(--text-inverse);
}

.pdf-panel-btn.close {
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.3rem 0.65rem;
  font-weight: 700;
}

.pdf-panel-frame {
  flex: 1;
  border: none;
  background: #fff;
  width: 100%;
  min-height: 0;
}

.pdf-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out;
}

.pdf-panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 800px) {
  .pdf-panel { width: 100%; min-width: 0; max-width: none; }
}

/* === MISC === */

.subtle { color: var(--text-muted); font-size: 0.9rem; }

ul.tight, ol.tight { margin: 0.5rem 0; padding-left: 1.5rem; }
ul.tight li, ol.tight li { margin: 0.15rem 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--link);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.93rem;
  font-weight: 600;
  margin: 0.25rem 0.25rem 0.25rem 0;
}
.btn:hover { background: var(--link-hover); color: white; }
.btn.secondary { background: transparent; color: var(--link); border: 1px solid var(--link); }
.btn.secondary:hover { background: var(--link); color: white; }
