/* ==========================================================================
   ==== Task 5: preview & cite ====
   nezprod — citation chips (js/cite.js), the universal preview modal
   (js/preview.js + js/preview/*) and the transcript (js/components/transcript.js).
   The modal itself is the nz-modal shell from components.css, extended here.
   ========================================================================== */

/* ── Citation chip ─────────────────────────────────────────────────────── */
.nz-cite {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 22px;
  margin: 0 1px;
  padding: 2px 9px 2px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: none;
  vertical-align: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-chip) ease, color var(--dur-chip) ease, background-color var(--dur-chip) ease;
}
.nz-cite__icon {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-dim);
  transition: color var(--dur-chip) ease;
}
.nz-cite__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nz-cite--link::after {
  content: '↗';
  content: '↗' / '';
  font-family: system-ui, sans-serif;
  font-size: 10px;
  color: var(--text-dim);
}
.nz-cite:hover {
  border-color: var(--red);
  color: var(--paper);
}
.nz-cite:hover .nz-cite__icon {
  color: var(--red-text);
}
.nz-cite:active {
  background: var(--red-soft);
}
.nz-cite:focus-visible {
  outline-offset: 2px;
}
.nz-cite--broken {
  border-style: dashed;
  color: var(--text-dim);
  cursor: help;
}
.nz-cite--broken:hover {
  border-color: var(--rule);
  color: var(--text-dim);
}
.nz-cites {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}
.nz-cites .nz-cite {
  margin: 0;
}

/* ≥ 44px hit area on touch, without changing the chip's look. */
@media (pointer: coarse), (max-width: 819.98px) {
  .nz-cite::before {
    content: '';
    position: absolute;
    inset: -11px -3px;
  }
  .nz-cites {
    row-gap: 10px;
  }
}
/* Mobile mode: a slightly taller pill (30px) with an 8px invisible margin
   = 46px; rows of chips 16px apart, so the chip painted under its neighbour
   still owns 30 + 16 = 46px (hit-tested by tools/check-qa.mjs). */
@media (max-width: 819.98px) {
  .nz-cite {
    justify-content: center;
    min-width: 36px;
    min-height: 30px;
    padding: 4px 11px 4px 10px;
  }
  .nz-cite::before {
    inset: -8px -4px;
  }
  .nz-cites {
    /* !important: views set their own `gap` on chip groups; the row gap is
       what keeps every wrapped row a 44px target. */
    row-gap: 16px !important;
  }
}

