/* ============================================================
   BrettZone v2 — Commentary search (/commentary)
   Search field, filters, fight-grouped results, landing, and the
   inline preview (desktop side panel, phone bottom sheet).
   Tokens only (design.md). Prefix bz-cmt- (bz-cm- is Clip Maker).
   Loaded by pages/commentary.php.
   ============================================================ */

/* Elements the script reveals (copy buttons, the filters toggle) stay hidden
   until it does, even where a .bz-btn display rule would show them. */
.bz-cmt [hidden] { display: none !important; }

.bz-cmt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.bz-cmt-head { margin-bottom: 14px; }
.bz-cmt-head .bz-hero-display { margin: 8px 0 10px; }
.bz-cmt-lede {
  max-width: 640px;
  margin: 0;
  color: var(--bz-text-dim);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Search field ---------- */
.bz-cmt-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.bz-cmt-searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  padding: 6px 6px 6px 18px;
  background: var(--bz-surface-1);
  border: 1px solid var(--bz-border-strong);
  border-radius: var(--bz-r-sm);
  transition: border-color var(--bz-d-fast) var(--bz-ease);
  overflow: hidden;
}
.bz-cmt-searchbar:hover { border-color: var(--bz-text-faint); }
.bz-cmt-searchbar:focus-within { border-color: var(--bz-accent); outline: 2px solid var(--bz-focus); outline-offset: 2px; }
.bz-cmt-searchbar__icon { display: inline-flex; color: var(--bz-text-muted); }
.bz-cmt-searchbar__icon .bz-icon { width: 20px; height: 20px; }
.bz-cmt-searchbar__input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 4px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--bz-text);
  font: 500 20px/1.2 var(--bz-font-ui);
  letter-spacing: 0.01em;
}
.bz-cmt-searchbar__input::placeholder { color: var(--bz-text-muted); }
/* The bar carries the focus ring; the field inside must not draw a second one. */
.bz-cmt-searchbar__input:focus,
.bz-cmt-searchbar__input:focus-visible,
.bz-cmt-input input:focus,
.bz-cmt-input input:focus-visible { outline: none; box-shadow: none; }
.bz-cmt-searchbar__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.bz-cmt-searchbar__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--bz-r-sm);
  color: var(--bz-text-muted);
  cursor: pointer;
}
.bz-cmt-searchbar__clear:hover { color: var(--bz-text); background: var(--bz-surface-2); }
.bz-cmt-searchbar__clear:focus-visible { outline: 2px solid var(--bz-focus); outline-offset: 0; }
.bz-cmt .bz-cmt-searchbar__go { min-height: 46px; padding-inline: 22px; flex-shrink: 0; }
/* Loading: a thin accent sweep along the bottom edge (no spinners). */
.bz-cmt-searchbar__spin {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--bz-d-fast) var(--bz-ease);
  pointer-events: none;
}
.bz-cmt-searchbar__spin::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background: var(--bz-accent);
  animation: bz-cmt-sweep 1.1s var(--bz-ease) infinite;
}
.bz-cmt.is-loading .bz-cmt-searchbar__spin { opacity: 1; }
@keyframes bz-cmt-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(340%); }
}
.bz-cmt-help {
  margin: 0;
  color: var(--bz-text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.bz-cmt-help .bz-mono { color: var(--bz-text-dim); font-size: 11px; }

/* ---------- Filters ---------- */
.bz-cmt-filters { display: flex; flex-direction: column; gap: 12px; }
.bz-cmt .bz-cmt-filters-toggle { align-self: flex-start; min-height: 44px; }
.bz-cmt-filters-toggle__count:empty { display: none; }
.bz-cmt-filters-toggle__count {
  min-width: 20px;
  padding: 2px 5px 1px;
  border-radius: var(--bz-r-xs);
  background: var(--bz-accent-bg);
  color: var(--bz-accent-strong);
  font-size: 11px;
  text-align: center;
}
.bz-cmt-weights { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; align-items: center; gap: 10px; }
.bz-cmt-weights__pills { flex-wrap: wrap; }
.bz-cmt-field__label {
  padding: 0;
  font: 700 10px/1.2 var(--bz-font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bz-text-muted);
}
.bz-cmt-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 44px;
  user-select: none;
}
.bz-cmt-pill input,
.bz-cmt-sort__btn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.bz-cmt-pill:has(input:focus-visible),
.bz-cmt-sort__btn:has(input:focus-visible) { outline: 2px solid var(--bz-focus); outline-offset: 2px; }
.bz-cmt-filters__grid {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(180px, 1.6fr) minmax(120px, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}
.bz-cmt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bz-cmt-input { min-height: 44px; }
.bz-cmt-input input { -webkit-appearance: none; appearance: none; font-size: 14px; }
.bz-cmt-input:focus-within { border-color: var(--bz-accent-dim); outline: 2px solid var(--bz-focus); outline-offset: 1px; }
.bz-cmt-input > .bz-icon { color: var(--bz-text-muted); }
/* Themed single-value selects — design.md §9. */
.bz-cmt-select { position: relative; display: block; min-width: 0; }
.bz-cmt-select__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 0 40px 0 12px;
  background: var(--bz-surface-1);
  border: 1px solid var(--bz-border);
  border-radius: var(--bz-r-sm);
  color: var(--bz-text);
  font: 500 14px/1.2 var(--bz-font-ui);
  color-scheme: dark;
  cursor: pointer;
  text-overflow: ellipsis;
}
.bz-cmt-select__input:hover { border-color: var(--bz-border-strong); }
.bz-cmt-select__input:focus-visible { outline: 2px solid var(--bz-focus); outline-offset: 1px; }
.bz-cmt-select > .bz-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--bz-text-dim);
  pointer-events: none;
}
@media (forced-colors: active) {
  .bz-cmt-select__input { -webkit-appearance: auto; appearance: auto; padding-right: 11px; }
  .bz-cmt-select > .bz-icon { display: none; }
}
.bz-cmt-sort__seg { min-height: 44px; }
.bz-cmt-sort__btn { position: relative; min-height: 38px; padding-inline: 14px; }
.bz-cmt .bz-cmt-apply { min-height: 44px; justify-content: center; align-self: flex-start; }

