/* Transcript "Editor mode" (transcript-editor.js). Every colour comes from the personalization variables. */
html.te-open { overflow: hidden; }

.te-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: max(0.8rem, env(safe-area-inset-top, 0px)) max(0.8rem, env(safe-area-inset-right, 0px)) max(0.8rem, env(safe-area-inset-bottom, 0px)) max(0.8rem, env(safe-area-inset-left, 0px));
  /* solid backdrop: whatever dialog the editor was opened from (the shared-link preview, the owner player) must not show through as a window behind it */
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent, #b88916) 7%, var(--bg, #030303)), var(--bg, #030303) 70%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: te-fade 0.16s ease-out;
}
@keyframes te-fade { from { opacity: 0; } to { opacity: 1; } }

.te-card {
  position: relative;
  width: min(1240px, 100%);
  height: 100%;
  max-height: 960px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
  border: 1px solid color-mix(in srgb, var(--accent, #b88916) 34%, var(--line, #2a2517) 66%);
  border-radius: 18px;
  color: var(--ink, #f5f0df);
  background:
    radial-gradient(120% 50% at 0% 0%, color-mix(in srgb, var(--accent, #b88916) 8%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface, #101010) 94%, var(--accent, #b88916) 6%), var(--bg-soft, #0b0b0b));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  --te-fs: 19px;
}

/* header + toolbar */
.te-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.85rem 1.1rem 0.4rem; }
.te-title { min-width: 0; display: flex; align-items: baseline; gap: 0.7rem; }
.te-title h3 { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.te-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #b2a47c); font-size: 0.86rem; }
.te-head-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }

.te-iconbtn, .te-miniicon {
  appearance: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--accent-2, #d4aa32);
  border: 1px solid color-mix(in srgb, var(--accent, #b88916) 32%, var(--line, #2a2517) 68%);
  background: color-mix(in srgb, var(--surface, #101010) 88%, transparent);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.te-iconbtn { width: 38px; height: 38px; border-radius: 11px; }
.te-iconbtn svg { width: 18px; height: 18px; }
.te-miniicon { width: 28px; height: 28px; border-radius: 8px; }
.te-miniicon svg { width: 15px; height: 15px; }
.te-iconbtn:hover, .te-miniicon:hover, .te-iconbtn:focus-visible, .te-miniicon:focus-visible {
  outline: none;
  border-color: var(--accent-2, #d4aa32);
  background: color-mix(in srgb, var(--surface, #101010) 78%, var(--accent, #b88916) 22%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #b88916) 22%, transparent);
}

.te-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem 0.7rem; padding: 0.35rem 1.1rem 0.8rem; border-bottom: 1px solid color-mix(in srgb, var(--line, #2a2517) 80%, transparent); }

.te-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 26%, var(--line, #2a2517) 74%); background: color-mix(in srgb, var(--bg, #030303) 60%, var(--surface, #101010) 40%); }
.te-seg button { appearance: none; border: 0; border-radius: 8px; height: 32px; padding: 0 0.8rem; background: transparent; color: var(--muted, #b2a47c); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
.te-seg button:hover { color: var(--ink, #f5f0df); }
.te-seg button.is-on { background: var(--accent-2, #d4aa32); color: var(--accent-ink, #120e03); }

.te-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.te-chips[hidden] { display: none; }
.te-chip { appearance: none; display: inline-flex; align-items: center; gap: 0.4rem; height: 32px; padding: 0 0.7rem; border-radius: 999px; font: inherit; font-size: 0.84rem; font-weight: 550; cursor: pointer; color: var(--muted, #b2a47c); background: transparent; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 22%, var(--line, #2a2517) 78%); transition: background 0.15s, color 0.15s, border-color 0.15s; }
.te-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent-2, #d4aa32)); opacity: 0.45; }
.te-chip span { font-size: 0.74rem; padding: 0 0.35rem; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-variant-numeric: tabular-nums; }
.te-chip.is-on { color: var(--ink, #f5f0df); border-color: color-mix(in srgb, var(--c, var(--accent-2, #d4aa32)) 70%, transparent); background: color-mix(in srgb, var(--c, var(--accent, #b88916)) 14%, transparent); }
.te-chip.is-on i { opacity: 1; }
.te-chip[data-all].is-on { --c: var(--accent-2, #d4aa32); }
.te-chip:disabled { opacity: 0.4; cursor: default; }

.te-search { position: relative; display: flex; align-items: center; gap: 0.2rem; flex: 1 1 200px; min-width: 170px; max-width: 360px; height: 36px; padding: 0 0.3rem 0 2.2rem; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 24%, var(--line, #2a2517) 76%); background: color-mix(in srgb, var(--bg, #030303) 70%, var(--surface, #101010) 30%); transition: border-color 0.15s, box-shadow 0.15s; }
.te-search:focus-within { border-color: var(--accent-2, #d4aa32); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #b88916) 24%, transparent); }
.te-search-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--muted, #b2a47c); pointer-events: none; }
.te-search-icon svg { width: 16px; height: 16px; }
.te-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink, #f5f0df); font: inherit; font-size: 0.9rem; -webkit-appearance: none; appearance: none; }
.te-hitcount { font-size: 0.74rem; color: var(--muted, #b2a47c); white-space: nowrap; padding: 0 0.2rem; font-variant-numeric: tabular-nums; }
.te-hitcount[hidden], .te-hitbtn[hidden], .te-approx[hidden] { display: none; }
.te-hitbtn { appearance: none; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--accent-2, #d4aa32); cursor: pointer; }
.te-hitbtn:hover { background: color-mix(in srgb, var(--accent, #b88916) 18%, transparent); }
.te-hitbtn svg { width: 15px; height: 15px; }

.te-approx { font-size: 0.74rem; font-weight: 600; padding: 0.22rem 0.6rem; border-radius: 999px; color: #f0b45a; background: color-mix(in srgb, #e39a2d 14%, transparent); border: 1px solid color-mix(in srgb, #e39a2d 36%, transparent); cursor: help; white-space: nowrap; }

/* body: the document */
.te-body { position: relative; flex: 1; min-height: 0; display: flex; }
.te-scroll { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1.2rem 1.4rem 220px; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent, #b88916) 45%, transparent) transparent; }
@media (min-width: 1000px) {
  .te-body.has-player[data-side="r"] .te-scroll { padding-right: 372px; }
  .te-body.has-player[data-side="l"] .te-scroll { padding-left: 372px; }
}
.te-doc { max-width: 840px; margin: 0 auto; font-size: var(--te-fs, 19px); line-height: 1.62; }

.te-block { position: relative; display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 0 1rem; padding: 0.7rem 0.8rem 0.7rem 0.6rem; margin: 0 -0.8rem 0.15rem -0.6rem; border-radius: 12px; border-left: 3px solid transparent; transition: background 0.18s, border-color 0.18s; }
.te-block.is-active { background: color-mix(in srgb, var(--c, var(--accent, #b88916)) 9%, transparent); border-left-color: var(--c, var(--accent-2, #d4aa32)); }
.te-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding-top: 0.2rem; user-select: none; -webkit-user-select: none; }
.te-spk { font-size: 0.78em; font-weight: 700; letter-spacing: 0.01em; color: var(--c, var(--accent-2, #d4aa32)); line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-spk:not(.is-first) { opacity: 0.55; font-weight: 600; }
.te-tc { appearance: none; border: 0; padding: 0.1rem 0.35rem; margin-left: -0.35rem; border-radius: 6px; background: transparent; cursor: pointer; color: var(--muted, #b2a47c); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.7em; font-variant-numeric: tabular-nums; }
.te-tc:hover { color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--accent, #b88916) 14%, transparent); }
.te-text { margin: 0; color: var(--ink, #f5f0df); word-break: break-word; cursor: text; }

.te-w { border-radius: 0.2em; transition: background-color 0.08s linear, color 0.08s linear; }
.te-w:hover { background: color-mix(in srgb, var(--accent, #b88916) 16%, transparent); }
.te-w.is-now { background: var(--accent-2, #d4aa32); color: var(--accent-ink, #120e03); box-shadow: 0 0 0 0.12em var(--accent-2, #d4aa32); }
.te-w.is-marked { box-shadow: inset 0 -0.17em 0 var(--mc, #f7b733); }
.te-w.is-marked.is-now { box-shadow: 0 0 0 0.12em var(--accent-2, #d4aa32), inset 0 -0.17em 0 var(--mc, #f7b733); }
.te-w.is-hit { background: color-mix(in srgb, #f6d55c 32%, transparent); }
.te-w.is-hit-cur { background: #f6d55c; color: #1b1500; }
.te-text ::selection, .te-text::selection { background: color-mix(in srgb, var(--accent-2, #d4aa32) 55%, transparent); color: inherit; }
.te-empty { padding: 4rem 1rem; text-align: center; color: var(--muted, #b2a47c); }

.te-jump { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 4; display: inline-flex; align-items: center; gap: 0.45rem; height: 38px; padding: 0 1rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.86rem; font-weight: 650; color: var(--accent-ink, #120e03); background: var(--accent-2, #d4aa32); border: 0; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5); }
.te-jump[hidden] { display: none; }
.te-jump svg { width: 16px; height: 16px; }

/* mini player */
.te-player { position: absolute; z-index: 5; width: clamp(240px, 27vw, 340px); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 40%, var(--line, #2a2517) 60%); background: #000; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65); }
.te-player[hidden] { display: none; }
/* tall (phone) video: a narrower player so its height stays reasonable */
.te-player.is-tall { width: min(clamp(240px, 27vw, 340px), calc(46vh * var(--ar, 0.5625))); min-width: 150px; }
.te-player[data-corner="br"] { right: 16px; bottom: 16px; }
.te-player[data-corner="bl"] { left: 16px; bottom: 16px; }
.te-player[data-corner="tr"] { right: 16px; top: 12px; }
.te-player[data-corner="tl"] { left: 16px; top: 12px; }
.te-player-bar { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.35rem 0.3rem 0.65rem; background: color-mix(in srgb, var(--surface, #101010) 92%, #000); }
.te-player-title { flex: 1; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted, #b2a47c); }
.te-player-screen { position: relative; overflow: hidden; aspect-ratio: var(--ar, 1.7778); background: #000; }
/* the video fills the screen box completely and is letterboxed inside it, whatever its shape (landscape, square, phone portrait) */
.te-player-screen video, video.te-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; background: #000; border-radius: 0; margin: 0; transform: none; }
.te-player-ctl { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem 0.4rem 0.4rem; background: color-mix(in srgb, var(--surface, #101010) 92%, #000); }
.te-seek { flex: 1; min-width: 0; height: 4px; accent-color: var(--accent-2, #d4aa32); cursor: pointer; }
.te-time { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.7rem; color: var(--muted, #b2a47c); white-space: nowrap; font-variant-numeric: tabular-nums; }
.te-player-pill { position: absolute; right: 16px; bottom: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 0.45rem; height: 38px; padding: 0 0.9rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 650; color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--surface, #101010) 92%, #000); border: 1px solid color-mix(in srgb, var(--accent, #b88916) 40%, var(--line, #2a2517) 60%); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.te-player-pill[hidden] { display: none; }
.te-player-pill svg { width: 17px; height: 17px; }
.te-player-pill:hover { border-color: var(--accent-2, #d4aa32); }

.te-toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 8; padding: 0.5rem 0.9rem; border-radius: 10px; font-size: 0.86rem; font-weight: 600; color: #7fd79a; background: color-mix(in srgb, var(--surface, #101010) 92%, #000); border: 1px solid color-mix(in srgb, #3fae62 55%, transparent); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.te-toast[hidden] { display: none; }
.te-toast[data-kind="error"] { color: #ff9a9a; border-color: color-mix(in srgb, var(--danger, #b53131) 60%, transparent); }

/* the "make a range marker from this selection" popover */
.te-pop { position: fixed; z-index: 1700; width: min(380px, calc(100vw - 16px)); display: grid; gap: 0.5rem; padding: 0.7rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 50%, var(--line, #2a2517) 50%); background: color-mix(in srgb, var(--surface, #101010) 96%, #000); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7); animation: te-fade 0.12s ease-out; }
.te-pop[hidden] { display: none; }
.te-pop-range { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; color: var(--ink, #f5f0df); }
.te-pop-ico { display: inline-flex; color: var(--accent-2, #d4aa32); }
.te-pop-ico svg { width: 18px; height: 18px; }
.te-pop-times { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.te-pop-times b { color: var(--muted, #b2a47c); font-weight: 500; margin: 0 0.15rem; }
.te-pop-times em { font-style: normal; margin-left: 0.5rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-family: inherit; font-size: 0.74rem; color: var(--accent-ink, #120e03); background: var(--accent-2, #d4aa32); }
.te-pop-times u { text-decoration: none; margin-left: 0.35rem; color: #f0b45a; cursor: help; }
.te-pop-name { width: 100%; box-sizing: border-box; height: 40px; padding: 0 0.75rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 26%, var(--line, #2a2517) 74%); background: color-mix(in srgb, var(--bg, #030303) 70%, var(--surface, #101010) 30%); color: var(--ink, #f5f0df); font: inherit; font-size: 0.95rem; font-weight: 600; outline: none; }
.te-pop-name::placeholder { font-weight: 400; color: color-mix(in srgb, var(--muted, #b2a47c) 75%, transparent); }
.te-pop-name:focus { border-color: var(--accent-2, #d4aa32); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #b88916) 24%, transparent); }
.te-pop-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding: 0 0.15rem; font-size: 0.76rem; line-height: 1.35; color: var(--muted, #b2a47c); }
.te-pop-colors { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; padding: 0.1rem 0.1rem 0.15rem; }
.te-sw { appearance: none; position: relative; width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer; background: var(--sw, #f7b733); border: 2px solid color-mix(in srgb, var(--ink, #f5f0df) 18%, transparent); transition: transform 0.12s, box-shadow 0.12s; }
.te-sw:hover { transform: scale(1.12); }
.te-sw.is-on { border-color: var(--ink, #f5f0df); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sw, #f7b733) 55%, transparent); }
.te-sw:focus-visible { outline: 2px solid var(--accent-2, #d4aa32); outline-offset: 2px; }
.te-sw-custom { display: inline-block; overflow: hidden; background: conic-gradient(from 0deg, #f26d6d, #f6d55c, #7fd37a, #5aa2f7, #c964f0, #f26d6d); }
.te-sw-custom.is-on { background: var(--sw); }
.te-sw-custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.te-pop-note:focus { border-color: var(--accent-2, #d4aa32); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #b88916) 24%, transparent); }
.te-pop-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.te-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; height: 38px; padding: 0 0.8rem; border-radius: 10px; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 650; color: var(--accent-2, #d4aa32); background: transparent; border: 1px solid color-mix(in srgb, var(--accent, #b88916) 34%, var(--line, #2a2517) 66%); transition: background 0.15s, border-color 0.15s, filter 0.15s; }
.te-btn svg { width: 16px; height: 16px; }
.te-btn:hover { border-color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--accent, #b88916) 14%, transparent); }
.te-btn.is-primary { flex: 1 1 auto; color: var(--accent-ink, #120e03); background: linear-gradient(120deg, var(--accent, #b88916), var(--accent-2, #d4aa32)); border-color: transparent; }
.te-btn.is-primary:hover { filter: brightness(1.08); }
.te-btn[hidden] { display: none; }
.te-btn:focus-visible, .te-chip:focus-visible, .te-seg button:focus-visible, .te-tc:focus-visible { outline: 2px solid var(--accent-2, #d4aa32); outline-offset: 2px; }

/* phones: one column, compact toolbar, popover becomes a bottom sheet */
@media (max-width: 760px) {
  .te-overlay { padding: 0; }
  .te-card { border-radius: 0; border: 0; max-height: none; }
  .te-head { padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0.8rem 0.3rem; }
  .te-file { display: none; }
  .te-toolbar { padding: 0.3rem 0.8rem 0.6rem; gap: 0.45rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .te-toolbar::-webkit-scrollbar { display: none; }
  .te-toolbar > * { flex: 0 0 auto; }
  .te-search { flex: 0 0 170px; }
  .te-scroll { padding: 0.6rem 0.8rem 190px; }
  .te-doc { line-height: 1.55; }
  .te-block { grid-template-columns: 1fr; padding: 0.55rem 0.6rem; margin: 0 -0.6rem 0.1rem; }
  .te-meta { flex-direction: row; align-items: baseline; gap: 0.6rem; padding-top: 0; margin-bottom: 0.1rem; }
  .te-tc { margin-left: 0; }
  .te-player { width: 168px; border-radius: 12px; }
  .te-player.is-tall { width: min(168px, calc(34vh * var(--ar, 0.5625))); min-width: 120px; }
  .te-player[data-corner="br"], .te-player[data-corner="bl"] { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .te-player[data-corner="br"], .te-player[data-corner="tr"] { right: 10px; }
  .te-player[data-corner="bl"], .te-player[data-corner="tl"] { left: 10px; }
  .te-player-pill { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .te-jump { bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px)); }
  .te-pop.is-sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; border-radius: 16px 16px 0 0; padding: 0.8rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .te-overlay, .te-pop { animation: none; }
  .te-w, .te-block { transition: none; }
}

/* the app's phone stylesheet makes every <button> full width: the editor sets its own widths */
.te-chip, .te-btn, .te-seg button, .te-jump, .te-player-pill, .te-tc { width: auto; }
@media (max-width: 760px) {
  .te-chips { flex-wrap: nowrap; }
  .te-spk { max-width: 60%; }
}

/* embedded (the shared folder's file preview iframe): the editor is the whole dialog */
.te-overlay.te-embedded { padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.te-embedded .te-card { width: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; }

/* compact dropdowns: segment width and text language */
.te-select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 1.9rem 0 0.8rem; border-radius: 10px; font: inherit; font-size: 0.84rem; font-weight: 650; cursor: pointer; width: auto !important; flex: 0 0 auto; color: var(--ink, #f5f0df); border: 1px solid color-mix(in srgb, var(--accent, #b88916) 26%, var(--line, #2a2517) 74%); background: color-mix(in srgb, var(--bg, #030303) 60%, var(--surface, #101010) 40%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23d4aa32' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 11px; transition: border-color 0.15s, box-shadow 0.15s; }
.te-select:hover { border-color: color-mix(in srgb, var(--accent, #b88916) 60%, var(--line, #2a2517) 40%); }
.te-select:focus-visible { outline: none; border-color: var(--accent-2, #d4aa32); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #b88916) 24%, transparent); }
.te-select[hidden] { display: none; }
.te-select option { background: #151209; color: #f5f0df; }
.te-langsel { min-width: 64px; letter-spacing: 0.03em; }

/* ───────── Selects: header buttons, the pieces list, picked words ───────── */
.te-pillbtn { appearance: none; position: relative; display: inline-flex; align-items: center; gap: 0.4rem; height: 38px; padding: 0 0.85rem; border-radius: 11px; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 650; width: auto; color: var(--ink, #f5f0df); background: color-mix(in srgb, var(--surface, #101010) 88%, transparent); border: 1px solid color-mix(in srgb, var(--accent, #b88916) 30%, var(--line, #2a2517) 70%); transition: background 0.15s, border-color 0.15s; }
.te-pillbtn svg { width: 17px; height: 17px; color: var(--accent-2, #d4aa32); }
.te-pillbtn:hover, .te-pillbtn:focus-visible { outline: none; border-color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--accent, #b88916) 16%, transparent); }
.te-pillbtn.is-on { border-color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--accent, #b88916) 22%, transparent); }
.te-badge { font-style: normal; min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 0.72rem; font-weight: 800; color: var(--accent-ink, #120e03); background: var(--accent-2, #d4aa32); font-variant-numeric: tabular-nums; }
.te-badge[hidden] { display: none; }
.te-w.is-sel { background: color-mix(in srgb, #5fd08a 22%, transparent); }
.te-w.is-sel.is-now { background: var(--accent-2, #d4aa32); }
.te-sel { flex: 0 0 340px; width: 340px; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid color-mix(in srgb, var(--line, #2a2517) 85%, transparent); background: color-mix(in srgb, var(--surface, #101010) 94%, #000); }
.te-sel[hidden] { display: none; }
.te-sel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0.9rem 0.4rem; }
.te-sel-title { display: grid; gap: 0.1rem; }
.te-sel-title b { font-size: 0.98rem; font-weight: 700; color: var(--ink, #f5f0df); }
.te-sel-title small { font-size: 0.78rem; color: var(--muted, #b2a47c); font-variant-numeric: tabular-nums; }
.te-sel-bar { display: flex; gap: 0.9rem; padding: 0 0.9rem 0.5rem; border-bottom: 1px solid color-mix(in srgb, var(--line, #2a2517) 80%, transparent); }
.te-sel-link { appearance: none; padding: 0.15rem 0; border: 0; background: none; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--accent-2, #d4aa32); width: auto; }
.te-sel-link.is-danger { color: #f08a8a; }
.te-sel-link:disabled { opacity: 0.4; cursor: default; }
.te-sel-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 0.45rem; padding: 0.6rem 0.7rem; }
.te-sel.is-empty .te-sel-list, .te-sel:not(.is-empty) .te-sel-empty { display: none; }
.te-sel-empty { padding: 1.4rem 1.1rem; font-size: 0.86rem; line-height: 1.5; color: var(--muted, #b2a47c); }
.te-sel-empty b { color: var(--ink, #f5f0df); }
.te-sel-empty kbd, .te-sel-title kbd { display: inline-block; padding: 0.02em 0.4em; border-radius: 5px; font: 600 0.85em ui-monospace, Menlo, monospace; border: 1px solid color-mix(in srgb, var(--ink, #f5f0df) 22%, transparent); background: color-mix(in srgb, var(--ink, #f5f0df) 8%, transparent); }
.te-sel-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 0.5rem; padding: 0.55rem 0.5rem 0.55rem 0.4rem; border-radius: 12px; border: 1px solid var(--line, #2a2517); background: color-mix(in srgb, var(--bg, #030303) 55%, var(--surface, #101010) 45%); transition: border-color 0.14s, background 0.14s; }
.te-sel-item:hover { border-color: color-mix(in srgb, var(--accent, #b88916) 50%, var(--line, #2a2517) 50%); }
.te-sel-item.is-drag { opacity: 0.45; }
.te-sel-item.is-over { border-color: var(--accent-2, #d4aa32); box-shadow: 0 -3px 0 var(--accent-2, #d4aa32); }
.te-sel-n { display: grid; place-items: center; align-self: start; width: 24px; height: 24px; border-radius: 7px; font-size: 0.74rem; font-weight: 800; cursor: grab; color: var(--accent-ink, #120e03); background: var(--accent-2, #d4aa32); font-variant-numeric: tabular-nums; }
.te-sel-main { display: grid; gap: 0.3rem; min-width: 0; }
.te-sel-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.5rem; font-size: 0.72rem; color: var(--muted, #b2a47c); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.te-sel-meta em { font-style: normal; font-weight: 700; color: var(--accent-2, #d4aa32); font-family: inherit; }
.te-sel-spk { font-style: normal; font-family: system-ui, sans-serif; font-weight: 700; font-size: 0.7rem; padding: 0.05rem 0.45rem; border-radius: 999px; color: var(--c, var(--accent-2)); border: 1px solid var(--c, var(--accent-2)); }
.te-sel-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 0.88rem; line-height: 1.4; color: var(--ink, #f5f0df); overflow-wrap: anywhere; }
.te-sel-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.te-sel-nudge { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 6px; height: 26px; border-radius: 8px; border: 1px solid var(--line, #2a2517); font-size: 0.7rem; color: var(--muted, #b2a47c); }
.te-sel-nudge small { font-size: 0.68rem; font-weight: 700; margin-right: 2px; }
.te-sel-nudge button { appearance: none; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--accent-2, #d4aa32); }
.te-sel-nudge button:hover { background: color-mix(in srgb, var(--accent, #b88916) 22%, transparent); }
.te-sel-side { display: grid; align-content: start; gap: 0.25rem; }
.te-sel-mini { appearance: none; width: 28px; height: 26px; padding: 0 !important; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line, #2a2517); background: transparent; cursor: pointer; color: var(--accent-2, #d4aa32); }
.te-sel-mini svg { width: 14px; height: 14px; }
.te-sel-mini:hover:not(:disabled) { background: color-mix(in srgb, var(--accent, #b88916) 20%, transparent); border-color: var(--accent-2, #d4aa32); }
.te-sel-mini:disabled { opacity: 0.3; cursor: default; }
.te-sel-mini.is-danger { color: #f08a8a; }
.te-sel-foot { display: grid; gap: 0.6rem; padding: 0.7rem 0.9rem 0.9rem; border-top: 1px solid color-mix(in srgb, var(--line, #2a2517) 80%, transparent); }
.te-sel-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted, #b2a47c); cursor: pointer; }
.te-sel-check input { accent-color: var(--accent-2, #d4aa32); width: 16px; height: 16px; }
.te-sel-foot .te-btn { width: 100%; flex: none; }
/* the floating player and its pill step aside for the list */
.te-body.has-sel .te-player[data-corner="br"], .te-body.has-sel .te-player[data-corner="tr"], .te-body.has-sel .te-player-pill { right: calc(340px + 16px); }
@media (min-width: 1000px) { .te-body.has-sel.has-player[data-side="r"] .te-scroll { padding-right: 372px; } }
@media (max-width: 760px) {
  .te-sel { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; width: auto; flex: none; height: 62%; border-left: 0; border-top: 1px solid var(--accent-2, #d4aa32); border-radius: 18px 18px 0 0; box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.6); }
  .te-body.has-sel .te-player[data-corner="br"], .te-body.has-sel .te-player[data-corner="tr"], .te-body.has-sel .te-player-pill { right: 16px; }
  .te-pillbtn span { display: none; }
  .te-pillbtn { padding: 0 0.6rem; }
}
.te-pop-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── fix the text: re-transcribe / fine tune a selection ── */
.te-pop-fix { padding-top: 0.45rem; border-top: 1px dashed color-mix(in srgb, var(--accent, #b88916) 22%, var(--line, #2a2517) 78%); margin-top: 0.1rem; }
.te-pop-fix .te-btn { flex: 1 1 0; }
.te-pop-fix[hidden] { display: none; }
.te-busy { display: inline-flex; align-items: center; gap: 0.45rem; max-width: 42vw; height: 34px; padding: 0 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent-2, #d4aa32); background: color-mix(in srgb, var(--accent, #b88916) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent, #b88916) 40%, var(--line, #2a2517) 60%); }
.te-busy::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2, #d4aa32); animation: te-busy-pulse 1.1s ease-in-out infinite; }
.te-busy[hidden] { display: none; }
@keyframes te-busy-pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (max-width: 760px) { .te-busy { max-width: 34vw; font-size: 0.74rem; padding: 0 0.55rem; } }

.te-busy[data-kind="done"]::before { animation: none; opacity: 1; background: #7fd79a; }
.te-busy[role="button"] { cursor: pointer; }
.te-busy[role="button"]:hover { border-color: var(--accent-2, #d4aa32); }
.te-busy:focus-visible { outline: 2px solid var(--accent-2, #d4aa32); outline-offset: 2px; }

/* phone: the bottom sheet of the selection needs the whole width, the floating player steps aside meanwhile */
@media (max-width: 760px) { .te-overlay.is-popping .te-player { opacity: 0; pointer-events: none; } }

/* ⋯ menu inside Editor mode: the transcript tab's menu, above the editor card */
.te-menuwrap { display: inline-flex; }
.te-menu { z-index: 60; max-height: min(78vh, 640px); overflow: auto; text-align: left; }
@media (max-width: 760px) { .te-menu { position: fixed; left: 8px; right: 8px; top: 58px; max-width: none; } }

/* text size: a small floating pill at the bottom (like the spreadsheet editor's zoom) */
.te-zoom { position: absolute; left: 14px; bottom: 14px; z-index: 6; display: inline-flex; align-items: stretch; overflow: hidden; border-radius: 999px; user-select: none; background: color-mix(in srgb, var(--bg, #030303) 88%, #000); border: 1px solid color-mix(in srgb, var(--accent, #b88916) 38%, var(--line, #2a2517) 62%); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.te-zoom button { appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; height: 30px; font: inherit; }
.te-zoom .te-zoom-btn { width: 34px; flex: 0 0 34px; color: var(--accent-2, #d4aa32); font-size: 18px; line-height: 1; }
.te-zoom-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent, #b88916) 22%, transparent); }
.te-zoom-btn:disabled { opacity: 0.35; cursor: default; }
.te-zoom .te-zoom-lvl { width: auto; min-width: 48px; padding: 0 0.3rem; color: var(--muted, #b2a47c); font-size: 12px; font-variant-numeric: tabular-nums; border-left: 1px solid color-mix(in srgb, var(--line, #2a2517) 85%, transparent); border-right: 1px solid color-mix(in srgb, var(--line, #2a2517) 85%, transparent); }
.te-zoom-lvl:hover { color: var(--ink, #f5f0df); }
.te-zoom button:focus-visible { outline: 2px solid var(--accent-2, #d4aa32); outline-offset: -2px; }
/* the player sits in a left corner: the pill goes to the other side; the selects panel keeps its own room */
.te-body.has-player[data-side="l"] .te-zoom { left: auto; right: 14px; }
.te-body.has-sel .te-zoom { left: 14px; right: auto; }
.te-body.has-sel.has-player[data-side="l"] .te-zoom { left: auto; right: calc(340px + 14px); }
@media (max-width: 760px) { .te-zoom { left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); } .te-zoom button { height: 34px; } .te-zoom .te-zoom-btn { width: 40px; flex-basis: 40px; } }

/* audio files: the mini player is just the transport (no picture) */
.te-player.is-audio .te-player-screen { display: none; }
.te-player.is-audio { width: clamp(220px, 24vw, 300px); }

/* Selects → Drop Cut */
.te-sel-foot-dc { border-top: 0; padding-top: 0; }
.te-btn-wide { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 0.45rem; }

/* speaker label as a button: tap it to fix who is speaking in this block */
button.te-spk.is-editable { appearance: none; border: 1px solid transparent; background: transparent; font: inherit; font-size: 0.78em; font-weight: 700; text-align: left; cursor: pointer; padding: 0.12rem 0.4rem; margin: 0 0 0 -0.4rem; border-radius: 7px; -webkit-tap-highlight-color: transparent; }
button.te-spk.is-editable:not(.is-first) { font-weight: 600; }
button.te-spk.is-editable::after { content: ''; display: inline-block; width: 0.7em; height: 0.7em; margin-left: 0.35em; vertical-align: -0.05em; opacity: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E") center / contain no-repeat; transition: opacity 0.15s; }
button.te-spk.is-editable:hover, button.te-spk.is-editable:focus-visible { border-color: color-mix(in srgb, var(--c, var(--accent-2, #d4aa32)) 45%, transparent); background: color-mix(in srgb, var(--c, var(--accent, #b88916)) 12%, transparent); opacity: 1; outline: none; }
button.te-spk.is-editable:hover::after, button.te-spk.is-editable:focus-visible::after { opacity: 0.9; }
@media (hover: none) { button.te-spk.is-editable::after { opacity: 0.55; } }
