/* ==========================================================================
   Latin Authors Tier List - shared styles
   Palette: warm stone, terracotta, deep red, muted gold, ink.
   ========================================================================== */

:root {
  --stone: #f4ece0;
  --stone-deep: #e8dcc8;
  --parchment: #fbf6ec;
  --ink: #2b2622;
  --ink-soft: #5a5048;
  --terracotta: #b5532f;
  --terracotta-deep: #8f3d20;
  --deep-red: #7c1f1f;
  --gold: #b8893b;
  --gold-soft: #d8b878;
  --green: #4f6b34;
  --blue: #3a5a78;
  --gray: #6e6358;
  --line: #d8c9b0;
  --shadow: 0 2px 6px rgba(60, 40, 20, 0.12);
  --shadow-lift: 0 8px 22px rgba(60, 40, 20, 0.20);

  --font-ui: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(184, 137, 59, 0.10), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(181, 83, 47, 0.08), transparent 35%),
    var(--stone);
  line-height: 1.6;
}

a { color: var(--terracotta-deep); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--deep-red), var(--terracotta-deep));
  color: var(--parchment);
  box-shadow: var(--shadow);
  border-bottom: 3px solid var(--gold);
}

.site-header .container {
  position: relative;
  padding-top: 18px;
  padding-bottom: 14px;
}

/* ----------------------------------------------------- Language toggle */
.lang-toggle {
  position: absolute;
  top: 14px;
  right: 20px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 6px;
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.lang-flag:hover { opacity: 0.92; background: rgba(255, 255, 255, 0.20); }

.lang-flag.active {
  opacity: 1;
  background: var(--parchment);
  color: var(--deep-red);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.flag-svg {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: block;
}

.lang-code { line-height: 1; }

@media (max-width: 560px) {
  .site-title { padding-right: 84px; }
  .lang-toggle { top: 12px; right: 14px; }
}

.site-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  letter-spacing: 0.5px;
}

.site-title a { color: inherit; text-decoration: none; }

.site-subtitle {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--gold-soft);
  font-style: italic;
}

/* --------------------------------------------------------- Era menu bar */
.era-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.era-btn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--parchment);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.era-btn:hover { background: rgba(255, 255, 255, 0.22); }

.era-btn.active {
  background: var(--parchment);
  color: var(--deep-red);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.era-btn .lock {
  font-size: 0.78rem;
  opacity: 0.75;
  font-weight: 400;
}

/* ------------------------------------------------------------ Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 2px;
  font-size: 0.88rem;
}

.breadcrumb .crumb {
  color: var(--terracotta-deep);
  text-decoration: none;
}

.breadcrumb a.crumb:hover { text-decoration: underline; }

.breadcrumb .crumb-current {
  color: var(--ink-soft);
  font-weight: 600;
}

.breadcrumb .crumb-sep {
  color: var(--gray);
  opacity: 0.7;
}

/* ------------------------------------------------------ Era description */
.era-panel {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 22px 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.era-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--stone-deep);
  border-bottom: 1px solid var(--line);
}

.era-panel-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--deep-red);
}

.era-panel-toggle {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  user-select: none;
}

.era-panel-body {
  padding: 18px 22px 6px;
  max-width: 80ch;
}

.era-panel-body p { margin: 0 0 14px; }

.era-panel.collapsed .era-panel-body { display: none; }

.coming-soon {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
  padding: 36px 16px;
}

.coming-soon small {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--gray);
}

/* ---------------------------------------------------------- Author grid */
.section-label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 26px 0 14px;
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 50px;
}

.author-card {
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.author-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card-portraits {
  display: flex;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--stone-deep);
}

.card-portraits .portrait { flex: 1 1 0; min-width: 0; }

.portrait {
  position: relative;
  overflow: hidden;
  background: var(--stone-deep);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--parchment);
  background: linear-gradient(150deg, var(--terracotta), var(--gold));
  letter-spacing: 1px;
}

.card-body {
  padding: 12px 14px 16px;
  text-align: center;
}

.card-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--deep-red);
}

.card-dates {
  font-size: 0.82rem;
  color: var(--gray);
}

/* --------------------------------------------------------- Evaluation badge */
.eval-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
}

.eval-caption {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
}

.eval-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  box-shadow: var(--shadow);
}

.eval-note {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--gray);
}

/* ------------------------------------------------------------ Criteria chart */
.chart-wrap {
  max-width: 540px;
  margin: 6px auto 4px;
}

.criteria-chart {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--font-ui);
}

