/**
 * @file
 * Activity timeline (neopoet_timeline). Ports the v2-B mockup styling and
 * scopes everything under .neopoet-timeline so it never bleeds into the
 * legacy user-profile chrome that lives above it.
 *
 * Tokens come from neopoet_theme/css/tokens.css. Colors per type:
 *   --c-poem            : recent poem post (persimmon)
 *   --c-critique-given  : critique authored (graphite)
 *   --c-critique-received: critique received (guide green)
 *   --c-follow          : follower added (editorial blue)
 *   --c-milestone       : milestones / wins (premium amber)
 */

.neopoet-timeline {
  --np-tl-c-poem: var(--np-color-accent-deep);
  --np-tl-c-given: var(--np-text-secondary);
  --np-tl-c-received: var(--np-role-guide);
  --np-tl-c-follow: var(--np-role-new-member);
  --np-tl-c-milestone: var(--np-role-premium);
  --np-tl-c-bookshelf: var(--np-role-workshop-leader);

  margin: var(--np-space-6) 0 0;
}

/* ===== Featured (pinned) poem card ===== */
.neopoet-timeline .np-tl-featured {
  position: relative;
  background: var(--np-bg-paper);
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  padding: var(--np-space-6) var(--np-space-6) var(--np-space-5);
  margin-bottom: var(--np-space-6);
}
.neopoet-timeline .np-tl-featured__pin {
  position: absolute;
  top: 14px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-color-accent-deep);
}
.neopoet-timeline .np-tl-featured__title {
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
  letter-spacing: var(--np-tracking-snug);
  margin: 0 0 var(--np-space-1);
  padding-right: 90px;
}
.neopoet-timeline .np-tl-featured__title a {
  color: var(--np-text-primary);
  text-decoration: none;
}
.neopoet-timeline .np-tl-featured__title a:hover {
  color: var(--np-color-accent-deep);
}
.neopoet-timeline .np-tl-featured__meta {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  margin-bottom: var(--np-space-4);
}
.neopoet-timeline .np-tl-dot {
  margin: 0 var(--np-space-2);
  color: var(--np-text-muted);
}

.neopoet-timeline .np-tl-poem {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  line-height: var(--np-leading-relaxed);
  color: var(--np-text-primary);
  max-width: 54ch;
  margin: 0;
}
.neopoet-timeline .np-tl-poem p {
  margin: 0;
  white-space: pre-line;
}

/* Inline expand for long poems */
.neopoet-timeline details.np-tl-poem-toggle {
  margin: 0;
}
.neopoet-timeline details.np-tl-poem-toggle .np-tl-poem--preview {
  position: relative;
}
.neopoet-timeline details.np-tl-poem-toggle:not([open]) .np-tl-poem--preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 64px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--np-bg-paper) 90%);
  pointer-events: none;
}
.neopoet-timeline details.np-tl-poem-toggle summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--np-space-2);
  margin-top: var(--np-space-3);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-color-accent-deep);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.neopoet-timeline details.np-tl-poem-toggle summary::-webkit-details-marker { display: none; }
.neopoet-timeline details.np-tl-poem-toggle summary::after {
  content: "↓";
  display: inline-block;
  transition: transform var(--np-duration-base) var(--np-ease-standard);
}
.neopoet-timeline details.np-tl-poem-toggle[open] summary::after {
  transform: rotate(180deg);
}
.neopoet-timeline details.np-tl-poem-toggle[open] summary .np-tl-open-label,
.neopoet-timeline details.np-tl-poem-toggle:not([open]) summary .np-tl-close-label {
  display: none;
}
.neopoet-timeline details.np-tl-poem-toggle .np-tl-poem--more {
  margin-top: 1.05em;
}

.neopoet-timeline .np-tl-featured__footer {
  margin-top: var(--np-space-5);
  padding-top: var(--np-space-3);
  border-top: 1px solid var(--np-border-tertiary);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
}
.neopoet-timeline .np-tl-featured__footer a {
  color: var(--np-color-accent-deep);
  text-decoration: none;
}

