/* ============================================================
   Plooi subpages — interactions & motion (Why / Philosophy / Methods)
   Everything is gated behind html[data-anim="on"] so the Tweaks panel
   can A/B it. When anim is off (or reduced-motion), the end-state shows
   instantly — no hidden content, ever.
   ============================================================ */

/* ---- scroll reveals (subtle, editorial) ---- */
html[data-anim='on'] .fx {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.55s ease,
    transform 0.6s cubic-bezier(0.2, 0.75, 0.2, 1);
}
html[data-anim='on'] .fx.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .fx {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---- confidence bars: fill on reveal ---- */
/* base (anim off / reduced): bars show their full width immediately */
.conf-card .cbar span {
  width: var(--w, 100%);
}
html[data-anim='on'] .conf-card .cbar span {
  width: 0;
  transition: width 1.05s cubic-bezier(0.2, 0.8, 0.2, 1);
}
html[data-anim='on'] .conf-card.in .cbar span {
  width: var(--w, 100%);
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .conf-card .cbar span {
    width: var(--w, 100%) !important;
    transition: none !important;
  }
}
/* terracotta/very-low fills a touch slower & later — reads as "hesitant" */
html[data-anim='on'] .conf-card.dashed.in .cbar span {
  transition-duration: 1.45s;
  transition-delay: 0.12s;
}

/* ---- anatomy of a pleat: marching-ants flow on the connectors ---- */
@keyframes plooi-dash {
  to {
    stroke-dashoffset: -16;
  }
}
html[data-anim='on'] .pleat-card .pdiag svg .flow {
  stroke-dasharray: 5 3;
  animation: plooi-dash 0.9s linear infinite;
}
html[data-anim='on'] .pleat-card .pdiag svg .flow.rev {
  animation-direction: reverse;
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .pleat-card .pdiag svg .flow {
    animation: none;
  }
}

/* ---- six tools → one canvas: fold-in on reveal ---- */
html[data-anim='on'] .wh-fold .tool-row {
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.2, 0.75, 0.2, 1);
}
html[data-anim='on'] .wh-fold.in .tool-row {
  opacity: 1;
  transform: none;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(2) {
  transition-delay: 0.05s;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(3) {
  transition-delay: 0.1s;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(4) {
  transition-delay: 0.15s;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(5) {
  transition-delay: 0.2s;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(6) {
  transition-delay: 0.25s;
}
html[data-anim='on'] .wh-fold.in .tool-row:nth-child(7) {
  transition-delay: 0.3s;
}
/* wires draw themselves in */
html[data-anim='on'] .wh-canvas svg path {
  stroke-dasharray: var(--len, 260);
  stroke-dashoffset: var(--len, 260);
  transition: stroke-dashoffset 1s ease 0.25s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas svg path {
  stroke-dashoffset: 0;
}
/* nodes pop after the wires start */
html[data-anim='on'] .wh-canvas .cnode {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode {
  transition-delay: 0.5s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(3) {
  transition-delay: 0.58s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(4) {
  transition-delay: 0.66s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(5) {
  transition-delay: 0.74s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(6) {
  transition-delay: 0.82s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(7) {
  transition-delay: 0.9s;
}
html[data-anim='on'] .wh-fold.in .wh-canvas .cnode:nth-child(8) {
  transition-delay: 0.98s;
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .wh-fold .tool-row,
  html[data-anim='on'] .wh-canvas .cnode {
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
    transition: none !important;
  }
  html[data-anim='on'] .wh-canvas .cnode {
    transform: translate(-50%, -50%) !important;
  }
  html[data-anim='on'] .wh-canvas svg path {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}

/* ---- chat-vs-canvas table: row reveal ---- */
html[data-anim='on'] .wh-table tbody tr {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
html[data-anim='on'] .wh-table.in tbody tr {
  opacity: 1;
  transform: none;
}
html[data-anim='on'] .wh-table.in tbody tr:nth-child(2) {
  transition-delay: 0.07s;
}
html[data-anim='on'] .wh-table.in tbody tr:nth-child(3) {
  transition-delay: 0.14s;
}
html[data-anim='on'] .wh-table.in tbody tr:nth-child(4) {
  transition-delay: 0.21s;
}
html[data-anim='on'] .wh-table.in tbody tr:nth-child(5) {
  transition-delay: 0.28s;
}
/* the plooi column lights up last */
html[data-anim='on'] .wh-table td.plooi {
  transition: background 0.5s ease 0.45s;
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .wh-table tbody tr {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Inked accent underline — the hand-drawn stroke under blue headline
   words, matching the landing exactly (organic edge + slight rotation).
   The intro h1s already get this via the shared html[data-analog="on"]
   h1 .em::after rule, so only the h2/h3/closing accents are added here.
   ============================================================ */
.ab-shead h2 .em,
.wh-shead h2 .em,
.wh-fold h3 .em,
.lib-viewbar h2 .em,
.closing h2 .em {
  position: relative;
  white-space: nowrap;
}
/* very narrow screens: let it wrap again rather than overflow */
@media (max-width: 480px) {
  .ab-shead h2 .em,
  .wh-shead h2 .em,
  .wh-fold h3 .em,
  .lib-viewbar h2 .em,
  .closing h2 .em {
    white-space: normal;
  }
}
.ab-shead h2 .em::after,
.wh-shead h2 .em::after,
.wh-fold h3 .em::after,
.lib-viewbar h2 .em::after,
.closing h2 .em::after {
  content: '';
  position: absolute;
  left: -1%;
  right: -1%;
  bottom: -0.04em;
  height: 0.1em;
  background: var(--accent);
  border-radius: 40% 60% 50% 45%/60% 56% 60% 54%;
  opacity: 0.95;
  transform: rotate(-0.8deg);
  pointer-events: none;
}

/* draw-in: the stroke paints itself left→right when the word scrolls into
   view (matches the landing's inkdraw). Gated on data-anim so the Tweaks
   panel toggles it; anim off or reduced-motion shows the full stroke. */
html[data-anim='on'] .ab-shead h2 .em::after,
html[data-anim='on'] .wh-shead h2 .em::after,
html[data-anim='on'] .wh-fold h3 .em::after,
html[data-anim='on'] .lib-viewbar h2 .em::after,
html[data-anim='on'] .closing h2 .em::after {
  transform: rotate(-0.8deg) scaleX(0);
  transform-origin: left center;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}
html[data-anim='on'] .ab-shead h2 .em.inked::after,
html[data-anim='on'] .wh-shead h2 .em.inked::after,
html[data-anim='on'] .wh-fold h3 .em.inked::after,
html[data-anim='on'] .lib-viewbar h2 .em.inked::after,
html[data-anim='on'] .closing h2 .em.inked::after {
  transform: rotate(-0.8deg) scaleX(1);
}
/* intro h1 underline (comes from the shared analog ::after) — same draw */
html[data-anim='on'] .ab-intro h1 .em::after,
html[data-anim='on'] .wh-intro h1 .em::after,
html[data-anim='on'] .lib-head h1 .em::after {
  transform: rotate(-0.6deg) scaleX(0);
  transform-origin: left center;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}
html[data-anim='on'] .ab-intro h1 .em.inked::after,
html[data-anim='on'] .wh-intro h1 .em.inked::after,
html[data-anim='on'] .lib-head h1 .em.inked::after {
  transform: rotate(-0.6deg) scaleX(1);
}
@media (prefers-reduced-motion: reduce) {
  html[data-anim='on'] .ab-shead h2 .em::after,
  html[data-anim='on'] .wh-shead h2 .em::after,
  html[data-anim='on'] .wh-fold h3 .em::after,
  html[data-anim='on'] .lib-viewbar h2 .em::after,
  html[data-anim='on'] .closing h2 .em::after {
    transform: rotate(-0.8deg) scaleX(1) !important;
    transition: none !important;
  }
  html[data-anim='on'] .ab-intro h1 .em::after,
  html[data-anim='on'] .wh-intro h1 .em::after,
  html[data-anim='on'] .lib-head h1 .em::after {
    transform: rotate(-0.6deg) scaleX(1) !important;
    transition: none !important;
  }
}

.zoomer {
  margin-top: 8px;
}
.zoom-controls {
  display: inline-flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 22px;
}
.zoom-controls button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
  transition:
    background 0.18s,
    color 0.18s;
}
.zoom-controls button small {
  font-family: var(--display), serif;
  font-style: italic;
  font-size: 10.5px;
  letter-spacing: 0;
  /* Kein opacity: 0.8 mehr — --ink-soft steht mit 5,73:1 sauber da, abgedimmt
     fiel es unter 4,5 (#599). Die aktive Kachel unten ist ein anderer Fall:
     dort steht Weiss auf --accent. */
}
html[data-display='Bricolage Grotesque'] .zoom-controls button small {
  font-style: normal;
  font-weight: 600;
}
.zoom-controls button:hover {
  color: var(--ink);
}
.zoom-controls button.on {
  background: var(--accent);
  color: #fff;
}
.zoom-controls button.on small {
  opacity: 0.85;
}
.zoom-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--cream) 55%, var(--paper));
  background-image: radial-gradient(circle at 1px 1px, rgba(26, 24, 20, 0.08) 1px, transparent 0);
  background-size: 17px 17px;
  height: clamp(300px, 42vh, 440px);
}
.zoom-stage .zlayer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 42px);
  opacity: 0;
  transform: scale(0.86);
  transition:
    opacity 0.5s ease,
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.zoom-stage .zlayer svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}
.zoom-stage .zlayer text {
  font-family: var(--mono);
}
.zoomer[data-z='100'] .zlayer[data-z='100'],
.zoomer[data-z='200'] .zlayer[data-z='200'],
.zoomer[data-z='400'] .zlayer[data-z='400'] {
  opacity: 1;
  transform: scale(1);
}
/* layers below the active zoom sit smaller; above sit larger — reads as depth */
.zoomer[data-z='200'] .zlayer[data-z='100'],
.zoomer[data-z='400'] .zlayer[data-z='100'],
.zoomer[data-z='400'] .zlayer[data-z='200'] {
  transform: scale(1.25);
}
.zoomer[data-z='100'] .zlayer[data-z='200'],
.zoomer[data-z='100'] .zlayer[data-z='400'],
.zoomer[data-z='200'] .zlayer[data-z='400'] {
  transform: scale(0.78);
}
.zoom-caps {
  margin-top: 18px;
  position: relative;
  min-height: 48px;
}
.zoom-caps p {
  position: absolute;
  inset: 0;
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 60ch;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  text-wrap: pretty;
}
.zoom-caps p .zk {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 8px;
}
.zoomer[data-z='100'] .zoom-caps p[data-z='100'],
.zoomer[data-z='200'] .zoom-caps p[data-z='200'],
.zoomer[data-z='400'] .zoom-caps p[data-z='400'] {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .zoom-stage .zlayer,
  .zoom-caps p {
    transition: none;
  }
}
@media (max-width: 560px) {
  .zoom-controls {
    display: flex;
    width: 100%;
  }
  .zoom-controls button {
    flex: 1;
  }
}

/* ============================================================
   Evolution scrubber — Philosophy "a Plooi grows up"
   ============================================================ */
.evo-scrub {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  margin-bottom: clamp(22px, 3vh, 34px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px clamp(18px, 2.4vw, 26px);
}
.evo-scrub input[type='range'] {
  flex: 1;
  appearance: none;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
}
.evo-scrub input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
  transition: transform 0.12s;
}
.evo-scrub input[type='range']::-webkit-slider-thumb:active {
  transform: scale(1.18);
}
.evo-scrub input[type='range']::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}
.evo-scrub .evo-now {
  font-family: var(--display), serif;
  font-weight: 700;
  font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: -0.01em;
  white-space: nowrap;
  min-width: 9ch;
}
html[data-display='Bricolage Grotesque'] .evo-scrub .evo-now {
  font-weight: 700;
}
.evo-scrub .evo-now .em {
  color: var(--accent);
}
.evo-scrub .evo-age {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
/* dim stages beyond the scrubber position */
.ab-evo[data-stage] .evo-card {
  transition:
    opacity 0.45s ease,
    filter 0.45s ease,
    transform 0.45s ease;
}
.ab-evo[data-stage='1'] .evo-card[data-st='2'],
.ab-evo[data-stage='1'] .evo-card[data-st='3'],
.ab-evo[data-stage='1'] .evo-card[data-st='4'],
.ab-evo[data-stage='2'] .evo-card[data-st='3'],
.ab-evo[data-stage='2'] .evo-card[data-st='4'],
.ab-evo[data-stage='3'] .evo-card[data-st='4'] {
  opacity: 0.32;
  filter: saturate(0.5);
}
.ab-evo[data-stage] .evo-card.cur {
  box-shadow:
    0 0 0 1.5px var(--accent),
    0 14px 30px rgba(26, 24, 20, 0.1);
}
@media (prefers-reduced-motion: reduce) {
  .ab-evo[data-stage] .evo-card {
    transition: none;
  }
}

/* ============================================================
   Methods — live search + phase highlight
   ============================================================ */
.lib-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 18px 0 6px;
}
.lib-search {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.lib-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
}
.lib-search input {
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 16px 13px 42px;
  outline: none;
  transition:
    border-color 0.16s,
    box-shadow 0.16s;
}
.lib-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.lib-search input::placeholder {
  color: var(--ink-soft);
}
.lib-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.lib-count b {
  color: var(--accent);
  font-weight: 600;
}
.lib-clear {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    color 0.18s,
    border-color 0.18s;
}
.lib-tools.filtering .lib-clear {
  opacity: 1;
  pointer-events: auto;
}
.lib-clear:hover {
  color: var(--ink);
  border-color: var(--accent);
}
/* phase cards become clickable filter chips */
.phase-card[role='button'] {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s;
}
html[data-micro='on'] .phase-card[role='button']:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(26, 24, 20, 0.05),
    0 16px 34px rgba(26, 24, 20, 0.09);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}
.phase-card[role='button'].on {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1.5px var(--accent),
    0 16px 34px rgba(26, 24, 20, 0.1);
}
.phase-card .ptaghint {
  position: absolute;
  left: clamp(24px, 2.6vw, 38px);
  bottom: clamp(18px, 2vw, 26px);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.18s;
}
/* ⚠ Drei Regelblöcke sind hier mit ihren Schreibern weggefallen (#932):
   `.phase-card.on`, `.lib-families[data-phase] .lib-cat` (dimmt die nicht
   passenden Familien) und `.libcard.hide` / `.lib-cat.hide`. Alle drei hingen
   an den zwei Blöcken in `subpage-fx.js`, die als zweite Schreiber auf Zähler
   und Phasenfilter entfernt wurden. Niemand setzt diese Klassen und Attribute
   mehr — `MethodsPage` filtert über `style.display`. Eine Regel ohne Schreiber
   sieht aus wie Gestaltung und ist eine Notiz über etwas, das es nicht gibt. */
.phase-card[role='button']:hover .ptaghint {
  opacity: 0.85;
}
.lib-cat .lib-cat-head .cmatch {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-left: auto;
}
@media (prefers-reduced-motion: reduce) {
  .phase-card[role='button'] {
    transition: none;
  }
}

/* ---- methods: click-to-preview input→output flow (gated on data-interactive) ---- */
/* ---- methods: click-to-open detail popup (gated on data-interactive) ---- */
html[data-interactive='on'] .libcard {
  cursor: pointer;
}
.libcard {
  position: relative;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
html[data-interactive='on'] .libcard:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}
.libcard .lf-tag {
  position: absolute;
  top: 12px;
  right: 13px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
html[data-interactive='on'] .libcard:hover .lf-tag {
  opacity: 0.7;
}

/* modal overlay + panel */
html.lib-modal-open {
  overflow: hidden;
}
.lib-modal-ov {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lib-modal-ov[hidden] {
  display: none;
}
.lib-modal-ov.show {
  opacity: 1;
  pointer-events: auto;
}
.lib-modal {
  position: relative;
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(24px, 3vw, 34px);
  box-shadow: 0 30px 80px rgba(26, 24, 20, 0.32);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lib-modal-ov.show .lib-modal {
  transform: none;
}
.lib-mclose {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.lib-mclose:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.lib-mphase {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.lib-mname {
  font-family: var(--display), serif;
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 12px;
}
.lib-mdesc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 22px;
  text-wrap: pretty;
}
.lib-mfoot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: var(--display), serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  text-wrap: pretty;
}
html[data-display='Bricolage Grotesque'] .lib-mfoot {
  font-style: normal;
  font-weight: 500;
}
/* the in → method → out flow, shown inside the modal */
.lib-flow {
  display: flex;
  align-items: stretch;
  gap: 9px;
  flex-wrap: wrap;
}
.lib-flow .lf-in,
.lib-flow .lf-out {
  flex: 1 1 100px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lib-flow .lf-mid {
  flex: 1 1 100px;
  font-family: var(--display), serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--accent);
  background: var(--accent-weak);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  text-wrap: balance;
}
html[data-display='Bricolage Grotesque'] .lib-flow .lf-mid {
  font-weight: 700;
}
.lib-flow .lf-k {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.lib-flow .lf-ar {
  width: 16px;
  height: 9px;
  color: color-mix(in srgb, var(--accent) 60%, var(--ink-soft));
  flex: none;
  align-self: center;
}
@media (max-width: 460px) {
  .lib-flow {
    flex-direction: column;
  }
  .lib-flow .lf-ar {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* ---- methods: no-results state ---- */
.lib-empty[hidden] {
  display: none;
}
.lib-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: clamp(48px, 9vh, 96px) 20px;
  color: var(--ink-soft);
}
.lib-empty svg {
  width: 40px;
  height: 40px;
  color: color-mix(in srgb, var(--accent) 55%, var(--ink-soft));
  opacity: 0.8;
}
.lib-empty p {
  font-family: var(--display), serif;
  font-style: italic;
  font-size: clamp(17px, 1.8vw, 21px);
  color: var(--ink);
  margin: 0;
}
html[data-display='Bricolage Grotesque'] .lib-empty p {
  font-style: normal;
  font-weight: 600;
}
.lib-empty .lib-clear {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   Accessibility — visible focus rings on the new controls
   ============================================================ */
.zoom-controls button:focus-visible,
.phase-card[role='button']:focus-visible,
.lib-search input:focus-visible,
.lib-clear:focus-visible,
.zoomer:focus-visible,
.evo-scrub input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 9px;
}
.evo-scrub input:focus-visible {
  outline-offset: 6px;
}

/* ============================================================
   Mobile polish for the new widgets
   ============================================================ */
@media (max-width: 620px) {
  .zoom-stage {
    height: clamp(220px, 38vh, 300px);
  }
  .zoom-controls button {
    padding: 9px 10px;
    font-size: 11px;
  }
  .evo-scrub {
    flex-wrap: wrap;
    gap: 12px 16px;
  }
  .evo-scrub input[type='range'] {
    order: 3;
    flex-basis: 100%;
  }
  .lib-tools {
    gap: 10px;
  }
  .lib-search {
    min-width: 0;
    flex: 1 1 100%;
  }
  .lib-count {
    order: 3;
  }
  /* chat-vs-canvas table: tighter type so 3 columns fit */
  .wh-table th,
  .wh-table td {
    padding: 11px 11px;
    font-size: 13px;
  }
  .wh-table thead th {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }
  .wh-table td.dim {
    width: 30%;
  }
  /* six-tools canvas keeps a usable height when stacked */
  .wh-canvas {
    height: 240px;
  }
}