/* ---------- Results region ---------- */
.bz-cmt-region { margin-top: 14px; min-height: 240px; transition: opacity var(--bz-d-fast) var(--bz-ease); }
.bz-cmt.is-stale .bz-cmt-region { opacity: 0.55; }
.bz-cmt-active { padding: 0 0 12px; }
.bz-cmt-active a { text-decoration: none; min-height: 28px; }
.bz-empty__chips .bz-pill { display: inline-flex; align-items: center; text-decoration: none; }
.bz-cmt-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--bz-text-dim);
  font-size: 13px;
}
.bz-cmt-count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 2px 0 10px;
  color: var(--bz-text-dim);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.bz-cmt-count__sort { color: var(--bz-text-muted); }

.bz-cmt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bz-cmt-list--fights { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 10px; }

/* ---------- Fight card ---------- */
.bz-cmt-card { padding: 16px 20px 16px 22px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.bz-cmt-card__stripe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--bz-surface-3);
}
.bz-cmt-card__stripe[data-w="3"]  { background: var(--bz-w3); }
.bz-cmt-card__stripe[data-w="12"] { background: var(--bz-w12); }
.bz-cmt-card__stripe[data-w="30"] { background: var(--bz-w30); }
.bz-cmt-card__stripe[data-w="fs"] { background: var(--bz-w-fs); }
.bz-cmt-card__head { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bz-cmt-vs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  min-width: 0;
  font: italic 800 20px/1.15 var(--bz-font-display);
  letter-spacing: -0.01em;
}
.bz-cmt-vs__vs {
  color: var(--bz-text-faint);
  font: 500 11px/1 var(--bz-font-mono);
  font-style: normal;
  letter-spacing: 0.08em;
}
.bz-cmt-bot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  color: var(--bz-text-dim);
  text-decoration: none;
  transition: color var(--bz-d-fast) var(--bz-ease);
}
.bz-cmt-bot .bz-bot-photo { flex-shrink: 0; }
.bz-cmt-bot__name { min-width: 0; overflow-wrap: anywhere; }
.bz-cmt-bot.is-win { color: var(--bz-text); }
.bz-cmt-bot.is-loss { color: var(--bz-text-muted); }
a.bz-cmt-bot:hover { color: var(--bz-accent-strong); }
.bz-cmt-bot:focus-visible { outline: 2px solid var(--bz-focus); outline-offset: 2px; }
.bz-cmt-bot__mark {
  margin-right: 6px;
  color: var(--bz-win);
  font-size: 11px;
  font-style: normal;
  vertical-align: 3px;
}
.bz-cmt-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  color: var(--bz-text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.bz-cmt-card__meta > .bz-mono { overflow-wrap: anywhere; }
.bz-cmt-card__len { color: var(--bz-text-muted); }
.bz-cmt-card__hits { margin-left: auto; color: var(--bz-accent-strong); }
.bz-cmt-card__rest { margin: 0; color: var(--bz-text-muted); font-size: 12px; }

/* ---------- Passages and lines ---------- */
.bz-cmt-passages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bz-cmt-passage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bz-bg);
  border: 1px solid var(--bz-border);
  border-radius: var(--bz-r-sm);
}
.bz-cmt-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bz-cmt-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 3px 6px;
  border-radius: var(--bz-r-xs);
}
.bz-cmt-line__text { overflow-wrap: anywhere; line-height: 1.45; }
.bz-cmt-line.is-ctx .bz-cmt-line__text { color: var(--bz-text-muted); font-size: 13px; }
.bz-cmt-line.is-hit {
  background: var(--bz-surface-2);
  box-shadow: inset 3px 0 0 var(--bz-accent);
}
.bz-cmt-line.is-hit .bz-cmt-line__text { color: var(--bz-text); font-size: 15px; }
.bz-cmt-line mark,
.bz-cmt-preview__line mark {
  padding: 0 1px;
  background: var(--bz-accent-bg);
  color: var(--bz-accent-strong);
  box-shadow: inset 0 -2px 0 var(--bz-accent);
  border-radius: 1px;
}
.bz-cmt-t {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  justify-self: start;
  padding: 3px 6px 2px;
  border: 1px solid var(--bz-border);
  border-radius: var(--bz-r-xs);
  color: var(--bz-text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.bz-cmt-t.is-hit { color: var(--bz-accent-strong); border-color: var(--bz-accent-dim); }
.bz-cmt-t.is-pre { border-style: dashed; }
.bz-cmt-t__pre {
  color: var(--bz-text-faint);
  font: 700 8px/1 var(--bz-font-ui);
  letter-spacing: 0.12em;
}
.bz-cmt-t.is-hit .bz-cmt-t__pre { color: var(--bz-text-muted); }

.bz-cmt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-left: 88px; }
.bz-cmt-actions .bz-btn { min-height: 36px; }
.bz-cmt-actions .bz-btn:focus-visible,
.bz-cmt-more > summary:focus-visible,
.bz-cmt-loadmore:focus-visible,
.bz-cmt-try__chip:focus-visible { outline: 2px solid var(--bz-focus); outline-offset: 2px; }
.bz-cmt-play { border-color: var(--bz-accent-dim); }
.bz-cmt-play:hover { border-color: var(--bz-accent); color: var(--bz-accent-strong); }
.bz-cmt-card--fight .bz-cmt-actions { padding-left: 0; margin-top: auto; }

.bz-cmt-more > summary { display: inline-flex; list-style: none; cursor: pointer; min-height: 36px; }
.bz-cmt-more > summary::-webkit-details-marker { display: none; }
.bz-cmt-more[open] > summary { margin-bottom: 10px; }
.bz-cmt-more[open] > summary .bz-icon { transform: rotate(180deg); }

/* ---------- Load more ---------- */
.bz-cmt-morebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
}
.bz-cmt .bz-cmt-loadmore { min-height: 44px; padding-inline: 22px; }
.bz-cmt-morebar__count { color: var(--bz-text-muted); font-size: 11px; letter-spacing: 0.06em; }