/* ===== Controls header (filter chips) ===== */
.neopoet-timeline .np-tl-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--np-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--np-space-2);
}
.neopoet-timeline .np-tl-h {
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: var(--np-text-xl);
  letter-spacing: var(--np-tracking-snug);
  margin: 0;
}
.neopoet-timeline .np-tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.neopoet-timeline .np-tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  padding: 5px 10px;
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-pill);
  background: var(--np-bg-paper);
  color: var(--np-text-secondary);
  text-decoration: none;
}
.neopoet-timeline .np-tl-chip:hover {
  border-color: var(--np-text-primary);
  color: var(--np-text-primary);
}
.neopoet-timeline .np-tl-chip.is-active {
  background: var(--np-text-primary);
  border-color: var(--np-text-primary);
  color: var(--np-text-inverse);
}
.neopoet-timeline .np-tl-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.neopoet-timeline .np-tl-chip[data-c="poem"] .np-tl-chip-dot { background: var(--np-tl-c-poem); }
.neopoet-timeline .np-tl-chip[data-c="given"] .np-tl-chip-dot { background: var(--np-tl-c-given); }
.neopoet-timeline .np-tl-chip[data-c="received"] .np-tl-chip-dot { background: var(--np-tl-c-received); }
.neopoet-timeline .np-tl-chip[data-c="win"] .np-tl-chip-dot,
.neopoet-timeline .np-tl-chip[data-c="milestone"] .np-tl-chip-dot { background: var(--np-tl-c-milestone); }
.neopoet-timeline .np-tl-chip[data-c="bookshelf"] .np-tl-chip-dot { background: var(--np-tl-c-bookshelf); }

/* ===== The list ===== */
.neopoet-timeline .np-tl-list {
  position: relative;
  list-style: none;
  padding: var(--np-space-6) 0 0;
  margin: 0;
}
.neopoet-timeline .np-tl-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 96px;
  width: 1px;
  background: var(--np-border-tertiary);
}

.neopoet-timeline .np-tl-month {
  position: relative;
  padding-left: 124px;
  margin: var(--np-space-6) 0 var(--np-space-3);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wider);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
}
.neopoet-timeline .np-tl-month::before {
  content: "";
  position: absolute;
  left: 88px;
  top: 7px;
  width: 17px;
  height: 1px;
  background: var(--np-border-secondary);
}

.neopoet-timeline .np-tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 40px;
  padding: var(--np-space-3) 0;
}
/* Filter-chip JS toggles [hidden] on items + month dividers — explicit
 * display:none overrides the display:grid above and the inherited list-item
 * default on the month rows. */
.neopoet-timeline .np-tl-item[hidden],
.neopoet-timeline .np-tl-month[hidden] {
  display: none;
}
.neopoet-timeline .np-tl-day {
  text-align: right;
  font-family: var(--np-font-serif);
  font-size: var(--np-text-sm);
  color: var(--np-text-tertiary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding-top: 2px;
}
.neopoet-timeline .np-tl-day__num {
  display: block;
  font-size: var(--np-text-xl);
  color: var(--np-text-primary);
  letter-spacing: var(--np-tracking-tight);
}

.neopoet-timeline .np-tl-item::before {
  content: "";
  position: absolute;
  left: 92px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--np-bg-page);
  border: 2px solid var(--np-tl-c-poem);
  box-shadow: 0 0 0 4px var(--np-bg-page);
}
.neopoet-timeline .np-tl-item[data-type="poem"]::before { border-color: var(--np-tl-c-poem); background: var(--np-tl-c-poem); }
.neopoet-timeline .np-tl-item[data-type="given"]::before { border-color: var(--np-tl-c-given); background: var(--np-bg-page); }
.neopoet-timeline .np-tl-item[data-type="received"]::before { border-color: var(--np-tl-c-received); background: var(--np-tl-c-received); }
.neopoet-timeline .np-tl-item[data-type="follow"]::before { border-color: var(--np-tl-c-follow); background: var(--np-bg-page); }
.neopoet-timeline .np-tl-item[data-type="bookshelf"]::before { border-color: var(--np-tl-c-bookshelf); background: var(--np-tl-c-bookshelf); }
.neopoet-timeline .np-tl-item[data-type="win"]::before,
.neopoet-timeline .np-tl-item[data-type="milestone"]::before {
  width: 11px;
  height: 11px;
  left: 91px;
  top: 17px;
  border-color: var(--np-tl-c-milestone);
  background: var(--np-tl-c-milestone);
  transform: rotate(45deg);
  border-radius: 0;
}

.neopoet-timeline .np-tl-card {
  background: var(--np-bg-paper);
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  padding: var(--np-space-3) var(--np-space-4);
}
.neopoet-timeline .np-tl-item[data-type="poem"] .np-tl-card { border-left: 3px solid var(--np-tl-c-poem); }
.neopoet-timeline .np-tl-item[data-type="given"] .np-tl-card { border-left: 3px solid var(--np-tl-c-given); }
.neopoet-timeline .np-tl-item[data-type="received"] .np-tl-card { border-left: 3px solid var(--np-tl-c-received); }
.neopoet-timeline .np-tl-item[data-type="follow"] .np-tl-card { border-left: 3px solid var(--np-tl-c-follow); }
.neopoet-timeline .np-tl-item[data-type="bookshelf"] .np-tl-card { border-left: 3px solid var(--np-tl-c-bookshelf); }
.neopoet-timeline .np-tl-item[data-type="win"] .np-tl-card,
.neopoet-timeline .np-tl-item[data-type="milestone"] .np-tl-card {
  border-left: 3px solid var(--np-tl-c-milestone);
  background: var(--np-bg-accent-subtle);
  border-color: var(--np-border-accent-subtle);
}

