/* The voice gallery. The public site's own tokens (site.css) carry over; this
   only adds the gallery, the detail panel, and the demoted own-writing flow. */

.demo-head { max-width: 720px; }
.demo-head .lede { font: 17px/1.55 var(--sans); color: var(--muted); margin: 8px 0 0; }

/* filter chips */
.voice-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 18px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font: 500 13px/1 var(--sans); padding: 8px 14px;
  border-radius: 999px; cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* gallery */
/* One row that scrolls sideways. Fifteen portraits in a grid pushed the draft
   below the fold, and a row that is cut off mid-card says there is more of it
   without any instruction to that effect. */
.voice-gallery {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  /* Room for the selected card's ring, which the scroll box would clip. */
  padding: 3px 3px 10px;
  margin-left: -3px;
  /* The row can end on a card boundary, which reads as the end of the list.
     A soft right edge says otherwise. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), rgba(0, 0, 0, 0.15));
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), rgba(0, 0, 0, 0.15));
}
.voice-gallery::-webkit-scrollbar { display: none; }
.voice-gallery .loading { padding: 18px 0; }
.voice-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 4px; padding: 18px 12px 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  flex: 0 0 152px;
  scroll-snap-align: start;
}
.voice-card[hidden] { display: none !important; }
.voice-card:hover { border-color: var(--accent); }
.voice-card.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.portrait {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--code); filter: grayscale(0.15);
}
.voice-card .vc-name { font: 600 14px/1.2 var(--sans); color: var(--ink); margin-top: 6px; }
.voice-card .vc-role { font: 12px/1.2 var(--sans); color: var(--muted); }
.voice-card .vc-cat {
  font: 500 10px/1 var(--sans); color: var(--accent); margin-top: 4px;
}

/* detail panel */
.voice-detail {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; margin-bottom: 40px;
}
.detail-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
}
.detail-close:hover { color: var(--ink); }
.detail-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 8px; }
.portrait.lg { width: 96px; height: 96px; flex: 0 0 auto; }
.detail-head h2 { font: 600 24px/1.15 var(--sans); letter-spacing: -0.02em; margin: 0; }
.detail-head .who { font: 13px/1.3 var(--sans); color: var(--muted); margin: 4px 0 8px; }
.detail-head .who .cat { color: var(--accent); }
.detail-head .blurb { font: 15px/1.5 var(--sans); margin: 0 0 6px; max-width: 60ch; }

.mini-strip { margin: 12px 0 18px; }
.mini-strip .strip-label {
  display: block; font: 11px/1 var(--sans);color: var(--muted); margin-bottom: 6px;
}
.mini-strip svg { display: block; width: 100%; height: 26px; }
.mini-strip rect { fill: var(--accent); }

.two-col { display: grid; gap: 16px; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; } }
.col { min-width: 0; }
.col-head {
  font: 600 12px/1 var(--sans); color: var(--muted); margin-bottom: 8px;
}
.col.before .body { color: var(--muted); }
.col .body { font: 15px/1.6 var(--sans); white-space: pre-wrap; margin: 0; }

.scores { display: flex; gap: 26px; margin: 14px 0 4px; }
.scores .metric b { display: block; font: 600 26px/1 var(--mono); font-variant-numeric: tabular-nums; }
.scores .metric span { font: 11px/1.35 var(--sans); color: var(--muted); }
.scores .metric em { font-style: normal; color: var(--accent); }
.verdict { font: 13px/1.4 var(--sans); margin: 6px 0 0; }
.verdict.pass { color: var(--low); }
.verdict.fail { color: var(--high); }

.voice-specs { margin: 22px 0 0; border-top: 1px solid var(--line); padding-top: 16px; }
.specs-title {
  font: 600 12px/1 var(--sans); color: var(--muted); margin: 0 0 8px;
}
.detail-foot { margin: 18px 0 0; }

/* the demoted own-writing flow */
.own-writing { border-top: 1px solid var(--line); padding-top: 8px; }
.own-writing > summary {
  font: 600 16px/1.3 var(--sans); cursor: pointer; padding: 12px 0; color: var(--ink);
  list-style: none;
}
.own-writing > summary::-webkit-details-marker { display: none; }
.own-writing > summary::before { content: "+ "; color: var(--muted); }
.own-writing[open] > summary::before { content: "\2212 "; }
.own-body { padding-top: 8px; }

@media (max-width: 560px) {
  .detail-head { flex-direction: column; }
  .scores { gap: 20px; }
}