/* ---------- Landing ---------- */
.bz-cmt-landing { display: flex; flex-direction: column; gap: 20px; }
.bz-cmt-stats { margin-top: 4px; }
.bz-cmt-progress { max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.bz-cmt-progress__text {
  margin: 0;
  color: var(--bz-text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.bz-cmt-progress__sep { color: var(--bz-text-faint); }
.bz-cmt-progress__label {
  font: 700 10px/1.2 var(--bz-font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bz-text-muted);
}
.bz-cmt-progress__bar { height: 4px; background: var(--bz-surface-3); border-radius: var(--bz-r-xs); overflow: hidden; }
.bz-cmt-progress__bar > span { display: block; height: 100%; background: var(--bz-accent); }
.bz-cmt-try { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.bz-cmt-try .bz-eyebrow { margin: 0; }
.bz-cmt-try__chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.bz-cmt-try__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 13px;
}
.bz-cmt-try__chip .bz-icon { color: var(--bz-text-muted); }
.bz-cmt-try__chip:hover .bz-icon { color: var(--bz-accent-strong); }
.bz-cmt-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: -8px;
}
.bz-cmt-section-head .bz-eyebrow { margin: 0; }
.bz-cmt-section-head .bz-mono { color: var(--bz-text-muted); font-size: 10px; letter-spacing: 0.06em; }

/* ---------- Skeletons ---------- */
.bz-cmt-card--skeleton { gap: 12px; }
.bz-cmt-skel-row { display: flex; align-items: center; gap: 12px; }
.bz-cmt-skel-photo { width: 40px; height: 40px; flex-shrink: 0; }
.bz-cmt-skel-title { height: 20px; width: min(320px, 50%); }
.bz-cmt-skel-meta { display: block; height: 12px; width: min(420px, 70%); }
.bz-cmt-skel-line { display: block; height: 16px; width: 92%; }
.bz-cmt-skel-line--short { width: 64%; }

/* ---------- Spoiler-free ---------- */
.bz-cmt-spoiler { max-width: 640px; }
.bz-cmt-spoiler__alt { margin: 12px 0 0; text-align: center; }
.bz-cmt-spoiler__alt a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--bz-text-dim);
  font-size: 13px;
}
.bz-cmt-spoiler__alt a:hover { color: var(--bz-accent-strong); }