.neopoet-timeline .np-tl-verb {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
}
.neopoet-timeline .np-tl-item[data-type="poem"] .np-tl-verb { color: var(--np-tl-c-poem); }
.neopoet-timeline .np-tl-item[data-type="received"] .np-tl-verb { color: var(--np-tl-c-received); }
.neopoet-timeline .np-tl-item[data-type="follow"] .np-tl-verb { color: var(--np-tl-c-follow); }
.neopoet-timeline .np-tl-item[data-type="bookshelf"] .np-tl-verb { color: var(--np-tl-c-bookshelf); }
.neopoet-timeline .np-tl-item[data-type="win"] .np-tl-verb,
.neopoet-timeline .np-tl-item[data-type="milestone"] .np-tl-verb { color: var(--np-tl-c-milestone); }

.neopoet-timeline .np-tl-card__title {
  margin: 4px 0 0;
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: var(--np-text-md);
  line-height: 1.3;
  letter-spacing: var(--np-tracking-snug);
}
.neopoet-timeline .np-tl-card__title a {
  color: var(--np-text-primary);
  text-decoration: none;
}
.neopoet-timeline .np-tl-card__title a:hover {
  color: var(--np-color-accent-deep);
}
.neopoet-timeline .np-tl-item[data-type="milestone"] .np-tl-card__title {
  font-size: 19px;
}

.neopoet-timeline .np-tl-firstline {
  display: block;
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-sm);
  color: var(--np-text-secondary);
  margin-top: 5px;
}
.neopoet-timeline .np-tl-quote {
  display: block;
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-sm);
  color: var(--np-text-secondary);
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--np-border-tertiary);
}
.neopoet-timeline .np-tl-ctx {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-secondary);
  margin: 5px 0 0;
}
.neopoet-timeline .np-tl-ctx a {
  color: var(--np-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--np-border-tertiary);
}
.neopoet-timeline .np-tl-ctx a:hover {
  border-bottom-color: var(--np-text-primary);
}
.neopoet-timeline .np-tl-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
}
.neopoet-timeline .np-tl-meta a {
  color: var(--np-color-accent-deep);
  text-decoration: none;
}
/* Unpublished poem reference — no link, plus a quiet sans gloss after. */
.neopoet-timeline .np-tl-unpub {
  color: var(--np-text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--np-border-tertiary);
  text-decoration-thickness: 1px;
}
.neopoet-timeline .np-tl-unpub-note {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  margin-left: 4px;
  font-style: normal;
}

.neopoet-timeline .np-tl-empty {
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-md);
  color: var(--np-text-secondary);
  margin: var(--np-space-6) 0;
}

/* Arc-mode footer — quiet, sans-italic, with the override link rendered
 * persimmon. Sits below the last visible event. */
.neopoet-timeline .np-tl-density-foot {
  margin: var(--np-space-8) 0 0;
  padding: var(--np-space-4) 0 0;
  border-top: 1px solid var(--np-border-tertiary);
}
.neopoet-timeline .np-tl-density-foot p {
  margin: 0;
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-sm);
  color: var(--np-text-secondary);
  line-height: var(--np-leading-relaxed);
  max-width: 60ch;
}
.neopoet-timeline .np-tl-density-foot__expand {
  font-style: normal;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-color-accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  margin-left: var(--np-space-2);
  white-space: nowrap;
}
.neopoet-timeline .np-tl-density-foot__expand:hover {
  color: var(--np-color-accent-deeper);
}

/* Mobile collapse — narrow rail position so the day-num stays close to the dot. */
@media (max-width: 560px) {
  .neopoet-timeline .np-tl-list::before { left: 48px; }
  .neopoet-timeline .np-tl-item {
    grid-template-columns: 50px 1fr;
    gap: 18px;
  }
  .neopoet-timeline .np-tl-item::before { left: 44px; }
  .neopoet-timeline .np-tl-month { padding-left: 74px; }
  .neopoet-timeline .np-tl-month::before { left: 38px; width: 18px; }
  .neopoet-timeline .np-tl-day__num { font-size: 18px; }
}