/* ── Preview modal: the shell, sized for documents ─────────────────────── */
.nz-preview {
  --pv-desk: color-mix(in oklab, var(--ink) 74%, #000 26%);
  --pv-bar-h: 48px;
}
html.theme-light .nz-preview {
  --pv-desk: color-mix(in oklab, var(--ink-deep) 88%, #2a201d 12%);
}
@media (prefers-color-scheme: light) {
  html.theme-auto .nz-preview {
    --pv-desk: color-mix(in oklab, var(--ink-deep) 88%, #2a201d 12%);
  }
}

.nz-preview .nz-modal__dialog {
  width: min(1240px, 100%);
  height: calc(100dvh - 48px);
  max-height: 1240px;
}
.nz-preview--link .nz-modal__dialog,
.nz-preview--missing .nz-modal__dialog {
  width: min(720px, 100%);
  height: auto;
  max-height: calc(100dvh - 48px);
}
.nz-preview .nz-modal__head {
  align-items: center;
  padding: 16px 18px 14px 24px;
}
.nz-preview .nz-modal__heading {
  flex: 1 1 auto;
  gap: 5px;
}
.nz-preview .nz-modal__kicker {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nz-preview__kickicon {
  color: var(--red-text);
}
.nz-preview .nz-modal__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.15;
}
.nz-preview .nz-modal__actions {
  flex-wrap: nowrap;
  gap: 6px;
}
.nz-preview .nz-modal__body {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.nz-preview .nz-modal__foot {
  display: none;
}

/* Header / footer / state actions: quiet mono buttons like "zatvori ✕". */
.nz-preview__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease, background-color var(--dur-hover) ease;
}
.nz-preview__act i {
  font-size: 11px;
  color: var(--text-dim);
}
.nz-preview__act:hover {
  border-color: var(--paper-dim);
}
.nz-preview__act--official {
  border-color: var(--red);
  color: var(--red-text);
}
.nz-preview__act--official i {
  color: var(--red-text);
}
.nz-preview__act--official:hover {
  border-color: var(--red-fill);
  background: var(--red-fill);
  color: var(--on-red);
}
.nz-preview__act--official:hover i {
  color: var(--on-red);
}

/* Note strip (source note / "radna verzija" / local-file reassurance). */
.nz-preview__note {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 24px 10px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--panel) 88%, var(--paper) 4%);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.nz-preview__notetext {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.nz-preview__note[aria-expanded='true'] .nz-preview__notetext {
  display: block;
}
.nz-preview__note:focus-visible {
  outline-offset: -2px;
}
.nz-preview__draft {
  flex: 0 0 auto;
  margin-top: 1px;
}
.nz-preview__lock {
  flex: 0 0 auto;
  color: var(--hue-green);
}

/* Stage: where a viewer mounts. */
.nz-preview__stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  background: var(--pv-desk);
}
.nz-preview__stage[data-kind='transcript'],
.nz-preview__stage[data-kind='xlsx'],
.nz-preview__stage[data-kind='txt'],
.nz-preview__stage[data-kind='link'],
.nz-preview__stage[data-kind='unknown'] {
  background: var(--panel);
}
.nz-pv {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.nz-pv__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.nz-pv__scroll:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* Loading / message states */
.nz-pvstate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: auto;
  padding: 40px 24px;
  max-width: 560px;
  text-align: center;
}
.nz-pvstate--loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: none;
  margin: 0;
  background: var(--pv-desk);
}
.nz-preview__stage[data-kind='transcript'] .nz-pvstate--loading,
.nz-preview__stage[data-kind='xlsx'] .nz-pvstate--loading,
.nz-preview__stage[data-kind='txt'] .nz-pvstate--loading {
  background: var(--panel);
}
.nz-pvstate__bar {
  position: relative;
  display: block;
  width: 160px;
  height: 2px;
  overflow: hidden;
  background: var(--rule);
}
.nz-pvstate__bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--red);
  animation: nz-pv-indeterminate 1.1s var(--ease-panel) infinite;
}
@keyframes nz-pv-indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}
.nz-pvstate__text {
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nz-pvstate--error .nz-pvstate__text,
.nz-pvstate--info .nz-pvstate__text {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
}
.nz-pvstate__icon {
  font-size: 22px;
  color: var(--red-text);
}
.nz-pvstate--info .nz-pvstate__icon {
  color: var(--text-dim);
}
.nz-pvstate__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.nz-pvstate__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

/* ── Viewer toolbar ────────────────────────────────────────────────────── */
.nz-pvbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  min-height: var(--pv-bar-h);
  padding: 6px 14px 6px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
  color: var(--paper);
}
.nz-pvbar__group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.nz-pvbar__spacer {
  flex: 1 1 auto;
}
.nz-pvbar__pages {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.nz-pvbar__kw {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nz-pvbar__page {
  width: 3.4ch;
  padding: 3px 2px;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}
.nz-pvbar__page:focus {
  border-bottom-color: var(--red);
  outline: none;
}
.nz-pvbar__of {
  white-space: nowrap;
}
.nz-pvbar__value {
  min-width: 5.2ch;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
}
.nz-pvbar__note {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.nz-pvbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
.nz-pvbtn i {
  font-size: 12px;
}
.nz-pvbtn:hover {
  border-color: var(--rule);
  color: var(--red-text);
}
.nz-pvbtn:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
  border-color: transparent;
}
.nz-pvbtn:focus-visible {
  outline-offset: 0;
}
.nz-pvbtn--searchtoggle {
  display: none;
}

/* Search box */
.nz-pvsearch {
  display: flex;
  flex: 0 1 340px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border-bottom: 1.5px solid var(--rule);
  transition: border-color var(--dur-hover) ease;
}
.nz-pvsearch:focus-within {
  border-bottom-color: var(--red);
}
.nz-pvsearch__icon {
  flex: 0 0 auto;
  padding-left: 2px;
  color: var(--text-dim);
  font-size: 12px;
}
.nz-pvsearch__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
}
.nz-pvsearch__input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}
.nz-pvsearch__input::-webkit-search-cancel-button {
  filter: grayscale(1);
  opacity: 0.6;
}
.nz-pvsearch__count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.nz-pvsearch .nz-pvbtn {
  min-width: 30px;
  padding: 0 4px;
}
mark.nz-hit {
  padding: 0 1px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--hue-amber) 55%, transparent);
  color: inherit;
}
mark.nz-hit.is-current {
  background: var(--hue-amber);
  color: var(--on-hue);
  outline: 2px solid var(--hue-amber);
}

