/* The timeline editor: a dark, full-window workspace. Everything here is under .tl. */
.tl { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--ink); color: var(--paper); overflow: hidden; --tl-line: #2A2D33; --tl-panel: #16171A; --tl-raise: #1B1C1F; --tl-mute: #B9BAB3; }
.tl *:focus-visible { outline-color: var(--c300); }
.tl.dropping::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--c300); border-radius: var(--r); pointer-events: none; z-index: 5; }

/* top bar */
.tl-top { flex: none; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: var(--tl-panel); border-bottom: 1px solid var(--tl-line); }
.tl-top-a, .tl-top-b, .tl-top-c { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-top-a { flex: 1 1 0; }
.tl-top-c { flex: 1 1 0; justify-content: flex-end; }
.tl-icon { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--line); text-decoration: none; }
.tl-icon:hover { background: var(--ink-2); color: #fff; }
.tl-icon:disabled { opacity: .35; background: transparent; }
.tl-title { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; background: transparent; color: var(--paper); padding: 4px 8px; border-radius: 8px; text-align: start; }
.tl-title:hover { background: var(--ink-2); }
.tl-title b { font-size: 15px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-saved { font-size: 11px; color: var(--tl-mute); }
.tl-aspect-pick { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tl-mute); margin-inline-start: 8px; }
.tl-select { height: 36px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--tl-raise); color: var(--paper); padding: 0 10px; font-size: 13px; }
.tl-credits { font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 6px 12px; text-decoration: none; white-space: nowrap; }
.tl-download { height: 40px; white-space: nowrap; }
.tl-montage { height: 40px; white-space: nowrap; background: #fff; color: #111; border: 0; font-weight: 700; }
.tl-montage:hover { background: var(--c300); color: #111; }
.tl-montage-ask { display: flex; flex-direction: column; gap: 12px; line-height: 1.8; }
.tl-montage-ask p { margin: 0; }
.tl-montage-note { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.tl-montage-warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.tl-montage-warn .hint { color: inherit; opacity: .8; }
.tl-ratio { display: none; }

/* middle: files, the frame, the transport */
.tl-mid { flex: 1 1 0; min-height: 0; display: flex; }
.tl-bin { flex: none; width: 300px; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--tl-raise); border-inline-end: 1px solid var(--tl-line); overflow-y: auto; }
.tl-bin-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.tl-hint { margin: 0; font-size: 11.5px; color: var(--tl-mute); line-height: 1.6; }
.tl-btn-light { background: var(--paper); color: var(--ink); border: 0; justify-content: center; }
.tl-btn-light:hover { background: #fff; }
.tl-btn-ghost { background: transparent; color: var(--paper); border: 1px solid var(--tl-line); justify-content: center; }
.tl-btn-ghost:hover { background: var(--tl-raise); }
.tl-ai-box { display: flex; flex-direction: column; gap: 8px; }
.tl-ai-box:empty { display: none; }
.tl-ai-btn { background: var(--c300); color: #111; border: 0; font-weight: 700; justify-content: center; }
.tl-ai-btn:hover { background: #fff; }
.tl-script { width: 100%; min-height: 220px; resize: vertical; border-radius: 10px; border: 1px solid var(--tl-line); background: var(--tl-raise); color: var(--paper); padding: 12px; font: inherit; line-height: 1.8; }
.tl-ai { display: flex; flex-direction: column; gap: 12px; }
.tl-ai p { margin: 0; }
.tl-ai-what { color: var(--paper); line-height: 1.8; }
.tl-ai-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--line); font-size: 14px; line-height: 1.7; }
.tl-ai-sum { background: rgba(143, 160, 255, .14); color: var(--paper); border-radius: 10px; padding: 10px 12px; line-height: 1.8; }
.tl-cards { display: flex; flex-direction: column; gap: 8px; }
.tl-cards-head { color: var(--paper); }
.tl-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--tl-line); border-radius: 12px; padding: 10px 12px; background: var(--tl-raise); }
.tl-card.s-gone, .tl-card.s-kept { opacity: .55; }
.tl-card.s-ask { border-color: var(--c300); }
.tl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--paper); font-size: 14px; }
.tl-card-text { color: var(--paper); line-height: 1.7; font-size: 14px; }
.tl-card-keep { color: var(--ok); font-size: 13px; line-height: 1.7; }
.tl-card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-card-row .btn.sm { height: 34px; padding: 0 10px; font-size: 13px; gap: 6px; }
.tl-card-state { font-size: 12px; color: var(--tl-mute); }
.tl.phone .tl-card-row .btn.sm { height: 44px; padding: 0 14px; font-size: 14px; }
.tl-bin-list { display: flex; flex-direction: column; gap: 8px; }
.tl-bin-empty { margin: 8px 0 0; font-size: 12px; color: var(--tl-mute); }
.tl-file { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--tl-line); border-radius: 10px; background: var(--tl-panel); }
.tl-file .icon-btn { flex: none; color: var(--line); background: transparent; }
.tl-file .icon-btn:hover { background: var(--ink-2); color: #fff; }
.tl-file-thumb { position: relative; flex: none; width: 64px; height: 44px; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: #000; color: var(--tl-mute); display: flex; align-items: center; justify-content: center; }
.tl-file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-file-thumb .dur { position: absolute; inset-inline-end: 3px; bottom: 3px; font: 500 10px/1 var(--mono); color: #fff; background: rgba(17,18,20,.75); padding: 2px 4px; border-radius: 4px; }
.tl-file-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-file-text b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-file-text .hint { color: var(--tl-mute); font-size: 11px; }
.tl-up-bar { display: block; height: 4px; border-radius: 2px; background: var(--ink-2); overflow: hidden; }
.tl-up-bar i { display: block; height: 100%; background: var(--c300); }
.tl-file.up .mono { font-size: 11px; color: var(--tl-mute); }

.tl-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; background: var(--ink); }
.tl-stage-wrap { position: relative; flex: 1 1 0; min-height: 0; margin: 16px 16px 0; display: flex; align-items: center; justify-content: center; }
.tl-stage { position: relative; background: #000; overflow: hidden; border-radius: 4px; }
.tl-blur { position: absolute; inset: -8%; width: 116%; height: 116%; filter: blur(18px); }
.tl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; visibility: hidden; }
/* A part that is a voice alone: a card in the player, and bars on the timeline. */
.tl-voice-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #C9D1FF; background: radial-gradient(ellipse at center, #1E2340 0%, #111214 70%); z-index: 1; text-align: center; padding: 16px; }
.tl-voice-card span { font-size: 14px; font-weight: 600; }
.tl-voice-card .tl-voice-bars { width: min(420px, 80%); height: clamp(40px, 12vh, 96px); display: block; }
.tl-voice-card[hidden] { display: none; }
.tl-video.on { visibility: visible; }
.tl-empty { position: absolute; z-index: 7; inset: 0; margin: auto; width: min(420px, calc(100% - 24px)); height: min(220px, calc(100% - 16px)); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #5E6168; border-radius: var(--r-lg); background: var(--tl-panel); color: var(--paper); padding: 16px; text-align: center; }
.tl-empty[hidden] { display: none; }
.tl-empty:hover { border-color: var(--c300); }
.tl-empty b { font-size: 16px; font-weight: 600; }
.tl-empty span { font-size: 12px; color: var(--tl-mute); line-height: 1.6; }
.tl.phone .tl-empty { width: min(340px, calc(100% - 24px)); height: min(190px, calc(100% - 16px)); gap: 6px; padding: 14px; }
.tl.phone .tl-empty b { font-size: 14.5px; }
.tl.phone .tl-empty span { font-size: 11.5px; }
.tl-transport { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.tl-clock { flex: 1 1 0; font-size: 13px; color: var(--line); }
.tl-transport-mid { display: flex; align-items: center; gap: 8px; direction: ltr; }
.tl-transport-end { flex: 1 1 0; display: flex; justify-content: flex-end; gap: 4px; }
.tl-play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.tl-play:hover { background: #fff; }

/* the timeline */
.tl-timeline { flex: none; background: var(--tl-panel); border-top: 1px solid var(--tl-line); display: flex; flex-direction: column; }
.tl-tools { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--tl-line); }
.tl-tools-row { display: flex; align-items: center; gap: 4px; }
.tl-tool { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--line); font-size: 12.5px; white-space: nowrap; }
.tl-tool:hover { background: var(--ink-2); color: #fff; }
.tl-tool:disabled { opacity: .35; background: transparent; color: var(--line); }
.tl-zoom { width: 130px; accent-color: var(--cobalt); }
.tl-scroll-box { position: relative; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; height: 132px; scrollbar-color: #5E6168 transparent; }
.tl-content { position: relative; height: 100%; min-width: 100%; touch-action: pan-x; }
.tl-ruler { position: relative; height: 26px; border-bottom: 1px solid var(--tl-line); }
.tl-mark { position: absolute; top: 0; bottom: 0; padding: 6px 0 0 5px; font: 500 10px/1 var(--mono); color: #8A8D94; border-left: 1px solid var(--tl-line); white-space: nowrap; pointer-events: none; }
.tl-track { position: relative; height: 72px; margin-top: 14px; }
.tl-clip { position: absolute; top: 0; height: 56px; border-radius: 7px; overflow: hidden; background: #2A2D33 left center / auto 100% repeat-x; box-shadow: inset 0 0 0 1px rgba(17,18,20,.6); cursor: pointer; user-select: none; -webkit-user-select: none; }
.tl-clip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.tl-clip-len { position: absolute; left: 6px; bottom: 4px; font: 500 10px/1 var(--mono); color: #fff; background: rgba(17,18,20,.75); padding: 3px 5px; border-radius: 4px; pointer-events: none; }
.tl-clip.sel { box-shadow: inset 0 0 0 2px var(--c300); overflow: visible; z-index: 2; }
.tl-clip.sel canvas { border-radius: 7px; }
.tl-grip { display: none; position: absolute; top: 0; bottom: 0; width: 14px; background: var(--c300); cursor: ew-resize; touch-action: none; }
.tl-grip::after { content: ""; position: absolute; top: 18px; bottom: 18px; left: 6px; width: 2px; border-radius: 1px; background: var(--ink); }
.tl-clip.sel .tl-grip { display: block; }
.tl-grip.a { left: 0; border-radius: 7px 0 0 7px; }
.tl-grip.b { right: 0; border-radius: 0 7px 7px 0; }
.tl-clip.moving { opacity: .85; z-index: 4; box-shadow: 0 6px 18px rgba(0,0,0,.5), inset 0 0 0 2px var(--c300); cursor: grabbing; }
.tl-clip.drop { box-shadow: inset 0 0 0 2px var(--gold); }
.tl-head { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--err); pointer-events: none; z-index: 3; }
.tl-head::before { content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 12px; border-radius: 3px; background: var(--err); }
.tl-centre { display: none; }
.tl-scrub-hint { display: none; }
.tl-bar { display: none; }

/* the finished video's dialog and the phone sheets */
.tl-export { display: flex; flex-direction: column; gap: 12px; }
.tl-export-run { display: flex; align-items: center; gap: 10px; }
.tl-export-ok { margin: 0; font-weight: 600; color: var(--ok); }
.tl-spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--cobalt); animation: tl-spin .8s linear infinite; }
@keyframes tl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tl-spin { animation-duration: 2.4s; } }
.tl-sheet-scrim { position: absolute; inset: 0; z-index: 10; background: rgba(17,18,20,.6); display: flex; align-items: flex-end; }
.tl-sheet { width: 100%; max-width: 620px; margin: 0 auto; max-height: 72%; overflow-y: auto; background: var(--tl-raise); border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.tl-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.tl-sheet-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.tl-sheet-head .icon-btn { color: var(--line); background: transparent; }
.tl.phone .tl-sheet-head .icon-btn { width: 44px; height: 44px; }
.tl-aspects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tl-aspect { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; min-height: 96px; padding: 10px 4px; border: 1px solid var(--tl-line); border-radius: 12px; background: var(--tl-panel); color: var(--line); font-size: 11.5px; }
.tl-aspect.on { border-color: var(--c300); color: #fff; }
.tl-aspect-box { height: 40px; border: 2px solid currentColor; border-radius: 4px; }

/* a phone: the frame on top, the timeline sliding under a fixed line, the tools along the bottom */
.tl.phone .tl-top { height: 54px; padding: 0 8px; }
.tl.phone .tl-top-b, .tl.phone .tl-credits { display: none; }
.tl.phone .tl-top-c { flex: none; }
/* a phone's top bar has room for one worded button: the download keeps its place as an icon */
.tl.phone .tl-download { height: 44px; width: 44px; padding: 0; justify-content: center; }
.tl.phone .tl-download span { display: none; }
.tl.phone .tl-montage { height: 44px; padding: 0 12px; font-size: 13px; }
.tl.phone .tl-ratio { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border: 1px solid var(--tl-line); border-radius: 10px; background: var(--tl-raise); color: var(--paper); font-size: 12px; }
.tl.phone .tl-icon { width: 44px; height: 44px; }
.tl.phone .tl-bin { display: none; }
.tl.phone .tl-stage-wrap { margin: 8px 8px 0; }
.tl.phone .tl-transport { height: 56px; padding: 0 12px; }
.tl.phone .tl-step { display: none; }
.tl.phone .tl-play { width: 44px; height: 44px; }
.tl.phone .tl-tools { display: none; }
.tl.phone .tl-scroll { height: 124px; scrollbar-width: none; }
.tl.phone .tl-scroll::-webkit-scrollbar { display: none; }
.tl.phone .tl-head { display: none; }
.tl.phone .tl-centre { display: block; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--paper); pointer-events: none; z-index: 3; }
.tl.phone .tl-grip { width: 22px; }
.tl.phone .tl-grip::after { left: 10px; }
.tl.phone .tl-scrub-hint { display: block; margin: 0; padding: 0 12px 8px; text-align: center; font-size: 10.5px; color: #8A8D94; }
.tl.phone .tl-bar { flex: none; display: flex; align-items: stretch; gap: 2px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); background: var(--tl-raise); border-top: 1px solid var(--tl-line); overflow-x: auto; scrollbar-width: none; }
.tl.phone .tl-bar::-webkit-scrollbar { display: none; }
.tl.phone .tl-bar .tl-tool-ai { color: var(--c300); }
.tl.phone .tl-bar .tl-tool-ai.busy svg { animation: tl-spin 1.2s linear infinite; }
.tl.phone .tl-bar .tl-tool { flex: 1 0 auto; min-width: 54px; height: 58px; flex-direction: column; justify-content: center; gap: 5px; padding: 0 6px; font-size: 10.5px; }
/* a small phone: the top bar keeps room for the project's name */
@media (max-width: 400px) {
  .tl.phone .tl-top { gap: 6px; padding: 0 6px; }
  .tl.phone .tl-top-c { gap: 6px; }
  .tl.phone .tl-ratio { padding: 0 8px; }
  .tl.phone .tl-ratio svg { display: none; }
  .tl.phone .tl-montage { padding: 0 10px; font-size: 12.5px; }
  .tl.phone .tl-title { min-width: 64px; padding: 4px; }
}
/* a phone held sideways: everything slimmer, so the picture keeps most of the height */
@media (max-width: 860px) and (orientation: landscape) {
  .tl.phone .tl-scrub-hint { display: none; }
  .tl.phone .tl-top { height: 44px; }
  .tl.phone .tl-top .tl-icon, .tl.phone .tl-download, .tl.phone .tl-montage, .tl.phone .tl-ratio { height: 38px; }
  .tl.phone .tl-download { width: 38px; }
  .tl.phone .tl-stage-wrap { margin: 4px 8px 0; }
  .tl.phone .tl-transport { height: 42px; }
  .tl.phone .tl-play { width: 36px; height: 36px; }
  .tl.phone .tl-scroll { height: 76px; }
  .tl.phone .tl-bar .tl-tool { height: 40px; flex-direction: row; gap: 6px; font-size: 11px; }
  .tl.phone .tl-sheet { max-height: 86%; }
}
/* a tall tablet held upright: more room for the timeline */
@media (max-width: 860px) and (min-height: 900px) { .tl.phone .tl-scroll { height: 160px; } }

/* what each file is for: the question before an upload, the lists, and a part's camera and sound */
.tl-only { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--c700); color: #fff; font-size: 12.5px; line-height: 1.7; }
.tl-sub { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--paper); }
.tl-part, .tl-insert { display: flex; flex-direction: column; gap: 6px; }
.tl-linked { display: flex; align-items: center; gap: 8px; margin-inline-start: 18px; padding: 6px 8px; border: 1px solid var(--tl-line); border-radius: 8px; background: var(--ink); color: var(--line); }
.tl-linked.warn { border-color: var(--warn); }
.tl-linked.warn .hint { color: #FFC56B; }
.tl-linked .icon-btn { flex: none; color: var(--line); background: transparent; }
.tl-linked .icon-btn:hover { background: var(--ink-2); color: #fff; }
.tl-mini { flex: none; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--tl-raise); color: var(--paper); font-size: 12px; }
.tl-mini:hover { border-color: #5E6168; }
.tl-note { width: 100%; height: 36px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--ink); color: var(--paper); padding: 0 10px; font-size: 12.5px; }
.tl-note::placeholder { color: #8A8D94; }
.tl-kinds { display: flex; flex-direction: column; gap: 8px; }
.tl-kind { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.tl-kind b { font-size: 14px; font-weight: 600; }
.tl-kind span { font-size: 12px; color: var(--mute); }
.tl-kind.on { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); background: var(--c50); }
.tl-kind-extra { margin-top: 12px; }
.tl-kind-extra:empty { display: none; }
.tl-adjust { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.tl-adjust-side { display: flex; flex-direction: column; gap: 6px; }
.tl-adjust > b { font-size: 18px; }
.tl-cam { position: absolute; z-index: 6; right: 3%; bottom: 3%; width: 30%; max-width: 220px; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; border: 2px solid #fff; background: #000; }
.tl-cam[hidden] { display: none; }
.tl-cam video { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.tl-cam span { font-size: 9.5px; line-height: 1.4; padding: 2px 4px; text-align: center; color: #fff; background: rgba(17,18,20,.85); }
.tl-cam.warn { border-color: var(--gold); }
.tl-lanes { position: relative; margin-top: 2px; display: flex; flex-direction: column; gap: 4px; }
.tl-lane { position: relative; height: 26px; }
.tl-lane-bar { position: absolute; top: 0; height: 26px; padding: 0 8px; border: 0; border-radius: 6px; overflow: hidden; display: flex; align-items: center; color: #fff; font-size: 10.5px; white-space: nowrap; }
.tl-lane-bar span { overflow: hidden; text-overflow: ellipsis; }
.tl-lane-bar.k-camera { background: #7A4FC4; }
.tl-lane-bar.k-sound { background: #17456F; }
.tl-lane-bar.warn { background: #8A5A00; box-shadow: inset 0 0 0 1px var(--gold); }
.tl-lane-bar:hover { filter: brightness(1.15); }
.tl-lane-bar.k-own { background: #1F7A4D; gap: 4px; cursor: pointer; }
.tl-lane-bar.k-own.off { background: repeating-linear-gradient(135deg, #3A3D44 0 6px, #2B2E34 6px 12px); color: #C9CCD2; }
.tl-lane-bar.k-own.sel { box-shadow: inset 0 0 0 2px #fff; }
.tl-lane-bar.k-own svg { flex: 0 0 auto; }
.tl-sound-row { flex-wrap: wrap; gap: 8px; }

/* The list's title row: the new-project button sits beside the title, and under it when there is no room. */
.tl-list-head { align-items: center; }
.tl-list-head > div { flex: 1 1 220px; min-width: 0; }

/* ---------- Recording in the site: the studio ---------- */
.tl-add-row { display: flex; gap: 8px; }
.tl-add-row > .btn { flex: 1 1 0; min-width: 0; }
.tl-btn-rec { background: var(--white); border: 1px solid var(--line); color: var(--ink); }
.tl-btn-rec:hover { border-color: var(--err); color: var(--err); }
.rec-dot-static { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--err); flex: 0 0 auto; box-shadow: 0 0 0 3px var(--err-bg); }
.tl-tool-rec .rec-dot-static { width: 12px; height: 12px; margin: 3px 0; }
.tl-file.failed .tl-file-text .hint { color: var(--err); }
.rec-thumb { display: grid; place-items: center; color: var(--mute); background: var(--line-2); }
.tl-marks { position: absolute; inset: 0; pointer-events: none; }
.tl-flag { position: absolute; top: 2px; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 4px; background: #F5B400; color: #111214; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); }

.rec-studio { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #0E0F11; color: #F3F3F0; }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rec-head h2 { margin: 0; font-size: 17px; }
.rec-head .icon-btn { color: #F3F3F0; }
.rec-head .icon-btn[hidden] { display: none; }
.rec-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.rec-main { position: relative; min-height: 0; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rec-stage { position: relative; flex: 1 1 auto; min-height: 220px; border-radius: 16px; background: radial-gradient(120% 120% at 50% 0%, #1C1E22 0%, #121316 60%); border: 1px solid rgba(255,255,255,.06); overflow: hidden; display: grid; place-items: center; }
.rec-screen-note, .rec-voice-note { display: grid; justify-items: center; gap: 10px; text-align: center; color: #9EA2AA; padding: 24px; max-width: 420px; }
.rec-screen-note p, .rec-voice-note p { margin: 0; font-size: 14px; line-height: 1.6; }
/* Voice only: the client's voice as big bars in the middle, sized to the screen (phone, laptop, big screen). */
.rec-voice-note { width: min(760px, 92%); max-width: none; gap: 14px; }
.rec-voice-wave { width: 100%; display: grid; place-items: center; min-height: clamp(64px, 18vh, 240px); }
.rec-voice-wave .rec-waves.big { width: 100%; height: clamp(64px, 18vh, 240px); color: #6E86FF; flex: none; }
.rec-bubble { position: absolute; right: 24px; bottom: 24px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 3px solid rgba(255,255,255,.85); cursor: grab; touch-action: none; }
.rec-bubble.circle { border-radius: 50%; }
.rec-bubble.square { border-radius: 18px; }
.rec-bubble.size-s { width: 140px; height: 140px; }
.rec-bubble.size-m { width: 200px; height: 200px; }
.rec-bubble.size-l { width: 280px; height: 280px; }
.rec-bubble.full { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; cursor: default; box-shadow: none; }
.rec-bubble video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-bubble.full video { object-fit: contain; }
.rec-bubble.mirror video { transform: scaleX(-1); }
.rec-bubble.off video { opacity: 0; }
.rec-bubble.off { background: #2A2D33; }

/* the teleprompter: near the top, close to where the camera usually is */
.rec-prompter { position: absolute; top: 12px; left: 12px; width: min(560px, calc(100% - 24px)); background: rgba(10,11,13,.82); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; backdrop-filter: blur(6px); z-index: 2; }
.rec-prompter[hidden] { display: none; }
.rec-prompter.pw-s { width: min(340px, calc(100% - 16px)); } .rec-prompter.pw-s .rec-prompter-scroll { max-height: 110px; }
.rec-prompter.pw-l { width: min(820px, calc(100% - 16px)); } .rec-prompter.pw-l .rec-prompter-scroll { max-height: 240px; }
.rec-pgrip { height: 18px; display: grid; place-items: center; color: #8A8E96; cursor: move; touch-action: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.rec-pgrip svg { transform: rotate(90deg); }
.rec-pgrip:hover { color: #fff; }
.rec-bubble.full.framed { border-radius: 10px; }
.rec-bubble.full.framed video { object-fit: cover; }
.rec-frame-note { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 3; background: rgba(10,11,13,.85); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; max-width: calc(100% - 24px); text-align: center; }
.rec-frame-note[hidden] { display: none; }
.rec-prompter-scroll { max-height: 170px; overflow-y: auto; padding: 16px 20px; scrollbar-width: none; mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 26px), transparent 100%); }
.rec-prompter-scroll::-webkit-scrollbar { display: none; }
.rec-prompter-text { white-space: pre-wrap; line-height: 1.55; font-weight: 600; color: #fff; text-align: center; padding-bottom: 120px; }
.rec-prompter-scroll { cursor: text; }
.rec-prompter-text.is-blank { color: #8A8E96; font-weight: 500; padding-bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px !important; }
.rec-pwrite { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 12px; border: 2px dashed rgba(255,255,255,.35); background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.rec-pwrite:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.rec-pwrite-hint { font-size: 13px; color: #9A9EA6; }
.rec-pbtn.rec-pedit { white-space: nowrap; gap: 6px; padding: 0 12px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; margin-inline-start: auto; }
.rec-prompter-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.rec-pbtn { min-width: 36px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: #F3F3F0; display: grid; place-items: center; font-weight: 700; cursor: pointer; padding: 0 8px; }
.rec-pbtn:hover { background: rgba(255,255,255,.08); }
.rec-pspeed-box { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; font-size: 12px; color: #B9BAB3; }
.rec-pspeed { width: 110px; accent-color: #F3F3F0; }
/* A small teleprompter (and any narrow one) keeps every button inside: the edit button shows its pen only, the speed bar is shorter. */
.rec-prompter-bar { min-width: 0; }
.rec-prompter-bar > * { flex: 0 0 auto; }
.rec-prompter-bar .rec-pspeed-box { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.rec-prompter-bar .rec-pspeed { width: auto; flex: 1 1 60px; min-width: 40px; max-width: 110px; }
.rec-prompter.pw-s .rec-pedit span, .rec-prompter.pw-s .rec-pspeed-box > span { display: none; }
.rec-prompter.pw-s .rec-pbtn.rec-pedit { padding: 0 8px; margin-inline-start: 0; }
.rec-prompter.pw-s .rec-prompter-bar { gap: 4px; padding: 6px 8px; }

.rec-dead, .rec-trouble, .rec-near, .rec-msg { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.rec-dead[hidden], .rec-trouble[hidden], .rec-near[hidden], .rec-msg[hidden] { display: none; }
.rec-dead { background: #3A1A1A; color: #FFB4B4; border: 1px solid #6B2A2A; }
.rec-trouble { background: #3A2E12; color: #FFD98A; border: 1px solid #6B5320; }
.rec-near { background: #1E2433; color: #BFD2FF; border: 1px solid #33416A; }
.rec-msg { background: #3A1A1A; color: #FFB4B4; margin: 0; flex-wrap: wrap; }
.rec-msg .rec-retry { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.rec-select { direction: ltr; text-align: start; }
.rec-countdown { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: rgba(8,9,10,.72); z-index: 3; }
.rec-countdown[hidden] { display: none; }
.rec-countdown p { margin: 0; color: #B9BAB3; font-size: 15px; }
.rec-count-big { font-size: 120px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; animation: rec-pop 1s ease-out infinite; }
@keyframes rec-pop { 0% { transform: scale(1.25); opacity: .2; } 30% { transform: scale(1); opacity: 1; } 100% { opacity: .9; } }

.rec-side { min-height: 0; overflow-y: auto; padding: 20px; border-inline-start: 1px solid rgba(255,255,255,.08); background: #141518; }
.rec-setup, .rec-done { display: flex; flex-direction: column; gap: 14px; }
.rec-h { margin: 0; font-size: 15px; }
.rec-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-mode { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03); color: #F3F3F0; text-align: start; cursor: pointer; min-height: 92px; }
.rec-mode:hover { border-color: rgba(255,255,255,.3); }
.rec-mode.on { border-color: #F3F3F0; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px #F3F3F0; }
.rec-mode.off { opacity: .55; }
.rec-mode b { font-size: 14px; }
.rec-mode span:not(.rec-mode-ico) { font-size: 12px; color: #A7AAB1; line-height: 1.45; }
.rec-mode-ico { display: inline-flex; align-items: flex-end; gap: 2px; margin-bottom: 2px; }
.rec-devices { display: flex; flex-direction: column; gap: 10px; }
.rec-field { display: flex; flex-direction: column; gap: 6px; }
.rec-field[hidden] { display: none; }
.rec-studio .lbl { font-size: 12px; color: #A7AAB1; }
.rec-studio .input, .rec-studio select.input { background: #1C1E22; border-color: rgba(255,255,255,.14); color: #F3F3F0; }
.rec-level { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; background: #1C1E22; color: #A7AAB1; }
.rec-level .rec-waves { color: #F3F3F0; height: 24px; }
.rec-shape-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 10px; }
.rec-shape-row[hidden] { display: none; }
.rec-seg { display: inline-flex; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; overflow: hidden; }
.rec-seg button { flex: 1 1 0; padding: 8px 10px; background: transparent; color: #D7D8D3; border: 0; cursor: pointer; font-size: 13px; min-height: 38px; }
.rec-seg button.on { background: #F3F3F0; color: #111214; font-weight: 700; }
.rec-switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.rec-switch[hidden] { display: none; }
.rec-switch input { margin-top: 3px; width: 18px; height: 18px; accent-color: #F3F3F0; flex: 0 0 auto; }
.rec-switch span { display: flex; flex-direction: column; gap: 2px; }
.rec-switch b { font-size: 14px; }
.rec-switch small { font-size: 12px; color: #A7AAB1; }
.rec-extras { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: #F3F3F0; cursor: pointer; font-size: 14px; }
.rec-chip.on { background: #F3F3F0; color: #111214; border-color: #F3F3F0; }
.rec-hint { margin: 0; font-size: 12px; color: #8A8E96; line-height: 1.6; }
.rec-start { height: 52px; font-size: 16px; gap: 10px; background: var(--err); border-color: var(--err); color: #fff; }
.rec-start:hover { filter: brightness(1.07); }
.rec-start .rec-dot-static { background: #fff; box-shadow: none; }

.rec-bar-live { display: flex; flex-direction: column; gap: 14px; }
.rec-live-head { display: flex; align-items: center; gap: 10px; }
.rec-studio .rec-time, .rec-float .rec-time { font-size: 22px; font-weight: 700; color: #fff; }
.rec-state { font-size: 13px; color: #FFD98A; }
.rec-studio.paused .rec-dot { animation: none; background: #8A8E96; }
.rec-live-ctls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-ctl { position: relative; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #F3F3F0; cursor: pointer; font-size: 14px; }
.rec-ctl[hidden] { display: none; }
.rec-ctl:hover { background: rgba(255,255,255,.09); }
.rec-ctl.warn { border-color: #6B5320; color: #FFD98A; }
.rec-ctl.danger:hover { border-color: #6B2A2A; color: #FFB4B4; }
.rec-ctl.pulse { animation: rec-flash .5s ease-out; }
@keyframes rec-flash { 0% { background: #F5B400; color: #111214; } 100% { background: rgba(255,255,255,.04); } }
.rec-count { margin-inline-start: auto; font-size: 12px; background: #F5B400; color: #111214; border-radius: 999px; padding: 0 7px; line-height: 20px; }
.rec-count:empty { display: none; }
.rec-finish { grid-column: 1 / -1; height: 52px; font-size: 16px; gap: 8px; }
/* Like a phone's recorder: while recording, stop is red with a white square, and the sign by the time is a beating red square. */
.rec-finish svg rect { fill: currentColor; }
.rec-studio .rec-dot, .rec-float .rec-dot { border-radius: 3px; }
.rec-keys { margin: 0; font-size: 12px; color: #8A8E96; }
.rec-done video.rec-preview { width: 100%; max-height: 260px; border-radius: 12px; background: #000; }
.rec-plan { margin: 0; font-size: 14px; color: #D7D8D3; line-height: 1.6; }
.rec-done .tl-kinds { margin-top: 6px; }
.rec-done .tl-kind { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.14); color: #F3F3F0; }
.rec-done .tl-kind.on { border-color: #F3F3F0; background: rgba(255,255,255,.1); }
.rec-done-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rec-done-foot .btn.bo { background: transparent; color: #F3F3F0; border-color: rgba(255,255,255,.2); }
.rec-saving { color: #B9BAB3; }
/* the floating window over every app (Chrome and Edge) */
.rec-float-page { margin: 0; background: #0E0F11; color: #F3F3F0; font-family: inherit; }
.rec-float { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.rec-float .rec-time { font-size: 18px; }
.rec-float-ctls { display: flex; gap: 6px; }
.rec-float-ctls .rec-ctl { min-height: 40px; padding: 0 10px; }
.rec-float-ctls .rec-finish { height: 40px; font-size: 14px; flex: 1 1 auto; }

@media (max-width: 860px) {
  .rec-head { padding: 10px 14px; }
  .rec-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rec-main { padding: 12px; }
  .rec-stage { min-height: 180px; }
  .rec-side { border-inline-start: 0; border-top: 1px solid rgba(255,255,255,.08); padding: 14px; max-height: 58vh; }
  .rec-studio[data-step="recording"] .rec-side { max-height: none; }
  .rec-bubble.size-s { width: 96px; height: 96px; } .rec-bubble.size-m { width: 130px; height: 130px; } .rec-bubble.size-l { width: 170px; height: 170px; }
  .rec-bubble { right: 12px; bottom: 12px; }
  .rec-prompter-scroll { max-height: 120px; padding: 10px 14px; }
  .rec-prompter .rec-pedit span, .rec-prompter .rec-pspeed-box > span { display: none; }
  .rec-prompter .rec-pbtn.rec-pedit { padding: 0 8px; margin-inline-start: 0; }
  .rec-prompter .rec-prompter-bar { gap: 4px; padding: 6px 8px; }
  .rec-keys { display: none; }
  .rec-count-big { font-size: 90px; }
}
.rec-screen-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Camera alone fills its box on every screen size; the start button always stays in view at the panel's foot. */
.rec-stage .rec-bubble.full { position: absolute; inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.rec-setup .rec-start { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -12px 16px #141518; }

/* Uploads in progress over the picture (a press opens the files), and their count on the "add" button. */
.tl-upstrip { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(14,15,18,.92); color: #F3F3F0; font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.tl-upstrip[hidden] { display: none; }
.tl-upstrip-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tl-upstrip-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tl-upstrip .tl-up-bar { display: block; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; }
.tl-upstrip .tl-up-bar i { display: block; height: 100%; background: #4E6BFF; transition: width .2s; }
.tl-upstrip-more { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.12); }
.tl-tool[data-count] { position: relative; }
.tl-tool[data-count]::after { content: attr(data-count); position: absolute; top: 2px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #4E6BFF; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
/* A picture to show and its note: one card. */
.tl-insert { border: 1px solid var(--tl-line, rgba(255,255,255,.12)); border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.tl-insert .tl-file { border: 0; border-radius: 0; margin: 0; }
.tl-insert-note { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; border-top: 1px solid var(--tl-line, rgba(255,255,255,.08)); }
.tl-insert-note .lbl { font-size: 12px; color: #B9BAB3; }
.tl-insert-note .tl-note { width: 100%; box-sizing: border-box; border: 0; background: transparent; padding: 4px 0; }

.tl-insert-note textarea.note-box { background: transparent; border: 0; padding: 4px 0; color: var(--paper); }
.tl-insert-note .note-foot { color: #9A9EA6; }

