:root {
  --ink: #0d1426;
  --ink-soft: #1b2744;
  --navy: #16213e;
  --navy-glow: #22315c;
  --gold: #c9973c;
  --gold-soft: #e3b968;
  --cream: #f7f5ed;
  --cream-dim: #efece0;
  --text: #1c1f26;
  --text-muted: #5b6270;
  --border: #e3ded0;
  --danger: #b3413a;
  --success: #2f7a4f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(13, 20, 38, 0.08);
  --shadow-lift: 0 16px 36px rgba(13, 20, 38, 0.14);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--serif);
  background: var(--cream);
  color: var(--text);
  line-height: 1.65;
}
h1, h2, h3, h4, .brand-font {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* --- Small-caps gold overline label (section eyebrow) --- */
.overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}
.overline::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}
.overline.on-dark { color: var(--gold-soft); }

/* --- Header --- */
.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--navy-glow), var(--ink) 72%);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(201, 151, 60, 0.12);
}
.brand-mark img { width: 24px; height: 24px; object-fit: contain; display: block; }
.brand-text { color: #fff; font-family: var(--sans); font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.brand-text small { display: block; font-weight: 500; font-size: 0.66rem; color: #a9aec6; letter-spacing: 0.06em; text-transform: uppercase; }
nav.main-nav { display: flex; gap: 24px; align-items: center; }
nav.main-nav a { color: #dfe2f0; font-family: var(--sans); font-size: 0.92rem; font-weight: 600; padding: 4px 0; border-bottom: 2px solid transparent; }
nav.main-nav a:hover { color: var(--gold-soft); }
nav.main-nav a.active { border-bottom-color: var(--gold); color: #fff; }
nav.main-nav a.cta {
  background: var(--gold); color: var(--ink); padding: 9px 18px; border-radius: 20px; border-bottom: none;
}
nav.main-nav a.cta:hover { background: var(--gold-soft); color: var(--ink); }

/* --- Breadcrumb --- */
.breadcrumb {
  font-family: var(--sans); font-size: 0.82rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 4px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* --- Hero --- */
.hero {
  background: linear-gradient(160deg, var(--ink) 0%, var(--navy) 65%, var(--navy-glow) 100%);
  color: #fff;
  padding: 72px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(227,185,104,0.55) 0, rgba(227,185,104,0) 1.4px);
  background-size: 22px 22px;
  opacity: 0.12;
  pointer-events: none;
}
.hero .container { display: flex; align-items: center; gap: 48px; position: relative; z-index: 1; }
.hero-copy { flex: 1.3; }
.hero h1, .hero h2 { color: #fff; font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 0 0 16px; }
.hero h3 { color: #fff; font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-weight: 700; margin: 0 0 16px; }
.hero p.lede { color: #cfd3e6; font-size: 1.08rem; max-width: 540px; font-family: var(--sans); }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-avatar { flex: 1; text-align: center; display: flex; justify-content: center; }
.badge-circle {
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--navy-glow) 0%, var(--ink) 74%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 10px rgba(201, 151, 60, 0.07), 0 18px 40px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.badge-circle--lg { width: 260px; height: 260px; perspective: 900px; }
.badge-circle--lg img { width: 66%; }
.badge-circle--sm { width: 40px; height: 40px; flex-shrink: 0; }
.badge-circle--sm img { width: 62%; }
.badge-circle .pulse-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(227,185,104,0.35);
}
.badge-circle--lg img {
  animation: bart-sway 6s ease-in-out infinite;
  transform-style: preserve-3d;
  backface-visibility: visible;
}
@keyframes bart-sway {
  0%, 100% { transform: rotateY(-22deg); }
  50% { transform: rotateY(22deg); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-circle--lg img { animation: none; }
}
.hero-stats { display: flex; gap: 32px; margin-top: 28px; font-family: var(--sans); }
.hero-stats div strong { display: block; font-size: 1.65rem; color: var(--gold-soft); }
.hero-stats div span { font-size: 0.78rem; color: #b7bcd3; }

.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600;
  padding: 12px 24px; border-radius: 9px; border: none; cursor: pointer; font-size: 0.95rem;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-outline { background: transparent; border: 1.5px solid rgba(255,255,255,0.55); color: #fff; }
.btn-outline:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #922f29; }
.btn-sm { padding: 7px 15px; font-size: 0.85rem; border-radius: 7px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* --- Sections / cards --- */
section { padding: 52px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 1.5rem; }
.section-title .overline { margin-bottom: 0; }
.section-title-block { margin-bottom: 22px; }
.section-title-block h2 { margin: 0; font-size: 1.5rem; }
.topics-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.topic-chip {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  background: #fff; border: 1px solid var(--border); color: var(--navy);
  padding: 8px 16px; border-radius: 20px; transition: all 0.12s ease;
}
.topic-chip:hover { border-color: var(--gold); color: var(--ink); box-shadow: var(--shadow); }
.topic-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.qa-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column;
}
.qa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #d8cfb4; }
.badge {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  color: var(--navy); background: var(--cream-dim); padding: 4px 10px; border-radius: 12px; letter-spacing: 0.05em;
  align-self: flex-start; display: inline-block;
}
.qa-card h3 { font-size: 1.06rem; margin: 12px 0 8px; color: var(--ink); }
.qa-card p.excerpt { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 14px; font-family: var(--serif); flex: 1; }
.qa-card .meta { font-family: var(--sans); font-size: 0.76rem; color: var(--text-muted); display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--cream-dim); }

/* --- Numbered step explainer --- */
.steps-list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.step-item { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--gold-soft);
  font-family: var(--sans); font-weight: 700; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-body { font-family: var(--sans); }
.step-body strong { display: block; font-size: 0.92rem; color: var(--ink); margin-bottom: 2px; }
.step-body span { font-size: 0.83rem; color: var(--text-muted); }

/* --- CTA band --- */
.cta-band {
  background: linear-gradient(135deg, var(--ink), var(--navy));
  color: #fff; border-radius: var(--radius); padding: 40px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: 1.4rem; }
.cta-band p { color: #c7cbe0; margin: 0; font-family: var(--sans); font-size: 0.92rem; }

/* --- Sidebar / two-column detail layout --- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.sidebar-stack { display: flex; flex-direction: column; gap: 18px; }
.side-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); font-family: var(--sans);
}
.side-card h4 { margin: 0 0 12px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.filing-record dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 0.86rem; }
.filing-record dt { color: var(--text-muted); }
.filing-record dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.side-card .step-item + .step-item { margin-top: 0; }

/* --- Segmented control --- */
.segmented { display: inline-flex; background: var(--cream-dim); border-radius: 24px; padding: 4px; font-family: var(--sans); }
.segmented input { display: none; }
.segmented label {
  padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s ease;
}
.segmented input:checked + label { background: var(--ink); color: #fff; }

/* --- Forms --- */
.form-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); margin-bottom: 24px;
}
label { font-family: var(--sans); font-weight: 600; font-size: 0.87rem; display: block; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 0.95rem; margin-bottom: 16px; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,151,60,0.14); }
.help-text { font-family: var(--sans); font-size: 0.8rem; color: var(--text-muted); margin-top: -12px; margin-bottom: 16px; }
.field-error { color: var(--danger); font-size: 0.8rem; font-family: var(--sans); margin: -12px 0 14px; }

/* --- Flash messages --- */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); font-family: var(--sans); font-size: 0.9rem; margin-bottom: 16px; border-left: 3px solid transparent; }
.flash-success { background: #e6f4ea; color: var(--success); border-left-color: var(--success); }
.flash-danger { background: #fbe9e7; color: var(--danger); border-left-color: var(--danger); }
.flash-info, .flash-warning { background: #eef1fa; color: var(--navy); border-left-color: var(--navy); }

/* --- Q&A detail --- */
.qa-detail-question {
  font-family: var(--serif); font-size: 0.95rem; font-weight: 400; line-height: 1.75;
  margin: 4px 0 0; color: var(--ink); text-align: justify; text-justify: inter-word;
  white-space: pre-line; max-width: 760px;
}
/* Long-form question text (admin question detail, PDF-imported fact patterns):
   normal weight, readable line length, and preserved paragraph breaks —
   an h1's default bold/oversized styling doesn't work for multi-paragraph text. */
.qa-question-text {
  font-family: var(--sans); font-weight: 400; font-size: 1.05rem; line-height: 1.7;
  color: var(--ink); letter-spacing: normal; white-space: pre-line; max-width: 760px;
  margin: 10px 0 22px;
}
/* Public question card: mirrors .answer-block's card treatment (white,
   bordered, shadowed) so the question and BART's answer read as one
   cohesive Q&A unit rather than bare text sitting above a styled box. */
.question-block {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.question-byline { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-family: var(--sans); }
.question-byline b { font-size: 0.92rem; color: var(--ink); }
.question-byline .question-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.question-mark-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--cream-dim); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--navy);
}
.question-block .qa-detail-question { margin: 0; }
.question-body-row { display: flex; gap: 20px; align-items: flex-start; }
.question-image-box {
  flex-shrink: 0; width: 88px; height: 88px; border-radius: 50%;
  overflow: hidden; box-shadow: var(--shadow);
}
.question-image-box img { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) {
  .question-body-row { flex-direction: column; align-items: center; text-align: center; }
  .question-image-box { width: 72px; height: 72px; }
  .question-block .qa-detail-question { text-align: left; }
}

/* --- Comments (on the question and on BART's answer) --- */
.comments-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--cream-dim); font-family: var(--sans); }
.comments-heading { margin: 0 0 14px; font-size: 0.9rem; color: var(--ink); }
.comments-heading span { color: var(--text-muted); font-weight: 400; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--cream-dim); }
.comment-item:last-of-type { border-bottom: none; }
.comment-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.comment-meta strong { color: var(--ink); }
.comment-body { margin: 0; font-family: var(--serif); font-size: 0.92rem; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.comment-empty { font-size: 0.86rem; color: var(--text-muted); margin: 0 0 6px; }
.comment-form { margin-top: 18px; }
.comment-form-row { display: flex; gap: 12px; }
.comment-form-row input { flex: 1; min-width: 0; }
.comment-form textarea { resize: vertical; }
.comment-form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.help-text-inline { font-size: 0.76rem; color: var(--text-muted); }
.answer-block {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.answer-byline { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-family: var(--sans); }
.answer-byline b { font-size: 0.92rem; color: var(--ink); }
.answer-byline span { font-size: 0.78rem; color: var(--text-muted); display: block; }
.answer-body :first-child { margin-top: 0; }
.answer-body h1, .answer-body h2, .answer-body h3 { font-size: 1.1rem; }
.answer-body strong { color: var(--ink); }
.answer-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-family: var(--sans);
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.answer-body th, .answer-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.answer-body thead th { background: var(--cream-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.answer-body tbody tr:last-child td { border-bottom: none; }
.answer-body caption { font-size: 0.82rem; color: var(--text-muted); text-align: left; margin-bottom: 6px; }

/* --- Callouts --- */
.callout {
  font-family: var(--sans); font-size: 0.82rem; border-radius: var(--radius-sm);
  padding: 14px 16px; margin-top: 20px; display: flex; gap: 10px; align-items: flex-start;
}
.callout-amber { background: #fbf1de; border: 1px solid #ecd7a6; color: #7a5b1a; }
.callout-amber .callout-icon { color: #b3841f; }
.callout-danger { background: #fbe9e7; border: 1px solid #eec4bf; color: #7a2c26; }
.callout-danger .callout-icon { color: var(--danger); }
.callout .callout-icon { font-size: 1rem; line-height: 1.4; flex-shrink: 0; }

/* --- Reactions & share --- */
.engagement-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--cream-dim); }
.reactions { display: flex; gap: 8px; flex-wrap: wrap; }
.reaction-btn {
  font-family: var(--sans); border: 1px solid var(--border); background: #fff; border-radius: 20px;
  padding: 8px 14px; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.12s ease;
}
.reaction-btn:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.reaction-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.reaction-btn .count { font-weight: 700; }
.share-row { display: flex; gap: 8px; align-items: center; }
.share-row .share-label { font-family: var(--sans); font-size: 0.78rem; color: var(--text-muted); margin-right: 4px; }
.share-btn {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--cream-dim); border: 1px solid var(--border); cursor: pointer; font-size: 0.92rem;
  font-family: var(--sans); font-weight: 700; color: var(--ink); transition: all 0.12s ease;
}
.share-btn:hover { background: var(--gold-soft); border-color: var(--gold-soft); transform: translateY(-1px); }

/* --- Search / archive filters --- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar input[type=text] { margin-bottom: 0; }
.filters-row { display: flex; gap: 10px; margin-bottom: 22px; font-family: var(--sans); font-size: 0.85rem; flex-wrap: wrap; }
.filters-row a { padding: 6px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--border); transition: all 0.12s ease; }
.filters-row a:hover { border-color: var(--gold); }
.filters-row a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Footer --- */
.site-footer { background: var(--ink); color: #aab0c8; padding: 44px 0 28px; margin-top: 48px; font-family: var(--sans); font-size: 0.85rem; }
.site-footer a { color: #dfe2f0; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h5 { color: #fff; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand strong { color: #fff; font-family: var(--sans); }
.footer-note { color: #7d84a0; font-size: 0.78rem; line-height: 1.6; max-width: 360px; }
.footer-bottom { border-top: 1px solid #262f4a; margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: #7d84a0; }

/* --- Admin --- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 224px; background: var(--ink); color: #fff; padding: 22px 0; font-family: var(--sans); flex-shrink: 0; }
.admin-sidebar .brand-text { padding: 0 20px 22px; display: flex; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar a { display: block; padding: 11px 20px; color: #b7bcd3; font-size: 0.9rem; border-left: 3px solid transparent; }
.admin-sidebar a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.admin-sidebar a.active { background: rgba(201,151,60,0.12); color: #fff; border-left-color: var(--gold); font-weight: 600; }
.admin-main { flex: 1; padding: 30px 36px; background: var(--cream); font-family: var(--sans); }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.admin-topbar h1 { margin: 0; font-size: 1.4rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card strong { font-size: 1.9rem; display: block; color: var(--ink); }
.stat-card span { font-size: 0.8rem; color: var(--text-muted); }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.admin-table th, table.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.88rem; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table th { background: var(--cream-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
table.admin-table tr:hover td { background: #fbfaf6; }
.pill { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.pill-pending { background: #fff3cd; color: #8a6d1f; }
.pill-approved { background: #dbe7fb; color: var(--navy); }
.pill-answered { background: #e6f4ea; color: var(--success); }
.pill-rejected { background: #fbe9e7; color: var(--danger); }
.pill-source-internal { background: #eee; color: #444; }
.pill-source-user { background: #e3f0ff; color: #14508a; }
.pill-source-ai { background: #f3e8fb; color: #6b2fa0; }
.admin-actions form { display: inline; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* --- Pagination --- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; font-family: var(--sans); font-size: 0.9rem; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: 7px; border: 1px solid var(--border); background: #fff; }
.pagination a:hover { border-color: var(--gold); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Archive: bulletin-board of Post-its, grouped by category --- */
.kb-board {
  margin-top: 26px;
  background-color: #d8c8a0;
  background-image:
    radial-gradient(rgba(13,20,38,0.09) 1px, transparent 1.4px),
    radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1.4px);
  background-size: 15px 15px, 9px 9px;
  background-position: 0 0, 5px 6px;
  border: 10px solid var(--navy);
  border-radius: 10px;
  padding: 30px 28px 34px;
  box-shadow: var(--shadow-lift), inset 0 0 46px rgba(13,20,38,0.16);
}
.board-section { margin-bottom: 30px; }
.board-section:last-child { margin-bottom: 0; }

/* Compact variant: the homepage's 3-card "Recently answered" preview, styled
   as a small peek at the same corkboard rather than the full multi-section
   archive board. */
.kb-board--compact { margin-top: 4px; padding: 22px 20px 24px; }
.kb-board--compact .postit-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.postit-tab {
  --postit-color: #f3ecc9;
  display: inline-block;
  font-family: var(--sans); font-weight: 800; font-size: 0.8rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
  background: var(--postit-color);
  margin: 6px 0 16px -2px; padding: 10px 20px 11px;
  border-radius: 2px 2px 9px 2px;
  box-shadow: 0 4px 9px rgba(13,20,38,0.22);
  transform: rotate(-1.1deg);
  position: relative;
}
.postit-tab::before {
  content: ""; position: absolute; top: -7px; left: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, var(--gold) 58%, #7c5e1e 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.35);
}

.postit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 20px 18px; }

.postit {
  --postit-color: #fff6c8;
  display: flex; flex-direction: column;
  background: var(--postit-color);
  padding: 20px 16px 14px; min-height: 200px;
  border-radius: 1px;
  box-shadow: 3px 6px 11px rgba(13,20,38,0.25), 0 1px 0 rgba(255,255,255,0.55) inset;
  color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.postit::before {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 36px; height: 16px; background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.65); box-shadow: 0 2px 3px rgba(0,0,0,0.12);
}
.postit:nth-child(4n+1) { transform: rotate(-1.6deg); }
.postit:nth-child(4n+2) { transform: rotate(1.1deg); }
.postit:nth-child(4n+3) { transform: rotate(-0.5deg); }
.postit:nth-child(4n+4) { transform: rotate(1.6deg); }
.postit:hover {
  transform: scale(1.045) rotate(0deg) !important;
  box-shadow: 7px 12px 20px rgba(13,20,38,0.32);
  z-index: 4;
}
.postit-category {
  align-self: flex-start; font-family: var(--sans); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: rgba(13,20,38,0.65);
  background: rgba(255,255,255,0.45); padding: 2px 8px; border-radius: 10px; margin-bottom: 9px;
}
.postit h3 {
  font-family: var(--serif); font-size: 0.98rem; line-height: 1.35; font-weight: 700;
  margin: 0 0 8px; color: var(--ink);
}
.postit .excerpt {
  font-family: var(--serif); font-size: 0.82rem; line-height: 1.52;
  color: rgba(13,20,38,0.8); flex: 1; margin: 0 0 12px;
}
.postit .read-more {
  font-family: var(--sans); font-weight: 700; font-size: 0.76rem; color: var(--navy);
}
.postit:hover .read-more { text-decoration: underline; }
.postit-meta {
  display: flex; justify-content: space-between; font-family: var(--sans);
  font-size: 0.68rem; color: rgba(13,20,38,0.55); margin-top: 12px; padding-top: 8px;
  border-top: 1px dashed rgba(13,20,38,0.18);
}
.no-results { font-family: var(--sans); color: var(--text-muted); }

/* Category color-coding, matching the category icon set */
.postit[data-category="criminal-law"], .postit-tab[data-category="criminal-law"] { --postit-color: #ffb3b3; }
.postit[data-category="civil-law"], .postit-tab[data-category="civil-law"] { --postit-color: #ffd6a5; }
.postit[data-category="commercial-law"], .postit-tab[data-category="commercial-law"] { --postit-color: #fdffb6; }
.postit[data-category="constitutional-law"], .postit-tab[data-category="constitutional-law"] { --postit-color: #caffbf; }
.postit[data-category="labor-law"], .postit-tab[data-category="labor-law"] { --postit-color: #9bf6ff; }
.postit[data-category="remedial-law"], .postit-tab[data-category="remedial-law"] { --postit-color: #a0c4ff; }
.postit[data-category="political-law"], .postit-tab[data-category="political-law"] { --postit-color: #bdb2ff; }
.postit[data-category="legal-judicial-ethics"], .postit-tab[data-category="legal-judicial-ethics"] { --postit-color: #ffc6ff; }
.postit[data-category="taxation"], .postit-tab[data-category="taxation"] { --postit-color: #ffe29a; }
.postit[data-category="general"], .postit-tab[data-category="general"] { --postit-color: #efecdf; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero .container { flex-direction: column; text-align: center; }
  .hero-avatar { order: -1; }
  .badge-circle--lg { width: 180px; height: 180px; }
  .hero-actions { justify-content: center; }
  nav.main-nav { gap: 14px; flex-wrap: wrap; justify-content: center; }
  .site-header .container { flex-direction: column; gap: 12px; }
  .site-header { position: static; }
  .cta-band { flex-direction: column; text-align: center; }
  .kb-board { padding: 20px 14px 24px; border-width: 7px; }
  .postit-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .postit { min-height: 170px; padding: 16px 13px 12px; }
}

/* --- PDF import (admin) --- */
.import-progress-track {
  width: 100%; height: 10px; background: var(--cream-dim); border-radius: 6px;
  overflow: hidden; margin: 14px 0 8px;
}
.import-progress-fill {
  height: 100%; background: var(--gold); border-radius: 6px; transition: width 0.4s ease;
}
/* Indeterminate variant: used when we can't measure real progress (e.g.
   waiting on a single Ollama call) — a segment slides back and forth
   instead of filling to a known percentage. */
.import-progress-fill--indeterminate {
  width: 35%; animation: import-progress-indeterminate 1.3s ease-in-out infinite;
}
@keyframes import-progress-indeterminate {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .import-progress-fill--indeterminate { animation: none; margin-left: 0; width: 100%; opacity: 0.5; }
}
.import-stage-label { font-family: var(--sans); font-size: 0.85rem; color: var(--text-muted); }
.import-block-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.import-block-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--cream-dim);
}
.import-block-head h3 { margin: 0 0 4px; font-size: 1.05rem; }
.import-block-meta { font-family: var(--sans); font-size: 0.8rem; color: var(--text-muted); }
.import-block-head select { width: auto; min-width: 220px; margin-bottom: 0; }
.import-question-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 12px; background: var(--cream);
}
.import-question-item.flagged { border-color: #ecd7a6; background: #fdf8ee; }
.import-question-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px;
}
.import-question-head label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; }
.import-question-head input[type=checkbox] { width: auto; margin: 0; }
.import-question-item textarea { min-height: 90px; margin-bottom: 0; font-family: var(--sans); font-size: 0.88rem; }
.import-flag-note {
  font-family: var(--sans); font-size: 0.78rem; color: #8a6d1f; margin: 0 0 8px; display: flex; gap: 6px; align-items: flex-start;
}
.import-sticky-commit {
  position: sticky; bottom: 0; background: rgba(247,245,237,0.97); backdrop-filter: blur(4px);
  padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
