/* TM iconik bridge — hides the built-in transcription/import surfaces and styles the TM panel.
   Build 69d60ee-20260911T1335Z */

/* Transcripts only come from iconik: no NEW transcription, no vendor keys, no imports, no media export (needs CORS). */
#new-transcription-btn, #upload-transcribe-btn, #upload-align-btn, #file-import-submenu, #export-media-btn { display: none !important; }
#file-dropdown > hr:first-of-type { display: none !important; }

/* ---- side panel ---- */
#tm-panel { flex: 0 1 45%; min-height: 0; display: flex; flex-direction: column; border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 6px; padding: 6px 8px 4px; }
.tm-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px; }
.tm-h2 { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; opacity: .8; margin: 0; }
#tm-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
.tm-row { display: flex; align-items: flex-start; border-radius: 8px; padding: 6px 6px 6px 10px; margin: 2px 0; }
.tm-row:hover { background: rgba(0,0,0,.05); }
.tm-row.tm-current { background: rgba(87, 13, 248, .10); box-shadow: inset 3px 0 0 #570df8; }
.tm-row-main { flex: 1 1 auto; min-width: 0; text-decoration: none; color: inherit; }
.tm-row-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-row-meta { font-size: 11.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-row-actions { display: flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity .15s; }
.tm-row:hover .tm-row-actions, .tm-row.tm-current .tm-row-actions { opacity: 1; }
.tm-icon { border: 0; background: transparent; cursor: pointer; font-size: 13px; line-height: 1; padding: 4px 5px; border-radius: 6px; color: inherit; text-decoration: none; }
.tm-icon:hover { background: rgba(0,0,0,.08); }
.tm-empty { padding: 8px 10px; font-size: 12px; }
.tm-panel-foot { font-size: 11px; padding: 6px 4px 0; }
.tm-dim { opacity: .65; }
.tm-warn { color: #b45309; font-weight: 600; }
.tm-error-text { color: #b91c1c; }
.tm-mono, .tm-pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tm-pre { white-space: pre-wrap; background: rgba(0,0,0,.05); padding: 8px; border-radius: 6px; max-height: 240px; overflow: auto; }

/* pills */
.tm-pill { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: #e5e7eb; color: #374151; margin-right: 4px; vertical-align: middle; }
.tm-pill.tm-ready, .tm-pill.tm-sent { background: #dbeafe; color: #1e40af; }
.tm-pill.tm-saved { background: #dcfce7; color: #166534; }
.tm-pill.tm-failed { background: #fee2e2; color: #991b1b; }
.tm-pill.tm-stale { background: #fef3c7; color: #92400e; margin-left: 4px; }
.tm-pill.tm-local { background: #ede9fe; color: #5b21b6; margin-left: 4px; }

/* ---- toolbar above the transcript ---- */
#tm-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 14px; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 12.5px; background: #f5f5f5; }
#tm-status { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-bar-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tm-build { font-family: ui-monospace, Menlo, monospace; font-size: 10px; opacity: .45; margin-left: 4px; }

/* ---- buttons ---- */
.tm-btn { border: 1px solid rgba(0,0,0,.15); background: #fff; color: #111; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.2; }
.tm-btn:hover { background: #f3f4f6; }
.tm-btn:disabled { opacity: .5; cursor: default; }
.tm-btn.tm-primary { background: #570df8; border-color: #570df8; color: #fff; }
.tm-btn.tm-primary:hover { background: #4506cb; }
.tm-btn.tm-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.tm-btn.tm-danger:hover { background: #b91c1c; }
.tm-btn.tm-small { padding: 3px 8px; font-size: 12px; }
.tm-x { border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; color: inherit; }
.tm-x:hover { background: rgba(0,0,0,.08); }
.tm-input { width: 100%; padding: 8px 10px; border: 1px solid rgba(0,0,0,.2); border-radius: 8px; font-size: 14px; margin: 6px 0 10px; }

/* ---- modal / toast / busy ---- */
.tm-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tm-modal.tm-fullpage { background: #f5f5f5; }
.tm-modal-box { background: #fff; color: #111; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; padding: 18px 20px; font-size: 14px; line-height: 1.55; }
.tm-modal-box.tm-wide { width: min(760px, 100%); }
.tm-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tm-modal-title { font-weight: 700; font-size: 16px; }
.tm-modal-body { overflow: auto; min-height: 0; }
.tm-modal-body p { margin: 0 0 8px; }
.tm-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tm-hist { list-style: none; margin: 0; padding: 0; }
.tm-hist-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px solid rgba(0,0,0,.07); font-size: 13px; }
.tm-hist-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: 0 0 auto; }
.tm-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 10001; background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: flex; align-items: center; gap: 10px; font-size: 13.5px; max-width: min(720px, 92vw); }
.tm-toast.tm-ok { background: #166534; }
.tm-toast.tm-error { background: #991b1b; }
.tm-toast .tm-btn.tm-small { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
#tm-busy { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10001; background: #fff; color: #111; border: 1px solid rgba(0,0,0,.12); border-radius: 999px; padding: 6px 14px 6px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); display: flex; align-items: center; gap: 8px; font-size: 13px; }
#tm-busy[hidden] { display: none; }
.tm-spinner { width: 14px; height: 14px; border: 2px solid #ddd; border-top-color: #570df8; border-radius: 50%; animation: tm-spin .8s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }

/* speakers dialog */
.tm-spk { list-style: none; margin: 0; padding: 0; }
.tm-spk-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.tm-spk-from { flex: 1 1 40%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-spk-arrow { opacity: .5; }
.tm-input.tm-inline { flex: 1 1 50%; margin: 0; padding: 6px 8px; font-size: 13px; }