/* ---------- Preview: desktop side panel ---------- */
.bz-cmt-preview { position: fixed; inset: 0; z-index: 300; }
.bz-cmt-preview[hidden] { display: none; }
.bz-cmt-preview__scrim {
  position: absolute;
  inset: 0;
  background: var(--bz-overlay);
  opacity: 0;
  transition: opacity var(--bz-d-base) var(--bz-ease);
}
.bz-cmt-preview.is-open .bz-cmt-preview__scrim { opacity: 1; }
.bz-cmt-preview__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(560px, 46vw);
  background: var(--bz-surface-1);
  border-left: 1px solid var(--bz-border-strong);
  box-shadow: var(--bz-shadow-2);
  transform: translateX(100%);
  transition: transform var(--bz-d-slow) var(--bz-ease);
  outline: none;
}
.bz-cmt-preview.is-open .bz-cmt-preview__panel { transform: translateX(0); }
.bz-cmt-preview__handle { display: none; }
.bz-cmt-preview__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--bz-border);
  flex-shrink: 0;
}
.bz-cmt-preview__titles { flex: 1; min-width: 0; }
.bz-cmt-preview__titles .bz-eyebrow { margin: 0 0 6px; overflow-wrap: anywhere; }
.bz-cmt-preview__title {
  margin: 0;
  font: italic 800 22px/1.15 var(--bz-font-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.bz-cmt-preview__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--bz-surface-2);
  border: 1px solid var(--bz-border);
  border-radius: var(--bz-r-sm);
  color: var(--bz-text);
  cursor: pointer;
}
.bz-cmt-preview__close:hover { background: var(--bz-surface-3); border-color: var(--bz-border-strong); }
.bz-cmt-preview__close:focus-visible,
.bz-cmt-preview__tap:focus-visible,
.bz-cmt-preview__pline:focus-visible,
.bz-cmt-preview__foot .bz-btn:focus-visible,
.bz-cmt-preview__video:focus-visible { outline: 2px solid var(--bz-focus); outline-offset: 2px; }
.bz-cmt-preview__media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  background: var(--bz-bg);
  border-bottom: 1px solid var(--bz-border);
}
.bz-cmt-preview__video { display: block; width: 100%; height: 100%; background: var(--bz-bg); object-fit: contain; }
.bz-cmt-preview__tap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  background: var(--bz-accent);
  border: 0;
  color: var(--bz-bg);
  font: 700 13px/1 var(--bz-font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.bz-cmt-preview__tap:hover { background: var(--bz-accent-strong); }
.bz-cmt-preview__tap[hidden] { display: none; }
.bz-cmt-preview__status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 4px 8px 3px;
  background: var(--bz-overlay);
  border-radius: var(--bz-r-xs);
  color: var(--bz-text-dim);
  font: 500 11px/1.3 var(--bz-font-mono);
  pointer-events: none;
}
.bz-cmt-preview__status:empty { display: none; }
.bz-cmt-preview__now { display: none; }
.bz-cmt-preview__lines {
  list-style: none;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.bz-cmt-preview__pline {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 8px;
  background: transparent;
  border: 0;
  border-radius: var(--bz-r-xs);
  color: var(--bz-text-muted);
  font: 400 14px/1.45 var(--bz-font-ui);
  text-align: left;
  cursor: pointer;
  transition: background var(--bz-d-fast) var(--bz-ease), color var(--bz-d-fast) var(--bz-ease);
}
.bz-cmt-preview__pline:hover { background: var(--bz-surface-2); color: var(--bz-text-dim); }
.bz-cmt-preview__pline .bz-cmt-preview__text { overflow-wrap: anywhere; }
.bz-cmt-preview__pline.is-target { color: var(--bz-text-dim); }
.bz-cmt-preview__pline.is-active {
  background: var(--bz-accent-bg);
  box-shadow: inset 3px 0 0 var(--bz-accent);
  color: var(--bz-text);
}
.bz-cmt-preview__pline.is-active .bz-cmt-t { color: var(--bz-accent-strong); border-color: var(--bz-accent-dim); }
.bz-cmt-preview__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--bz-safe-bottom));
  border-top: 1px solid var(--bz-border);
  background: var(--bz-surface-1);
  flex-shrink: 0;
}
.bz-cmt-preview__foot .bz-btn { min-height: 44px; justify-content: center; }
.bz-cmt-preview__open { flex: 1; }
html.bz-cmt-lock, html.bz-cmt-lock body { overflow: hidden; }