.chart-gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-axis { stroke: var(--ink-soft); stroke-width: 1.5; }
.chart-ylabel { fill: var(--ink-soft); font-size: 13px; }
.chart-xlabel { fill: var(--ink); font-size: 14px; font-weight: 600; }
.chart-bar-rect { transition: opacity 0.15s ease; }
.chart-bar:hover .chart-bar-rect { opacity: 0.85; }

.profile-lead {
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.criteria-legend {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

.fragment-caveat {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--stone);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- Detail page */
.detail-hero {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  align-items: flex-start;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 26px 0;
}

.detail-portraits {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

.detail-portraits .portrait {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  border: 3px solid var(--gold-soft);
}

/* Note about the portrait (invented / uncertain / not a real likeness). Its own
   column filling the empty space to the right of the heading; wraps below on
   narrow screens. The portrait and heading keep their usual size. */
.portrait-note {
  flex: 1 1 220px;
  max-width: 340px;
  align-self: center;
  margin: 0;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--gray);
}

.detail-heading { flex: 1 1 280px; }

.detail-name {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--deep-red);
  margin: 0 0 4px;
}

.detail-dates {
  color: var(--gray);
  font-size: 1rem;
  margin: 0 0 16px;
}

.content-section {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin: 18px 0;
}

.content-section h2 {
  font-family: var(--font-serif);
  color: var(--terracotta-deep);
  font-size: 1.35rem;
  margin: 0 0 10px;
  border-bottom: 2px solid var(--stone-deep);
  padding-bottom: 6px;
}

.content-section ul { padding-left: 22px; }
.content-section li { margin-bottom: 6px; }

/* Block quotes (Latin + translations) stand out with a gold rule. */
blockquote {
  margin: 14px 0;
  padding: 12px 18px;
  background: var(--stone);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
}

/* ------------------------------------------------------------- Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-ui);
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover { background: var(--terracotta-deep); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--terracotta-deep);
  border-color: var(--gold-soft);
}

.btn-ghost:hover { background: var(--stone-deep); }

.back-link {
  display: inline-block;
  margin: 22px 0 0;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.back-link:hover { color: var(--terracotta-deep); }

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

/* ------------------------------------------------------------- Practice page */
.practice-excerpt {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 20px 0;
}

.practice-excerpt h2 {
  font-family: var(--font-serif);
  color: var(--terracotta-deep);
  margin: 0 0 4px;
}

.excerpt-citation {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gray);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.excerpt-description {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--stone);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.fragment-counter {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin: 0 0 6px;
}

.fragment-source {
  margin: -8px 0 16px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--gray);
}

.try-another { margin-top: 20px; }

.choose-link { display: inline-block; margin: 0 0 10px; }

/* ------------------------------------------------------- Text-selection page */
.select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 32px;
}

.btn-comedy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 16px 22px;
  border-radius: 10px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--parchment);
  background: linear-gradient(180deg, var(--deep-red), var(--terracotta-deep));
  border: 1px solid var(--gold);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-comedy:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.btn-comedy-count {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gold-soft);
}

.latin-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.7;
  background: var(--stone);
  border-left: 5px solid var(--deep-red);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.latin-text blockquote {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
}

.latin-text em { color: var(--ink-soft); font-size: 0.92em; }

.practice-label {
  display: block;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 6px 0;
  font-size: 0.95rem;
}

.practice-area {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  background: #fffdf9;
  color: var(--ink);
  resize: vertical;
}

.practice-area:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(181, 83, 47, 0.15);
}

.reveal-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
}

.reveal-block {
  margin-top: 12px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 4px 16px;
  background: var(--stone);
  animation: fadein 0.25s ease;
}

.reveal-block.hidden { display: none; }