/* =====================================================================
 * VIEW TOOLBAR — shared across Activity / Anthology / Studio.
 * ===================================================================== */
.np-tl-viewbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--np-space-3);
  margin: 0 0 var(--np-space-5);
  padding: var(--np-space-3) var(--np-space-4);
  background: var(--np-bg-paper);
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  font-family: var(--np-font-sans);
}
.np-tl-vb__label {
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
}
.np-tl-vb__opts {
  display: flex;
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-sm);
  overflow: hidden;
}
.np-tl-vb__opt {
  font-size: var(--np-text-sm);
  padding: 7px 14px;
  text-decoration: none;
  color: var(--np-text-secondary);
  border-right: 1px solid var(--np-border-tertiary);
  background: var(--np-bg-paper);
}
.np-tl-vb__opt:last-child { border-right: none; }
.np-tl-vb__opt.is-active {
  background: var(--np-text-primary);
  color: var(--np-text-inverse);
}
.np-tl-vb__opt:not(.is-active):hover { background: var(--np-bg-secondary); }
.np-tl-vb__self {
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
}
.np-tl-vb__self a {
  color: var(--np-color-accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* =====================================================================
 * ANTHOLOGY VIEW — chapbook layout.
 * ===================================================================== */
.neopoet-anthology { font-family: var(--np-font-serif); }

.np-anth-front {
  text-align: center;
  padding: var(--np-space-12) 0 var(--np-space-6);
}
.np-anth-front__label {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wider);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
  margin-bottom: var(--np-space-6);
}
.np-anth-front__name {
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0 0 var(--np-space-3);
}
.np-anth-front__strap {
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-md);
  color: var(--np-text-secondary);
  max-width: 48ch;
  margin: 0 auto;
}
.np-anth-front__rule {
  height: 3px;
  background: var(--np-color-accent);
  width: 80px;
  margin: var(--np-space-6) auto 0;
}

.np-anth-empty {
  max-width: 56ch;
  margin: var(--np-space-12) auto;
  text-align: center;
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  color: var(--np-text-secondary);
  line-height: var(--np-leading-relaxed);
}
.np-anth-empty__h {
  font-size: var(--np-text-xl);
  color: var(--np-text-primary);
  margin-bottom: var(--np-space-3);
}
.np-anth-cta {
  display: inline-block;
  margin-top: var(--np-space-3);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-sm);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-color-accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.np-anth-toc {
  max-width: 680px;
  margin: var(--np-space-10) auto var(--np-space-8);
}
.np-anth-toc h2 {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  font-weight: var(--np-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wider);
  color: var(--np-text-tertiary);
  margin: 0 0 var(--np-space-4);
  text-align: center;
}
.np-anth-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.np-anth-toc li {
  display: grid;
  grid-template-columns: 48px 1fr 80px;
  gap: var(--np-space-4);
  align-items: baseline;
  padding: var(--np-space-3) 0;
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-anth-toc li:last-child { border-bottom: none; }
.np-anth-toc__roman {
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: var(--np-text-sm);
  color: var(--np-text-tertiary);
  text-align: right;
  font-variant-numeric: oldstyle-nums;
}
.np-anth-toc__t {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-lg);
  line-height: 1.3;
  letter-spacing: var(--np-tracking-snug);
}
.np-anth-toc__t a {
  color: var(--np-text-primary);
  text-decoration: none;
}
.np-anth-toc__t a:hover { color: var(--np-color-accent-deep); }
.np-anth-toc__first {
  display: block;
  font-style: italic;
  font-size: var(--np-text-sm);
  color: var(--np-text-secondary);
  margin-top: 3px;
}
.np-anth-toc__when {
  text-align: right;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wide);
  font-variant-numeric: tabular-nums;
}