/* ── PDF ───────────────────────────────────────────────────────────────── */
.nz-pv__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  min-width: min-content;
  padding: 34px 28px 48px;
}
.nz-pv__page {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.28);
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition: outline-color 600ms ease;
}
.nz-pv__page::before {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: 0;
  padding-bottom: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Unrendered placeholder: a faint shimmer of paper. */
.nz-pv__page:not(.is-rendered)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(0, 0, 0, 0.04) 50%, transparent 70%) 0 0 / 300% 100%;
  animation: nz-pv-shimmer 1.6s linear infinite;
}
@keyframes nz-pv-shimmer {
  to { background-position: -300% 0; }
}
.nz-pv__page.is-failed::after {
  content: 'Stranica se nije prikazala';
  display: grid;
  place-items: center;
  background: none;
  color: #6b5d53;
  font-family: var(--font-mono);
  font-size: 11px;
  animation: none;
}
.nz-pv__page.is-flash {
  outline-color: var(--red);
  animation: nz-pv-flash 2.2s ease-out forwards;
}
@keyframes nz-pv-flash {
  0%, 55% { outline-color: var(--red); }
  100% { outline-color: transparent; }
}
.nz-pv__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* pdf.js text layer (subset of pdf_viewer.css 4.10.38). Transparent text
   positioned over the canvas: selectable and findable. */
.nz-pv .textLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: clip;
  line-height: 1;
  text-align: initial;
  opacity: 1;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  caret-color: CanvasText;
}
.nz-pv .textLayer :is(span, br) {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.nz-pv .textLayer > :not(.markedContent),
.nz-pv .textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
}
.nz-pv .textLayer span.markedContent {
  top: 0;
  height: 0;
}
.nz-pv .textLayer ::selection {
  background: rgba(193, 72, 67, 0.32);
  color: transparent;
}
.nz-pv .textLayer br::selection {
  background: transparent;
}
.nz-pv .textLayer .endOfContent {
  display: block;
  position: absolute;
  inset: 100% 0 0;
  z-index: 0;
  cursor: default;
  user-select: none;
}
.nz-pv .textLayer span.is-hit {
  margin: -1px;
  padding: 1px;
  border-radius: 2px;
  background: rgba(232, 160, 74, 0.42);
}
.nz-pv .textLayer span.is-hit-current {
  background: rgba(193, 72, 67, 0.45);
  box-shadow: 0 0 0 2px rgba(193, 72, 67, 0.7);
}

