/* =============================================
   TRANSCRIPT VIEWER
   ============================================= */

.container.wide { max-width: 1400px; }

.tv { margin-top: 1.5rem; margin-bottom: 2rem; }
.tv-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 900; color: var(--slate-900); margin-bottom: .7rem; }

.tv-meeting { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.tv-meeting label { font-weight: 600; font-size: .9rem; color: var(--slate-700); }
.tv select, .tv input[type="search"], .tv-review input[type="text"], .tv-review input[type="password"], .tv-review select {
  font: inherit; font-size: .9rem; padding: .45rem .6rem; border: 1px solid var(--slate-300);
  border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%;
}
.tv select:focus-visible, .tv input:focus-visible, .tv-review input:focus-visible, .tv-review select:focus-visible,
.tv button:focus-visible, .tv-review button:focus-visible, .tv-row:focus-visible { outline: 2px solid var(--slate-800); outline-offset: 2px; }
.tv-status { font-size: .85rem; color: var(--slate-500); }
.tv-auth { margin-left: auto; font-size: .85rem; color: var(--slate-600); display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tv-auth .tv-btn { padding: .3rem .7rem; font-size: .82rem; }

.tv-notice { font-size: .9rem; color: var(--amber-700); background: var(--amber-50); border: 1px solid var(--amber-100);
  border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; line-height: 1.5; }

/* ---- player (sticks to the top while reading) ---- */
.tv-player { margin-bottom: .8rem; }
.tv-player audio { width: 100%; height: 40px; }
.tv-player-row { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-top: .45rem; }
.tv-now { flex: 1 1 14rem; min-width: 0; font-size: .85rem; color: var(--slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-speed { display: inline-flex; gap: 2px; }
.tv-speed button { font: inherit; font-size: .78rem; padding: .25rem .5rem; border: 1px solid var(--slate-300); background: #fff;
  color: var(--slate-700); cursor: pointer; }
.tv-speed button:first-child { border-radius: 6px 0 0 6px; } .tv-speed button:last-child { border-radius: 0 6px 6px 0; }
.tv-speed button.on { background: var(--slate-800); color: #fff; border-color: var(--slate-800); }
.tv-check { font-size: .85rem; color: var(--slate-700); display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.tv-review-toggle { font-weight: 600; }

.tv-tools { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-bottom: .8rem; }
.tv-tools input[type="search"] { flex: 1 1 14rem; }
.tv-count { font-size: .8rem; color: var(--slate-500); margin-left: auto; }

/* ---- transcript lines ---- */
.tv-list { list-style: none; }
.tv-row { display: grid; grid-template-columns: 4.6rem 1fr; gap: .2rem .8rem; padding: .65rem .5rem; border-bottom: 1px solid var(--slate-100);
  border-left: 4px solid var(--sp, var(--slate-300)); cursor: pointer; position: relative; }
.tv-row:hover { background: var(--slate-50); }
.tv-row.active { background: var(--amber-50); }
.tv-row.sel { background: #e8f0fe; box-shadow: inset 0 0 0 1px #93b4f5; }
.tv-row.hidden { display: none; }
.tv-ts { font-family: var(--mono); font-size: .78rem; color: var(--slate-500); background: none; border: 0; padding: .1rem 0; text-align: left; cursor: pointer; align-self: start; }
.tv-ts:hover { color: var(--slate-900); text-decoration: underline; }
.tv-who { font-weight: 700; font-size: .88rem; color: var(--slate-900); }
.tv-who .role { font-weight: 400; color: var(--slate-500); margin-left: .35rem; }
.tv-who.unid { color: var(--slate-500); font-weight: 600; font-style: italic; }
.tv-who .guess { font-weight: 400; opacity: .75; }
.tv-flag { display: inline-block; font-size: .7rem; font-weight: 600; margin-left: .5rem; padding: .05rem .4rem; border-radius: 999px;
  background: var(--amber-100); color: var(--amber-700); }
.tv-flag.human { background: var(--green-100); color: var(--green-700); }
.tv-text { grid-column: 2; font-family: var(--serif); font-size: 1.02rem; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.tv-text mark { background: #fde68a; color: inherit; border-radius: 2px; }
.tv-mine { grid-column: 2; font-size: .78rem; color: var(--green-700); }
.tv-review-on .tv-row::before { content: ""; position: absolute; left: -1.35rem; top: .85rem; width: .8rem; height: .8rem;
  border: 2px solid var(--slate-400); border-radius: 3px; background: #fff; }
.tv-review-on .tv-row.sel::before { background: #2563eb; border-color: #2563eb; }

/* ---- review bar ---- */
.tv-review { background: #fff; border: 2px solid var(--slate-800); border-radius: 8px; padding: .7rem .8rem; margin-top: .8rem; }
.tv-review[hidden] { display: none; }
.tv-review-inner { max-width: 100%; }
.tv-review-sum { font-size: .85rem; color: var(--slate-700); margin-bottom: .5rem; }
.tv-review-sum strong { color: var(--slate-900); }
.tv-review-fields { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: end; }
.tv-field { display: flex; flex-direction: column; font-size: .75rem; font-weight: 600; color: var(--slate-600); gap: .2rem; min-width: 0; }
.tv-field input, .tv-field select { font-weight: 400; }
.tv-grow { flex: 1 1 14rem; }
.tv-btn { font: inherit; font-size: .88rem; font-weight: 600; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--slate-300); background: #fff; color: var(--slate-800); cursor: pointer; }
.tv-btn:hover { background: var(--slate-50); }
.tv-primary { background: var(--slate-800); color: #fff; border-color: var(--slate-800); }
.tv-primary:hover { background: var(--slate-900); }
.tv-btn[disabled] { opacity: .5; cursor: not-allowed; }
.tv-adv { margin-top: .5rem; font-size: .85rem; }
.tv-adv summary { cursor: pointer; color: var(--slate-600); }
.tv-adv[open] { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: end; }
.tv-adv[open] summary { flex-basis: 100%; }
.tv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.tv-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--slate-900); color: #fff; font-size: .9rem; padding: .6rem 1rem; border-radius: 8px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.tv-toast[hidden] { display: none; }
.tv-toast.err { background: var(--red-700); }

/* ---- two columns: player and tools on the left, the transcript in its own scrolling box on the right ---- */
.tv-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.tv-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-right: .2rem; }
.tv-pane { position: sticky; top: 1rem; height: calc(100vh - 2rem); min-height: 22rem; display: flex; flex-direction: column;
  border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; overflow: hidden; }
.tv-pane-head { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .9rem; font-weight: 700; font-size: .85rem;
  border-bottom: 1px solid var(--slate-200); background: var(--slate-50); }
.tv-key { font-weight: 400; font-size: .75rem; color: var(--slate-500); }
.tv-scroll { flex: 1; overflow-y: auto; position: relative; overscroll-behavior: contain; scroll-padding: 1rem; }
.tv-tools { flex-direction: column; align-items: stretch; }
.tv-tools input[type="search"] { flex: 0 0 auto; }
.tv-tools .tv-count { margin-left: 0; }
.tv-player-row { gap: .5rem .7rem; }
.tv-conf { display: inline-block; font-size: .7rem; font-weight: 700; margin-left: .45rem; padding: .05rem .4rem; border-radius: 999px; font-family: var(--mono); }
.tv-conf.hi { background: var(--green-100); color: var(--green-800); }
.tv-conf.mid { background: var(--amber-100); color: var(--amber-700); }
.tv-conf.lo { background: var(--red-100); color: var(--red-700); }

@media (max-width: 900px) {
  .tv-layout { grid-template-columns: minmax(0, 1fr); }
  .tv-side { position: static; max-height: none; overflow: visible; }
  .tv-pane { position: static; height: 70vh; }
  .tv-review { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 0; margin: 0; max-height: 60vh; overflow-y: auto;
    box-shadow: 0 -6px 24px rgba(0,0,0,.18); padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px)); }
  .tv { margin-bottom: 14rem; }
}

@media (max-width: 640px) {
  .tv-title { font-size: 1.6rem; }
  .tv-row { grid-template-columns: 3.9rem 1fr; gap: .15rem .5rem; padding: .6rem .35rem; }
  .tv-review-on .tv-row::before { display: none; }
  .tv-review-fields .tv-btn, .tv-review-fields .tv-field { flex: 1 1 100%; }
  .tv-count { margin-left: 0; }
}

@media (prefers-reduced-motion: no-preference) { .tv-row { transition: background .15s; } }

/* ---- suggestions: inline chips under a line, and the reviewer's pending list ---- */
.tv-sug { grid-column: 2; display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.chip { font-size: .74rem; padding: .1rem .55rem; border-radius: 999px; border: 1px dashed var(--slate-400); color: var(--slate-700); background: #fff; }
.chip s { text-decoration: line-through; opacity: .65; }
.chip.mine { border: 1px solid var(--blue); background: var(--blue-50); color: var(--navy); }
.chip.pend { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.chip.pend.go { cursor: pointer; } .chip.pend.go:hover { background: var(--blue-50); }
.chip.rej { color: var(--slate-500); }
.tv-pending { margin-top: .8rem; border: 1.5px solid var(--blue); border-radius: 12px; padding: .6rem .7rem; background: #fff; max-height: 40vh; overflow-y: auto; }
.tv-pending-head { font-weight: 700; font-size: .88rem; color: var(--navy); margin-bottom: .4rem; }
.tv-pending-empty { font-size: .85rem; color: var(--slate-500); }
.tv-pcard { padding: .5rem 0; border-top: 1px solid var(--slate-100); }
.tv-pcard.flash { background: var(--blue-100); border-radius: 6px; }
.tv-pcard-top { font-size: .88rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }
.tv-pcard-top s { opacity: .65; }
.tv-pcard-meta { font-size: .78rem; color: var(--slate-500); margin: .15rem 0 .35rem; overflow-wrap: anywhere; }
.tv-pcard-acts { display: flex; gap: .4rem; }
.tv-pcard-acts .tv-btn { padding: .25rem .8rem; font-size: .8rem; }

/* ---- minutes PDF tab ---- */
.tv-tabs { display: inline-flex; gap: .3rem; }
.tv-tabs button { font: inherit; font-size: .85rem; font-weight: 700; padding: .2rem .8rem; border: 0; border-radius: 999px; background: none; color: var(--slate-600); cursor: pointer; }
.tv-tabs button.on { background: var(--blue-100); color: var(--navy); }
.tv-pane-head { align-items: center; flex-wrap: wrap; }
.tv-pdflink { margin-left: auto; color: var(--blue); text-decoration: none; }
.tv-minutes { flex: 1; width: 100%; border: 0; background: var(--slate-100); }
.tv-minutes[hidden] { display: none; }

/* ---- sign-in gate: nothing from the meetings is loaded until someone signs in ---- */
.tv-gate { max-width: 34rem; margin: 4rem auto; padding: 2rem; border: 1px solid var(--slate-200); border-radius: 14px; background: #fff; text-align: center;
  box-shadow: 0 2px 14px rgba(14,27,77,.07); }
.tv-gate h2 { font-family: var(--serif); color: var(--navy); margin-bottom: .6rem; }
.tv-gate p { color: var(--slate-700); margin-bottom: 1.2rem; line-height: 1.5; }
.tv-gate[hidden] { display: none; }
body.gated .tv { display: none; }

/* ---- analysis tab ---- */
.tv-analysis { flex: 1; overflow-y: auto; padding: 1rem 1.2rem 2rem; background: #fff; }
.tv-analysis[hidden] { display: none; }
.an-warn { font-size: .85rem; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 10px; padding: .6rem .8rem; margin-bottom: 1rem; color: var(--slate-800); }
.an-h { font-family: var(--serif); font-size: 1.15rem; color: var(--navy); margin: 1.4rem 0 .5rem; padding-bottom: .25rem; border-bottom: 2px solid var(--blue-100); }
.an-p { line-height: 1.6; margin-bottom: .6rem; }
.an-card { border: 1px solid var(--slate-200); border-left: 4px solid var(--blue); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .7rem; }
.an-card h4 { font-size: .98rem; color: var(--navy); margin-bottom: .25rem; }
.an-kv { font-size: .9rem; line-height: 1.5; margin-bottom: .2rem; } .an-kv b { color: var(--slate-600); font-weight: 600; }
.an-ev { margin: .35rem 0 0; font-size: .85rem; color: var(--slate-700); display: flex; gap: .5rem; align-items: baseline; }
.an-ev .tv-ts { flex: none; }
.an-ev q { font-family: var(--serif); quotes: "\201C" "\201D"; }
.an-list { margin: 0 0 .6rem 1.2rem; line-height: 1.55; }
.an-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: var(--slate-100); color: var(--slate-600); margin-left: .4rem; }