.np-anth-collection { padding: 0; }
.np-anth-poem {
  padding: var(--np-space-12) 0 var(--np-space-10);
  border-top: 1px solid var(--np-border-tertiary);
}
.np-anth-poem__num {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wider);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
  text-align: center;
  margin-bottom: var(--np-space-4);
}
.np-anth-poem__title {
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: var(--np-tracking-snug);
  margin: 0 0 var(--np-space-1);
  text-align: center;
}
.np-anth-poem__title a {
  color: var(--np-text-primary);
  text-decoration: none;
}
.np-anth-poem__meta {
  text-align: center;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--np-space-8);
}
.np-anth-poem__body {
  font-family: var(--np-font-serif);
  font-size: 19px;
  line-height: 1.8;
  color: var(--np-text-primary);
  max-width: 46ch;
  margin: 0 auto;
}
.np-anth-poem__body p {
  margin: 0 0 1.15em;
}
.np-anth-poem__foot {
  display: flex;
  justify-content: center;
  gap: var(--np-space-5);
  margin-top: var(--np-space-10);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
}
.np-anth-poem__foot a {
  color: var(--np-color-accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.np-anth-colophon {
  padding: var(--np-space-12) 0 var(--np-space-8);
  border-top: 1px solid var(--np-border-secondary);
  margin-top: var(--np-space-6);
}
.np-anth-colophon h3 {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  font-weight: var(--np-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wider);
  color: var(--np-text-tertiary);
  text-align: center;
  margin: 0 0 var(--np-space-6);
}
.np-anth-colophon__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--np-space-8);
  max-width: 680px;
  margin: 0 auto;
}
@media (max-width: 680px) {
  .np-anth-colophon__grid { grid-template-columns: 1fr; gap: var(--np-space-4); }
}
.np-anth-colophon__cell {
  text-align: center;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-sm);
  color: var(--np-text-secondary);
}
.np-anth-colophon__num {
  display: block;
  font-family: var(--np-font-serif);
  font-size: 32px;
  color: var(--np-text-primary);
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.np-anth-colophon__lab {
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wide);
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
}
.np-anth-colophon__edit {
  text-align: center;
  margin-top: var(--np-space-6);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-sm);
}
.np-anth-colophon__edit a {
  color: var(--np-color-accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* =====================================================================
 * STUDIO VIEW — craft signals.
 * ===================================================================== */
.neopoet-studio { font-family: var(--np-font-sans); }

.np-st-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--np-space-6);
}
@media (max-width: 880px) {
  .np-st-grid { grid-template-columns: 1fr; }
}

.np-st-card {
  background: var(--np-bg-paper);
  border: 1px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  padding: var(--np-space-5) var(--np-space-6);
  margin-bottom: var(--np-space-6);
}
.np-st-card h3 {
  margin: 0 0 var(--np-space-1);
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: var(--np-text-xl);
  letter-spacing: var(--np-tracking-snug);
}
.np-st-sub {
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  margin: 0 0 var(--np-space-4);
}
.np-st-narrative {
  margin-top: var(--np-space-4);
  padding: var(--np-space-3) var(--np-space-4);
  background: var(--np-bg-secondary);
  border-left: 3px solid var(--np-color-accent);
  font-family: var(--np-font-serif);
  font-size: var(--np-text-sm);
  line-height: var(--np-leading-relaxed);
  color: var(--np-text-primary);
  font-style: italic;
}
.np-st-narrative strong {
  font-weight: var(--np-weight-medium);
  font-style: normal;
}
.np-st-narrative--inset {
  margin-top: var(--np-space-4);
  background: transparent;
  padding-left: var(--np-space-3);
  border-top: 1px solid var(--np-border-tertiary);
  border-left: none;
  font-size: var(--np-text-sm);
  padding-top: var(--np-space-3);
}

/* Year bars */
.np-st-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
  align-items: end;
  height: 120px;
  margin-top: var(--np-space-2);
}
.np-st-bar {
  position: relative;
  background: var(--np-color-accent);
  opacity: 0.9;
  border-radius: 1px 1px 0 0;
  width: 100%;
}
.np-st-bar.is-peak { background: var(--np-color-accent-deep); opacity: 1; }
.np-st-bar.is-empty { background: var(--np-bg-tertiary); opacity: 0.85; }
.np-st-bar:hover { outline: 1px solid var(--np-text-primary); outline-offset: 1px; cursor: pointer; }
.np-st-bar__n {
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--np-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.np-st-bars__labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--np-text-tertiary);
  text-align: center;
  letter-spacing: 0.04em;
}

/* Critique balance ratio */
.np-st-card--ratio { padding: var(--np-space-6); }
.np-st-ratio {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--np-space-4);
  align-items: center;
  margin-top: var(--np-space-2);
}
.np-st-ratio__v { text-align: center; }
.np-st-ratio__num {
  display: block;
  font-family: var(--np-font-serif);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--np-text-primary);
  font-variant-numeric: tabular-nums lining-nums;
}
.np-st-ratio__v--big .np-st-ratio__num { color: var(--np-color-accent-deep); }
.np-st-ratio__lab {
  font-size: var(--np-text-xs);
  letter-spacing: var(--np-tracking-wide);
  text-transform: uppercase;
  color: var(--np-text-tertiary);
  margin-top: 4px;
  display: block;
}
.np-st-ratio__div {
  font-family: var(--np-font-serif);
  font-size: 32px;
  color: var(--np-text-tertiary);
}