/* ── XLSX ──────────────────────────────────────────────────────────────── */
.nz-pvbar--tabs {
  padding: 0 0 0 12px;
  min-height: 0;
}
.nz-sv__tabs {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.nz-sv__tabs::-webkit-scrollbar {
  display: none;
}
.nz-sv__tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}
.nz-sv__tabicon {
  font-size: 10px;
  opacity: 0.7;
}
.nz-sv__tab:hover {
  color: var(--paper);
}
.nz-sv__tab[aria-selected='true'] {
  color: var(--paper);
  font-weight: 500;
}
.nz-sv__tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 2px;
  background: var(--red);
}
.nz-sv__tab:focus-visible {
  outline-offset: -3px;
}
.nz-sv__hidden {
  padding: 1px 5px;
  border: 1px solid var(--rule);
  font-size: 9.5px;
  text-transform: uppercase;
}
.nz-sv__scroll {
  background: var(--panel);
}
.nz-sv__frame {
  display: inline-block;
  min-width: 100%;
  padding: 0 0 24px;
}
.nz-sv__table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--paper);
}
.nz-sv__col-rh {
  width: 46px;
}
.nz-sv__table th,
.nz-sv__table td {
  padding: 4px 7px;
  border-right: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nz-sv__table td.is-long,
.nz-sv__table td[rowspan],
.nz-sv__table td[colspan] {
  white-space: normal;
  overflow-wrap: anywhere;
}
.nz-sv__table td.is-num {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nz-sv__table td.is-err {
  color: var(--red-text);
  font-family: var(--font-mono);
}
.nz-sv__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 26px;
  background: var(--ink);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.nz-sv__table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--ink);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  text-align: right;
  border-right: 1px solid var(--rule);
}
.nz-sv__table thead .nz-sv__corner {
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--rule);
}
.nz-sv__table tbody tr:hover td {
  background: var(--red-soft);
}
.nz-sv__empty {
  margin: 0;
  padding: 40px 24px;
  color: var(--text-dim);
  text-align: center;
}
.nz-sv__info {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 20px;
  border-top: 1px solid var(--rule);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── DOCX ──────────────────────────────────────────────────────────────── */
.nz-dv__content {
  min-width: min-content;
}
.nz-dv__content .docx-wrapper {
  display: flex;
  flex-flow: column;
  align-items: center;
  padding: 28px 24px 40px;
  background: transparent;
}
.nz-dv__content .docx-wrapper > section.docx {
  margin-bottom: 28px;
  color: #1d1d1d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.28);
}
.nz-dv__content a[href] {
  color: #1a4d8f;
}

/* ── Image ─────────────────────────────────────────────────────────────── */
.nz-iv__scroll {
  display: grid;
}
.nz-iv__canvas {
  display: grid;
  place-items: center;
  min-width: min-content;
  min-height: 100%;
  padding: 24px;
}
.nz-iv__img {
  display: block;
  max-width: none;
  height: auto;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  cursor: zoom-in;
  user-select: none;
}
.nz-pv--img.is-zoomed .nz-iv__img {
  cursor: zoom-out;
}

/* ── Text ──────────────────────────────────────────────────────────────── */
.nz-tv__pre {
  margin: 0;
  padding: 22px 28px 40px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.nz-tv__trunc {
  margin: 0;
  padding: 10px 28px;
  border-bottom: 1px solid var(--rule);
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ── Link card ─────────────────────────────────────────────────────────── */
.nz-lv {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px 32px 32px;
}
.nz-lv__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.nz-lv__note {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}
.nz-lv__url {
  max-width: 100%;
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--rule);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.nz-lv__hint {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ── Transcript (component; also used inline by the Radionica view) ────── */
.nz-tr {
  position: relative;
}
.nz-tr__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 0;
  background: var(--surface, var(--ink));
  border-bottom: 1px solid var(--rule);
}
.nz-tr__bar .nz-pvsearch {
  flex: 1 1 260px;
  max-width: 460px;
}
.nz-tr__speakers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nz-tr__count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.nz-tr__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nz-tr__cue {
  position: relative;
  padding: 14px 16px 14px 18px;
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 60%, transparent);
  scroll-margin: 80px 0;
  transition: background-color 600ms ease;
}
.nz-tr__cue::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 2px;
  background: transparent;
}
.nz-tr__cue.is-current {
  background: var(--red-soft);
}
.nz-tr__cue.is-current::before {
  background: var(--red);
}
/* On the tinted current cue --text-dim falls just under 4.5:1 (light). */
.nz-tr__cue.is-current .nz-tr__role,
.nz-tr__cue.is-current .nz-tr__copy:not(:hover):not(.is-done) {
  color: var(--paper-dim);
}
.nz-tr__cue.is-flash {
  animation: nz-tr-flash 2.2s ease-out;
}
@keyframes nz-tr-flash {
  0%, 35% { background: color-mix(in oklab, var(--red) 30%, transparent); }
}
.nz-tr__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 4px;
}
.nz-tr__time {
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.nz-tr__time:hover,
.nz-tr__cue.is-current .nz-tr__time {
  border-color: var(--red);
  color: var(--red-text);
}
.nz-tr__speaker {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  min-width: 0;
  font-size: 13px;
}
.nz-tr__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--speaker, var(--muted));
  transform: translateY(-1px);
}
.nz-tr__name {
  font-weight: 700;
}
.nz-tr__role {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.nz-tr__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin-left: auto;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  /* Full opacity: --text-dim is tuned to 4.5:1, any dimming would break AA. */
  transition: opacity var(--dur-hover) ease, color var(--dur-hover) ease;
}
.nz-tr__copy i {
  font-size: 10px;
}
.nz-tr__cue:hover .nz-tr__copy,
.nz-tr__cue.is-current .nz-tr__copy,
.nz-tr__copy:focus-visible {
  opacity: 1;
}
.nz-tr__copy:hover {
  color: var(--red-text);
}
.nz-tr__copy.is-done {
  color: var(--hue-green);
  opacity: 1;
}
.nz-tr__text {
  max-width: 78ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}