.reveal-block h3 {
  font-family: var(--font-serif);
  color: var(--terracotta-deep);
  margin: 12px 0 6px;
  font-size: 1.05rem;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------- States */
.loading, .error-box {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.error-box { color: var(--deep-red); }

/* ------------------------------------------------------------- Footer */
.site-footer {
  text-align: center;
  padding: 26px 20px 40px;
  color: var(--gray);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 560px) {
  .author-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .era-btn { min-width: 0; flex-basis: calc(50% - 8px); }
  .detail-portraits .portrait { width: 110px; height: 110px; }
  .detail-hero { padding: 18px; }
  /* Save vertical space under the pinned header on small screens. */
  .site-header .container { padding-top: 12px; padding-bottom: 10px; }
  .site-subtitle { display: none; }
  .era-menu { margin-top: 12px; }
}

/* ============================================================ What's New
   A CSS-drawn parchment scroll on the home page (#changelog-panel), filling
   the empty band beside the era intro, plus the full-history modal. No image
   assets - the parchment, fibres and wooden roller caps are all drawn here. */

/* Two-column home layout: era intro + parchment scroll. Single column below
   880px (the existing 560px query is untouched). The author grid stays full
   width, after this wrapper. */
.home-two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 22px 0;
  align-items: start;
}
.home-two-column .era-panel { margin: 0; }

@media (min-width: 880px) {
  .home-two-column {
    grid-template-columns: minmax(0, 1.65fr) minmax(264px, 1fr);
    align-items: stretch; /* parchment matches the intro's height */
  }
}

/* Shared aged-parchment background (panel + modal sheet). */
.changelog-panel,
.cl-modal {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(216, 184, 120, 0.20), transparent 62%),
    radial-gradient(120% 70% at 50% 100%, rgba(143, 61, 32, 0.12), transparent 62%),
    repeating-linear-gradient(90deg, rgba(120, 90, 40, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--parchment), var(--stone));
}

.changelog-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow), inset 0 0 42px rgba(120, 80, 40, 0.08);
  padding: 26px 22px;
  color: var(--ink-soft);
}

/* Wooden roller caps top & bottom -> reads as a scroll, no image needed. */
.changelog-panel::before,
.changelog-panel::after {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  height: 15px;
  border-radius: 9px;
  background: linear-gradient(180deg, #c6915520 0%, #c69155 8%, #884e26 55%, #5c3719 100%);
  box-shadow: var(--shadow);
}
.changelog-panel::before { top: -7px; }
.changelog-panel::after { bottom: -7px; }

.cl-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.cl-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--deep-red);
}
.cl-version {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--terracotta-deep);
}
.cl-body { display: flex; flex-direction: column; gap: 11px; }
.cl-cat {
  margin: 0 0 3px;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
}
.cl-list { margin: 0; padding-left: 18px; }
.cl-item { margin: 0 0 5px; }
.cl-item:last-child { margin-bottom: 0; }
.cl-empty { margin: 0; font-style: italic; color: var(--gray); }
.cl-date {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--gray);
}
.cl-more-btn {
  align-self: flex-start;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--parchment);
  background: var(--deep-red);
  border: 1px solid var(--terracotta-deep);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.cl-more-btn:hover { background: var(--terracotta-deep); transform: translateY(-1px); }

/* ---- full-history modal ---- */
.cl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  background: rgba(43, 38, 34, 0.55);
  overflow-y: auto;
}
.cl-modal-overlay.is-open { display: flex; }
body.cl-modal-open { overflow: hidden; }

.cl-modal {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.cl-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--stone-deep);
  border-bottom: 1px solid var(--line);
}
.cl-modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--deep-red);
}
.cl-modal-close {
  font-size: 1.7rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 4px;
}
.cl-modal-close:hover { color: var(--deep-red); }
.cl-modal-list {
  overflow-y: auto;
  padding: 4px 24px 24px;
  color: var(--ink-soft);
}
.cl-modal-entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cl-modal-entry:last-child { border-bottom: none; }
.cl-modal-entry .cl-version { font-size: 1.15rem; margin-bottom: 2px; }
.cl-modal-entry .cl-date { margin: 0 0 10px; }
.cl-modal-entry .cl-body { gap: 9px; }

/* ============================================================
   Per-excerpt version tracker (practice page).
   A papyrus "Added in v.X" tag on the top-right of every excerpt;
   the single newest batch gets a red "NEW!" VIP banner instead.
   Both textures are drawn in CSS (no images).
   ============================================================ */
.practice-excerpt { position: relative; }

/* keep the header text (counter / title / citation) clear of the badge */
.practice-excerpt.has-papyrus .fragment-counter,
.practice-excerpt.has-papyrus h2,
.practice-excerpt.has-papyrus .excerpt-citation { padding-right: 152px; }
.practice-excerpt.has-vip .fragment-counter,
.practice-excerpt.has-vip h2,
.practice-excerpt.has-vip .excerpt-citation { padding-right: 100px; }