/* Weekday density */
.np-st-weekday {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: var(--np-space-2);
  align-items: end;
  height: 100px;
}
.np-st-weekday__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.np-st-weekday__bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: var(--np-bg-tertiary);
  border-radius: 2px;
  min-height: 4px;
}
.np-st-weekday__bar {
  width: 100%;
  background: var(--np-color-accent);
  border-radius: 2px;
  min-height: 4px;
}
.np-st-weekday__lab {
  font-size: 10px;
  color: var(--np-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.np-st-weekday__n {
  font-family: var(--np-font-serif);
  font-size: 11px;
  color: var(--np-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Excerpt + bookshelf + interests */
.np-st-excerpt {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  line-height: var(--np-leading-relaxed);
  color: var(--np-text-primary);
  max-width: 50ch;
  margin: 0;
}
.np-st-excerpt p { margin: 0 0 1em; white-space: pre-line; }
.np-st-excerpt__from {
  margin-top: var(--np-space-3);
  font-style: italic;
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  font-family: var(--np-font-sans);
  white-space: normal;
}
.np-st-excerpt__from a {
  color: var(--np-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-st-shelf { margin: 0; padding: 0; list-style: none; }
.np-st-shelf li {
  padding: var(--np-space-2) 0;
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-st-shelf li:last-child { border-bottom: none; }
.np-st-shelf__t {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  color: var(--np-text-primary);
  text-decoration: none;
  display: block;
}
.np-st-shelf__t:hover { color: var(--np-color-accent-deep); }
.np-st-shelf__when {
  font-size: var(--np-text-xs);
  color: var(--np-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wide);
  margin-top: 3px;
  display: block;
}
.np-st-interests {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-base);
  line-height: 1.7;
  color: var(--np-text-primary);
}
.np-st-interests p { margin: 0; }
.np-st-interests a {
  color: var(--np-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-st-interests a:hover {
  color: var(--np-color-accent-deep);
  border-bottom-color: var(--np-color-accent-deep);
}

/* =====================================================================
 * ANTHOLOGY EDIT FORM
 * ===================================================================== */
.np-anth-intro {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  line-height: var(--np-leading-relaxed);
  color: var(--np-text-secondary);
  max-width: 60ch;
}
.np-anth-roman {
  font-family: var(--np-font-serif);
  font-style: italic;
  color: var(--np-text-tertiary);
  font-variant-numeric: oldstyle-nums;
}

/* =====================================================================
 * PROFILE STYLE PICKER (/user/{uid}/style)
 * Visual palette + view-mode picker. Native radios hidden; labels
 * styled as picture cards.
 * ===================================================================== */

.np-style-form {
  max-width: 1100px;
  margin: 0 auto;
}
.np-style-intro {
  margin: 0 0 var(--np-space-8);
  padding: 0 0 var(--np-space-5);
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-style-intro h1 {
  font-family: var(--np-font-serif);
  font-weight: var(--np-weight-regular);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: var(--np-tracking-snug);
  margin: 0 0 var(--np-space-2);
}
.np-style-intro p {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  color: var(--np-text-secondary);
  margin: 0;
  max-width: 60ch;
}

.np-style-section {
  margin-bottom: var(--np-space-12);
}
.np-style-h {
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  font-weight: var(--np-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--np-tracking-wider);
  color: var(--np-text-tertiary);
  margin: 0 0 var(--np-space-2);
}
.np-style-sub {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-base);
  color: var(--np-text-secondary);
  margin: 0 0 var(--np-space-5);
  max-width: 60ch;
}

/* Hide the native legend Drupal puts on `radios` field, since we have our own H2. */
.np-style-section fieldset > legend { display: none; }
.np-style-section fieldset { border: 0; padding: 0; margin: 0; }

/* ---- View-mode cards (3 large picture cards) ---- */

.np-style-views {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--np-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 700px) {
  .np-style-views { grid-template-columns: 1fr; }
}
.np-style-views .form-item {
  margin: 0;
  padding: 0;
}
.np-style-views input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.np-style-views label.option {
  display: block;
  padding: 0;
  background: var(--np-bg-paper);
  border: 1.5px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  cursor: pointer;
  transition: border-color var(--np-duration-base) var(--np-ease-standard),
              transform var(--np-duration-base) var(--np-ease-standard);
  position: relative;
  min-height: 200px;
  overflow: hidden;
}
.np-style-views label.option:hover {
  border-color: var(--np-text-primary);
  transform: translateY(-2px);
}
.np-style-views input[type="radio"]:checked + label.option {
  border-color: var(--np-color-accent-deep);
  border-width: 2px;
  box-shadow: 0 0 0 4px var(--np-bg-accent-subtle);
}
.np-style-views input[type="radio"]:focus-visible + label.option {
  outline: 2px solid var(--np-border-focus);
  outline-offset: 2px;
}

/* Per-option hero illustrations rendered with pure CSS — small editorial
 * vignettes that hint at what each view looks like without screenshots. */
.np-style-views label.option {
  font-family: var(--np-font-serif);
}
.np-style-views label.option::before {
  content: "";
  display: block;
  height: 90px;
  background: var(--np-bg-page);
  border-bottom: 1px solid var(--np-border-tertiary);
}
.np-style-views label.option::after {
  content: attr(for);
  display: none; /* not used; we do markup inline below */
}
.np-style-views label.option > .np-style-views__inner,
.np-style-views label.option {
  /* Placeholder padded zone — content blocks are layered via ::before
   * and the Drupal-generated label text after. */
  padding-bottom: var(--np-space-5);
}
/* Drupal renders the visible text inside <span> inside <label>. We push
 * it below the illustration. */
.np-style-views label.option {
  padding: 0 var(--np-space-5) var(--np-space-5);
}
.np-style-views label.option > * { display: block; }
.np-style-views label.option {
  font-size: var(--np-text-md);
  color: var(--np-text-primary);
  letter-spacing: var(--np-tracking-snug);
}

/* Decorate each view-mode card with a CSS illustration hinting at its
 * visual shape. Selectors target by the radio's #value through the
 * sibling order — Drupal renders inputs in the same order as #options. */
.np-style-views .form-item:nth-child(1) label.option::before {
  /* Activity: timeline rail */
  background:
    linear-gradient(to right, var(--np-border-tertiary) 0 1px, transparent 1px 100%) center/2px 100% no-repeat,
    radial-gradient(circle at 50% 22px, var(--np-color-accent-deep) 4px, transparent 5px),
    radial-gradient(circle at 50% 50px, var(--np-text-secondary) 3px, transparent 4px),
    radial-gradient(circle at 50% 76px, var(--np-color-accent-deep) 4px, transparent 5px),
    var(--np-bg-page);
  background-repeat: no-repeat;
}
.np-style-views .form-item:nth-child(2) label.option::before {
  /* Anthology: stacked pages */
  background:
    linear-gradient(transparent 18px, var(--np-color-accent) 18px 21px, transparent 21px) center/40% 100% no-repeat,
    linear-gradient(transparent 30px, var(--np-text-secondary) 30px 31px, transparent 31px) center/55% 100% no-repeat,
    linear-gradient(transparent 38px, var(--np-text-secondary) 38px 39px, transparent 39px) center/55% 100% no-repeat,
    linear-gradient(transparent 46px, var(--np-text-secondary) 46px 47px, transparent 47px) center/55% 100% no-repeat,
    linear-gradient(transparent 60px, var(--np-text-secondary) 60px 61px, transparent 61px) center/55% 100% no-repeat,
    linear-gradient(transparent 68px, var(--np-text-secondary) 68px 69px, transparent 69px) center/55% 100% no-repeat,
    var(--np-bg-page);
}
.np-style-views .form-item:nth-child(3) label.option::before {
  /* Studio: bar chart */
  background:
    linear-gradient(to top, var(--np-color-accent) 30%, transparent 30%) 12% 100%/8% 60% no-repeat,
    linear-gradient(to top, var(--np-color-accent) 60%, transparent 60%) 26% 100%/8% 60% no-repeat,
    linear-gradient(to top, var(--np-color-accent-deep) 90%, transparent 90%) 40% 100%/8% 60% no-repeat,
    linear-gradient(to top, var(--np-color-accent) 50%, transparent 50%) 54% 100%/8% 60% no-repeat,
    linear-gradient(to top, var(--np-color-accent) 35%, transparent 35%) 68% 100%/8% 60% no-repeat,
    linear-gradient(to top, var(--np-color-accent) 70%, transparent 70%) 82% 100%/8% 60% no-repeat,
    var(--np-bg-page);
}

/* ---- Palette swatches ---- */

.np-style-palettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--np-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.np-style-palettes .form-item.np-style-pal {
  margin: 0;
  padding: 0;
  position: relative;
}
.np-style-palettes input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.np-style-pal__label,
.np-style-palettes label.option {
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  background: var(--swp-page, var(--np-bg-page));
  padding: 14px 14px 12px;
  transition: border-color var(--np-duration-base) var(--np-ease-standard),
              transform var(--np-duration-base) var(--np-ease-standard);
  font-family: var(--np-font-sans);
  font-size: var(--np-text-sm);
  color: var(--np-text-primary);
  position: relative;
  min-height: 130px;
}
.np-style-palettes label.option:hover {
  border-color: var(--np-text-primary);
  transform: translateY(-2px);
}
.np-style-palettes input[type="radio"]:checked + label.option {
  border-color: var(--np-color-accent-deep);
  border-width: 2px;
  box-shadow: 0 0 0 4px var(--np-bg-accent-subtle);
  padding: 13px 13px 11px;  /* compensate the +0.5px border */
}
.np-style-palettes input[type="radio"]:focus-visible + label.option {
  outline: 2px solid var(--np-border-focus);
  outline-offset: 2px;
}

/* The label inside Drupal radios contains a span with the visible text;
 * we lay out the swatch chrome around it. The .form-item element gets
 * `style="--swp-*"` from #wrapper_attributes so each card draws its own
 * paint. */
.np-style-palettes label.option {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-height: 130px;
}
.np-style-palettes label.option::before {
  content: "";
  display: block;
  background: var(--swp-paper, #FFF);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--np-radius-sm);
  /* Inside the paper card: an "Aa" + persimmon rule simulated with
   * a stack of gradients. */
  background-image:
    linear-gradient(var(--swp-accent, #D85A30), var(--swp-accent, #D85A30)) 14px 70%/30% 2px no-repeat,
    radial-gradient(circle at 18px 35%, var(--swp-deep, #B84422) 6px, transparent 7px),
    linear-gradient(var(--swp-deep, #B84422), var(--swp-deep, #B84422)) 14px 50%/40% 1px no-repeat,
    linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)) 14px 60%/30% 1px no-repeat;
  min-height: 64px;
  position: relative;
}
.np-style-palettes label.option > .form-item__label,
.np-style-palettes label.option > span {
  font-weight: var(--np-weight-medium);
  font-size: var(--np-text-sm);
  letter-spacing: 0;
  text-transform: none;
  color: var(--np-text-primary);
  display: block;
}

/* The mood line sits below the label via the `data-mood` attribute. */
.np-style-pal__label::after {
  content: attr(data-mood);
  display: block;
  font-family: var(--np-font-serif);
  font-style: italic;
  font-size: 12px;
  line-height: 1.35;
  color: var(--np-text-secondary);
  margin-top: 3px;
}

/* Group label appears as a tiny tag in the corner. */
.np-style-pal__label::before {
  content: attr(data-group);
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--np-font-sans);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--swp-deep, var(--np-text-tertiary));
  opacity: 0.75;
  z-index: 2;
}

/* ---- Density radios (stacked, label + description) ---- */

.np-style-densities {
  display: flex;
  flex-direction: column;
  gap: var(--np-space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.np-style-density {
  margin: 0;
  padding: 0;
  position: relative;
}
.np-style-densities input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.np-style-densities label.option {
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--np-border-tertiary);
  border-radius: var(--np-radius-md);
  background: var(--np-bg-paper);
  padding: var(--np-space-4) var(--np-space-5);
  transition: border-color var(--np-duration-base) var(--np-ease-standard),
              transform var(--np-duration-base) var(--np-ease-standard);
}
.np-style-densities label.option:hover {
  border-color: var(--np-text-primary);
}
.np-style-densities input[type="radio"]:checked + label.option {
  border-color: var(--np-color-accent-deep);
  border-width: 2px;
  box-shadow: 0 0 0 4px var(--np-bg-accent-subtle);
  padding: calc(var(--np-space-4) - 0.5px) calc(var(--np-space-5) - 0.5px);
}
.np-style-densities input[type="radio"]:focus-visible + label.option {
  outline: 2px solid var(--np-border-focus);
  outline-offset: 2px;
}
.np-style-density__label {
  font-family: var(--np-font-serif);
  font-size: var(--np-text-md);
  font-weight: var(--np-weight-regular);
  color: var(--np-text-primary);
  display: block;
  letter-spacing: var(--np-tracking-snug);
}
.np-style-density__label::after {
  content: attr(data-desc);
  display: block;
  font-family: var(--np-font-sans);
  font-size: var(--np-text-xs);
  line-height: 1.5;
  color: var(--np-text-secondary);
  margin-top: 4px;
  letter-spacing: 0;
  font-weight: var(--np-weight-regular);
}

/* Style-form action row */
.np-style-form .form-actions {
  display: flex;
  gap: var(--np-space-3);
  align-items: center;
  padding-top: var(--np-space-5);
  border-top: 1px solid var(--np-border-tertiary);
}