.nz-tr__empty {
  margin: 0;
  padding: 32px 0;
  color: var(--text-dim);
  text-align: center;
}

/* In the modal */
.nz-trv__scroll {
  padding: 0 28px 40px;
  --surface: var(--panel);
}
.nz-trv__intro {
  margin: 0;
  padding: 14px 0 4px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.nz-trv__intro i {
  color: var(--red-text);
}
.nz-trv__scroll .nz-tr__bar {
  margin-bottom: 4px;
}

/* ── Mobile: full-screen modal, compact chrome, thumb-reachable actions ── */
@media (max-width: 819.98px) {
  .nz-preview .nz-modal__dialog,
  .nz-preview--link .nz-modal__dialog,
  .nz-preview--missing .nz-modal__dialog {
    width: 100%;
    height: 100%;
    max-height: none;
  }
  .nz-preview .nz-modal__head {
    gap: 10px;
    padding: 10px 8px 10px 16px;
  }
  .nz-preview .nz-modal__kicker {
    font-size: 10px;
  }
  .nz-preview .nz-modal__title {
    font-size: 16px;
    -webkit-line-clamp: 2;
  }
  .nz-preview .nz-modal__actions .nz-preview__act {
    display: none;
  }
  .nz-preview .nz-modal__close {
    padding-inline: 12px;
  }
  .nz-preview .nz-modal__foot {
    display: block;
    padding: 0;
    border-top: 1px solid var(--rule);
  }
  .nz-preview__foot {
    display: flex;
  }
  .nz-preview__foot .nz-preview__act {
    flex: 1 1 0;
    min-width: 0;
    min-height: var(--tap);
    padding: 8px 6px;
    border: 0;
    border-right: 1px solid var(--rule);
    font-size: 10.5px;
  }
  .nz-preview__foot .nz-preview__act:last-child {
    border-right: 0;
  }
  .nz-preview__foot .nz-preview__actlabel {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nz-preview__note {
    align-items: center;
    min-height: var(--tap);
    padding: 8px 16px;
    font-size: 12px;
  }
  .nz-preview__act {
    min-height: var(--tap);
  }

  .nz-pvbar {
    gap: 4px 6px;
    padding: 4px 8px;
  }
  .nz-pvbtn {
    min-width: var(--tap);
    height: var(--tap);
  }
  .nz-pvbar__page {
    min-height: var(--tap);
    font-size: 16px; /* no iOS zoom on focus */
    width: 3.6ch;
  }
  .nz-pvbar__kw,
  .nz-pvbtn--fit .nz-pvbtn__label,
  .nz-pvbar__note--hint {
    display: none;
  }
  .nz-pvsearch__input,
  .nz-tr .nz-pvsearch__input {
    height: var(--tap);
    font-size: 16px;
  }
  .nz-pv__pages {
    gap: 30px;
    padding: 30px 10px 40px;
  }
  .nz-tv__pre {
    padding: 16px 16px 32px;
    font-size: 12px;
  }
  .nz-trv__scroll {
    padding: 0 16px 32px;
  }
  .nz-tr__speakers {
    row-gap: 12px;
  }
  .nz-tr__cue {
    padding: 12px 4px 12px 12px;
  }
  .nz-tr__time,
  .nz-tr__copy {
    min-height: 36px;
  }
  .nz-tr__copylabel {
    display: none;
  }
  .nz-tr__copy {
    min-width: var(--tap);
    justify-content: center;
  }
  .nz-sv__info {
    padding: 6px 16px;
  }
  .nz-dv__content .docx-wrapper {
    padding: 16px 10px 28px;
  }
  .nz-iv__canvas {
    padding: 10px;
  }
  .nz-lv {
    padding: 22px 16px 28px;
  }
  .nz-pvbar__note:not(.nz-pvbar__note--hint) {
    display: none;
  }
}

/* Narrow toolbars: the search field hides behind a toggle. */
@media (max-width: 599.98px) {
  .nz-pv--pdf .nz-pvbtn--searchtoggle {
    display: inline-flex;
  }
  .nz-pv--pdf .nz-pvbar > .nz-pvsearch {
    display: none;
    flex: 1 1 100%;
  }
  .nz-pv--pdf[data-search='open'] .nz-pvbar > .nz-pvsearch {
    display: flex;
  }
  .nz-pv--pdf[data-search='open'] .nz-pvbtn--searchtoggle {
    color: var(--red-text);
  }
  /* One toolbar row on phones: page nav, − +, search. The percentage and
     the fit button give way (− returns to a comfortable size quickly). */
  .nz-pv--pdf .nz-pvbar {
    flex-wrap: wrap;
    gap: 4px 2px;
  }
  .nz-pv--pdf .nz-pvbar__value,
  .nz-pv--pdf .nz-pvbtn--fit {
    display: none;
  }
  .nz-pv--pdf .nz-pvbar__pages {
    padding: 0 2px;
  }
  .nz-pv--text .nz-pvsearch {
    flex: 1 1 100%;
  }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nz-pvstate__bar > span {
    left: 30%;
    animation: none;
  }
  .nz-pv__page:not(.is-rendered)::after {
    animation: none;
  }
  .nz-pv__page.is-flash {
    animation: none;
    outline-color: var(--red);
  }
  .nz-tr__cue.is-flash {
    animation: none;
  }
}

/* ── Print: chips read as plain bracketed references ──────────────────── */
@media print {
  .nz-cite {
    padding: 0;
    border: 0;
    color: inherit;
  }
  .nz-cite__icon {
    display: none;
  }
  .nz-cite::before {
    content: '[';
    position: static;
  }
  .nz-cite::after {
    content: ']';
  }
}