.excerpt-version-badge {
  position: absolute;
  right: 18px;
  z-index: 3;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.excerpt-version-badge:hover { transform: translateY(-2px); filter: brightness(1.06); }
.excerpt-version-badge:focus-visible { outline: 2px solid var(--deep-red); outline-offset: 3px; }

/* ---- papyrus horizontal scroll (older excerpts) ---- */
.excerpt-version-badge.is-papyrus {
  top: 20px;
  height: 30px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  border: 1px solid #cbb488;
  background:
    repeating-linear-gradient(90deg, rgba(120,90,50,0.06) 0 2px, rgba(120,90,50,0) 2px 6px),
    linear-gradient(180deg, #f0e5d0 0%, #e5d6ba 55%, #dcc9a6 100%);
  box-shadow: var(--shadow), inset 0 0 6px rgba(150,120,70,0.16);
}
/* the two rolled ends of the little scroll */
.excerpt-version-badge.is-papyrus::before,
.excerpt-version-badge.is-papyrus::after {
  content: '';
  position: absolute;
  top: -3px; bottom: -3px;
  width: 9px;
  border-radius: 5px;
  background: linear-gradient(180deg, #dcc493 0%, #c4a668 55%, #ad8b52 100%);
  border: 1px solid #a3813f;
  box-shadow: inset 0 0 3px rgba(80,55,20,0.45);
}
.excerpt-version-badge.is-papyrus::before { left: -6px; }
.excerpt-version-badge.is-papyrus::after { right: -6px; }
.papyrus-text {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--deep-red);
  white-space: nowrap;
}

/* ---- red VIP banner (the newest batch) ---- */
.excerpt-version-badge.is-vip {
  top: -1px;
  width: 84px;
  height: 108px;
  background: linear-gradient(180deg, #f2d789 0%, #c19a45 55%, #a5802f 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  filter: drop-shadow(0 4px 6px rgba(60,25,25,0.35));
}
/* gold roller across the top (the "hanger") */
.excerpt-version-badge.is-vip::before {
  content: '';
  position: absolute;
  top: -4px; left: -7px; right: -7px;
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f6e0a0 0%, #c8a24d 55%, #a5802f 100%);
  border: 1px solid #8a6a2a;
  box-shadow: inset 0 1px 1px rgba(255,244,210,0.7), 0 2px 3px rgba(60,40,10,0.4);
  z-index: 4;
}
/* the red banner cloth, inset so the gold reads as a border */
.excerpt-version-badge.is-vip .vip-inner {
  position: absolute;
  inset: 3px;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 81%, 50% 100%, 0 81%);
  clip-path: polygon(0 0, 100% 0, 100% 81%, 50% 100%, 0 81%);
  background: linear-gradient(180deg, #f01818 0%, #e60f0f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 5px 16px;
}
.vip-new {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 1.2px;
  color: #f7db7c;
  text-shadow: 0 1px 1px rgba(60,18,10,0.7);
}
.vip-ver {
  font-family: var(--font-serif);
  font-size: 0.62rem;
  line-height: 1.18;
  text-align: center;
  color: #f0cf78;
  text-shadow: 0 1px 1px rgba(60,18,10,0.55);
}

@media (max-width: 560px) {
  .excerpt-version-badge.is-papyrus { height: 26px; padding: 0 9px; }
  .papyrus-text { font-size: 0.72rem; }
  .practice-excerpt.has-papyrus .fragment-counter,
  .practice-excerpt.has-papyrus h2,
  .practice-excerpt.has-papyrus .excerpt-citation { padding-right: 132px; }
  .excerpt-version-badge.is-vip { width: 72px; height: 94px; }
  .vip-new { font-size: 0.74rem; }
}

/* ===== version-list page (reached from the excerpt version badges) ===== */
.version-page h2.version-heading {
  font-family: var(--font-serif);
  color: var(--deep-red);
  margin: 0.2em 0 0.1em;
}
.version-latest-note {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
  vertical-align: middle;
}
.version-count { color: var(--ink-soft); margin: 0 0 18px; }

/* prev / next update arrows */
.version-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 22px;
}
.version-nav a,
.version-nav span {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--stone);
  color: var(--deep-red);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.version-nav a:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.version-nav .nav-disabled {
  color: var(--gray);
  opacity: 0.45;
  box-shadow: none;
  cursor: default;
}
.version-nav .nav-next { margin-left: auto; }

/* the excerpt list */
.version-list { list-style: none; margin: 0; padding: 0; }
.version-item {
  display: block;
  padding: 14px 16px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--deep-red);
  border-radius: 10px;
  background: var(--parchment);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.version-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.version-item:focus-visible { outline: 2px solid var(--deep-red); outline-offset: 2px; }
.vi-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 4px; }
.vi-author { font-family: var(--font-serif); font-weight: 700; color: var(--deep-red); font-size: 1.05rem; }
.vi-subject {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--terracotta-deep);
}
.vi-title { display: block; font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); }