/* ---------- Toast ---------- */
.bz-cmt-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--bz-safe-bottom));
  z-index: 400;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 14px 9px;
  background: var(--bz-surface-3);
  border: 1px solid var(--bz-border-strong);
  border-radius: var(--bz-r-sm);
  box-shadow: var(--bz-shadow-2);
  color: var(--bz-text);
  font: 600 12px/1.2 var(--bz-font-ui);
  letter-spacing: 0.04em;
}
.bz-cmt-toast[hidden] { display: none; }

@media (min-width: 768px) {
  .bz-cmt .bz-cmt-filters-toggle { display: none !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1099px) {
  .bz-cmt-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bz-cmt-preview__panel { width: min(560px, 70vw); }
}

/* ---------- Phone ---------- */
@media (max-width: 767.98px) {
  .bz-cmt-head .bz-hero-display { margin-bottom: 6px; }
  .bz-cmt-lede { font-size: 13px; }
  .bz-cmt-searchbar { min-height: 54px; padding: 4px 4px 4px 12px; gap: 4px; }
  .bz-cmt-searchbar__icon .bz-icon { width: 18px; height: 18px; }
  /* 16px+ stops iOS zooming into the field. */
  .bz-cmt-searchbar__input { font-size: 17px; height: 44px; }
  .bz-cmt .bz-cmt-searchbar__go { padding-inline: 14px; min-height: 44px; }
  .bz-cmt-input input,
  .bz-cmt-select__input { font-size: 16px; }
  .bz-cmt-help { font-size: 11px; }
  .bz-cmt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: 18px; }
  .bz-cmt-stats .bz-statrow__num { font-size: 26px; }
  .bz-cmt-stats .bz-statrow__label { font-size: 9px; letter-spacing: 0.12em; line-height: 1.3; }
  /* With the script, filters fold behind a toggle so results stay near the field. */
  .bz-cmt.is-js .bz-cmt-filters { display: none; }
  .bz-cmt.is-js.is-filters-open .bz-cmt-filters { display: flex; }
  .bz-cmt-weights { flex-direction: column; align-items: stretch; gap: 6px; }
  .bz-cmt-weights__pills { flex-wrap: nowrap; }
  .bz-cmt-pill { min-height: var(--bz-touch-min); }
  .bz-cmt-filters__grid { grid-template-columns: minmax(0, 1fr); }
  .bz-cmt-sort__seg { display: flex; }
  .bz-cmt-sort__btn { min-height: var(--bz-touch-min); }
  .bz-cmt-card { padding: 14px 12px 14px 16px; gap: 10px; }
  .bz-cmt-vs { font-size: 17px; gap: 2px 10px; }
  .bz-cmt-card__hits { margin-left: 0; }
  .bz-cmt-passage { padding: 8px; }
  .bz-cmt-line { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 4px 6px; }
  .bz-cmt-line.is-hit .bz-cmt-line__text { font-size: 15px; }
  .bz-cmt-actions { padding-left: 0; flex-wrap: nowrap; }
  .bz-cmt-actions .bz-btn { min-height: var(--bz-touch-min); flex: 1 1 0; justify-content: center; }
  /* Copy link folds to its icon (the button keeps its aria-label). */
  .bz-cmt-actions .bz-cmt-copy { flex: 0 0 var(--bz-touch-min); padding: 0; }
  .bz-cmt-actions .bz-cmt-copy span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .bz-cmt-more > summary { min-height: var(--bz-touch-min); }
  .bz-cmt-try__chip { min-height: var(--bz-touch-min); }
  .bz-cmt-list--fights { grid-template-columns: minmax(0, 1fr); }

  /* Preview becomes a bottom sheet. */
  .bz-cmt-preview__panel {
    top: auto;
    left: 0;
    width: 100%;
    height: min(90dvh, 820px);
    border-left: 0;
    border-top: 1px solid var(--bz-border-strong);
    border-radius: var(--bz-r-lg) var(--bz-r-lg) 0 0;
    transform: translateY(100%);
  }
  .bz-cmt-preview.is-open .bz-cmt-preview__panel { transform: translateY(0); }
  .bz-cmt-preview__handle {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: var(--bz-border-strong);
    flex-shrink: 0;
  }
  .bz-cmt-preview__head { padding: 8px 12px 10px 16px; }
  .bz-cmt-preview__title { font-size: 18px; }
  .bz-cmt-preview__pline { grid-template-columns: 64px minmax(0, 1fr); font-size: 14px; }
  .bz-cmt-toast { bottom: calc(var(--bz-tabbar-pad) + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .bz-cmt-searchbar__spin::after { animation: none; width: 100%; opacity: 0.6; }
  .bz-cmt-preview__panel,
  .bz-cmt-preview__scrim { transition: none; }
}
