/* Track editor — right-rail tray (insets between topbar & playerbar) */

.te-tray {
  position: fixed;
  top: calc(var(--topbar-h, 56px) + 8px);
  right: 12px;
  bottom: calc(var(--player-h, 98px) + 8px);
  width: min(620px, 92vw);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.5);
  z-index: 8001;
  display: flex;
  flex-direction: column;
  animation: te-tray-in 200ms cubic-bezier(.2,.8,.2,1);
  color: var(--text);
  overflow: hidden;
}
@keyframes te-tray-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* close button (corner) */
.te-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.te-x:hover { background: var(--bg-3); color: var(--text); border-color: var(--text-3); }

/* ---------- HEADER ---------- */
.te-head {
  flex: 0 0 auto;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  position: relative;
}
.te-head__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: flex-start;
}
.te-cover {
  width: 64px; height: 64px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--bg-3);
  color: var(--text-3);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer; flex: 0 0 auto;
  position: relative; overflow: hidden;
  transition: border-color 140ms, background 140ms, transform 140ms;
}
.te-cover:hover {
  border-color: color-mix(in oklch, var(--text-3) 50%, var(--line));
  color: var(--text-2);
}
.te-cover.is-dragover {
  border: 1.5px dashed var(--accent);
  background: color-mix(in oklch, var(--accent) 14%, var(--bg-3));
  color: var(--accent);
  transform: scale(1.02);
}
.te-cover.has-img { background: #000; border-color: var(--line); color: transparent; }
.te-cover__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.te-cover__hint {
  position: relative;
  padding: 0;
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-align: center;
  color: var(--text-3);
  background: transparent;
  opacity: 1;
  transition: opacity 140ms, color 140ms;
  pointer-events: none;
}
.te-cover:hover .te-cover__hint { color: var(--text-2); }
.te-cover.is-dragover .te-cover__hint { color: var(--accent); }
.te-cover.has-img .te-cover__hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px; color: var(--text);
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  opacity: 0;
}
.te-cover.has-img:hover .te-cover__hint,
.te-cover.has-img.is-dragover .te-cover__hint { opacity: 1; }
.te-head__main { min-width: 0; padding-right: 36px; }
.te-title {
  font-size: 18px; font-weight: 600; line-height: 1.2;
  margin: 0; color: var(--text);
  text-wrap: balance;
  word-break: break-word;
}
.te-head__sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.te-eyebrow--num {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 6px;
}
.te-savebar { position: relative; }
.te-savebar__status { flex: 1; }
.te-savebar__sub { color: var(--ink-3); font-weight: 400; }
.te-savebar__actions { display: flex; gap: 6px; align-items: center; }
.te-mini.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.te-mini__count { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(255,255,255,0.08); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
.te-history {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 320px; max-height: 380px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 20; display: flex; flex-direction: column; overflow: hidden;
}
.te-history__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.te-history__head strong { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.te-history__sub { font-size: 11px; color: var(--ink-3); flex: 1; }
.te-history__close { width: 22px; height: 22px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; border-radius: 6px; }
.te-history__close:hover { background: rgba(255,255,255,0.06); color: var(--ink-1); }
.te-history__list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; }
.te-history__item { margin: 0; }
.te-history__btn { width: 100%; display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: transparent; color: var(--ink-1); cursor: pointer; border-radius: 8px; text-align: left; }
.te-history__btn:hover { background: rgba(255,255,255,0.04); }
.te-history__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin: 0 3px; }
.te-history__item.is-head .te-history__dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(96, 200, 220, 0.18); }
.te-history__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.te-history__when { font-size: 12px; font-weight: 500; }
.te-history__diff { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-history__time { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.te-history__foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; }
.te-history__keep { color: var(--ink-3); }

.te-star {
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 36px;
  transition: color 120ms;
}
.te-star:hover { color: var(--accent); }
.te-star.is-on { color: var(--accent); }
.te-star.is-on svg { fill: var(--accent); }

.te-head__actions { margin: 12px 0 10px; }
.te-play {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 0; cursor: pointer;
  background: var(--accent);
  color: #fff;
  font: 600 13px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.01em;
  transition: filter 120ms, transform 80ms;
}
.te-play:hover { filter: brightness(1.08); }
.te-play:focus { outline: none; }
.te-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.te-play:active { transform: scale(0.97); }
.te-play__ico { display: inline-flex; transform: translateY(-0.5px); }

.te-head__meta {
  display: flex; flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  align-items: center;
}
.te-head__meta > span:nth-child(1),
.te-head__meta > span:nth-child(2),
.te-head__meta > span:nth-child(3) {
  font-weight: 500;
}
.te-head__dot { color: var(--text-3); opacity: 0.6; }
.te-head__status { color: var(--text-3); }
.te-head__plays { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ---------- TABS ---------- */
.te-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0 14px;
  background: var(--bg);
}
.te-tabs::-webkit-scrollbar { height: 4px; }
.te-tabs::-webkit-scrollbar-thumb { background: var(--line); }
.te-tab {
  background: transparent; border: 0;
  color: var(--text-3);
  font-size: 13px; font-weight: 500;
  padding: 12px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms;
}
.te-tab:hover { color: var(--text-2); }
.te-tab--on {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---------- BODY ---------- */
.te-body {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
}
.te-body::-webkit-scrollbar { width: 8px; }
.te-body::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
.te-pane {
  padding: 18px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.te-copy,
.te-muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
.te-muted { color: var(--text-3); }

/* ---------- SAVE BAR ---------- */
.te-savebar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 12px;
  color: var(--text-2);
}
.te-savebar--dirty {
  border-color: color-mix(in oklch, var(--accent) 40%, var(--line));
  background: color-mix(in oklch, var(--accent) 6%, var(--bg-2));
  color: var(--text);
}

/* ---------- FIELDS ---------- */
.te-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.te-field {
  display: flex; flex-direction: column;
  gap: 6px; min-width: 0;
}
.te-field--full { grid-column: 1 / -1; }
.te-field__lbl {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  min-height: 18px;
}
.te-field__name { display: inline; }
.te-field__hint {
  font-style: normal; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  color: var(--text-3); opacity: 0.75;
  font-size: 11px; margin-left: 6px;
}
.te-field__trail { display: inline-flex; align-items: center; gap: 6px; }

.te-input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit; font-size: 13px;
  padding: 9px 11px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.track-editor input::placeholder,
.track-editor textarea::placeholder,
.te-input::placeholder {
  font-style: italic !important;
  color: var(--placeholder-color, rgba(255,255,255,0.24));
}
.te-input::placeholder {
  font-style: italic;
  color: var(--placeholder-color, rgba(255,255,255,0.24));
}
.te-input:hover { border-color: color-mix(in oklch, var(--text-3) 50%, var(--line)); }
.te-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);
  background: var(--bg);
}
.te-input--ta { resize: vertical; min-height: 76px; line-height: 1.45; font-size: 13px; }
.te-input--mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.te-input--sm { padding: 6px 8px; font-size: 12px; }
.te-input--sec { max-width: 96px; }

select.te-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 28px;
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
input[type="date"].te-input { color-scheme: dark; }
select.te-input option { background: #16181c; color: #e6e7ea; padding: 6px 10px; }
select.te-input option:checked { background: #1f2228; color: #fff; }

.te-fieldnote {
  font-size: 11px; color: var(--text-3);
  letter-spacing: 0.01em;
  margin-top: 2px;
}
.te-fieldnote--right { text-align: right; }
.te-fieldnote--center { text-align: center; }
.te-fieldnote--lg { font-size: 12px; }

/* ---------- SECTIONS ---------- */
.te-sectiontitle {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 8px 0 2px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.te-pane > .te-sectiontitle:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.te-section__head--static {
  cursor: default;
  pointer-events: none;
}

/* ---------- PLAYLISTS TAB ---------- */
.te-pane--playlists {
  gap: 16px;
}
.te-playlists-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-playlists-card .te-sectiontitle {
  border-top: 0;
  margin: 0 0 4px;
  padding: 0;
}
.te-playlists-card__main {
  min-width: 0;
}
.te-playlists-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.te-playlists-row:last-child { border-bottom: 0; }
.te-playlists-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}
.te-playlists-row__count {
  color: var(--text-3);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .te-playlists-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ---------- META: tighter pane + sticky section nav + collapsibles ---------- */
.te-pane--meta {
  padding: 14px 18px 22px;
  gap: 10px;
}
.te-pane--meta .te-savebar {
  padding: 7px 12px;
  font-size: 11.5px;
}
.te-secnav {
  position: sticky; top: 0; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 0;
  margin: -4px 0 2px;
  background: linear-gradient(to bottom,
    var(--bg) 0%, var(--bg) 70%,
    color-mix(in srgb, var(--bg) 0%, transparent) 100%);
}
.te-secnav__btn {
  flex: 0 0 auto;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.te-secnav__btn:hover { border-color: var(--text-3); color: var(--text); }
.te-secnav__btn.is-on {
  background: color-mix(in oklch, var(--accent) 14%, var(--bg-2));
  border-color: color-mix(in oklch, var(--accent) 50%, var(--line));
  color: var(--text);
}
.te-secnav__all {
  margin-left: auto;
  background: transparent; border: 0;
  font-size: 11px; color: var(--text-3);
  cursor: pointer; padding: 4px 6px;
}
.te-secnav__all:hover { color: var(--text); }

.te-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  overflow: hidden;
  scroll-margin-top: 56px;
}
.te-section.is-open { background: var(--bg-2); }
.te-section__head {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: transparent; border: 0;
  cursor: pointer; text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text);
}
.te-section__head:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.te-section__caret {
  display: inline-block;
  width: 10px;
  font-size: 10px;
  color: var(--text-3);
  transition: transform 160ms ease, color 160ms;
}
.te-section.is-open .te-section__caret {
  transform: rotate(90deg);
  color: var(--accent);
}
.te-section__title { flex: 1 1 auto; }
.te-section__count {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--bg-3);
  padding: 2px 7px;
  border-radius: 999px;
}
.te-section__body {
  padding: 12px 14px 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.te-pane--meta .te-row { gap: 10px; }
.te-pane--meta .te-input { padding-block: 7px; }
.te-pane--meta .te-input--ta { min-height: 64px; }
.te-pane--meta .te-disclose { margin-top: 2px; }

.te-autofill {
  border: 1px solid color-mix(in oklch, var(--accent) 26%, var(--line));
  background: color-mix(in oklch, var(--accent) 7%, var(--bg-2));
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 16px 42px rgba(0,0,0,0.18);
}
.te-autofill__main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.te-autofill__title { font-size: 12px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; }
.te-autofill__copy { margin-top: 3px; color: var(--text-3); font-size: 11px; line-height: 1.35; max-width: 420px; }
.te-autofill__btn {
  flex: 0 0 auto;
  border: 1px solid color-mix(in oklch, var(--accent) 50%, transparent);
  border-radius: 999px;
  background: var(--accent);
  color: #050506;
  font-size: 11px;
  font-weight: 850;
  padding: 9px 12px;
  cursor: pointer;
}
.te-autofill__btn:hover { filter: brightness(1.08); }
.te-autofill__btn:disabled { opacity: 0.65; cursor: wait; }
.te-autofill__btn--locked { background: transparent; color: var(--accent); }
.te-autofill__error {
  margin-top: 9px;
  color: oklch(0.78 0.14 35);
  font-size: 11px;
  line-height: 1.35;
}

.te-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(14px);
}
.te-ai-modal__card {
  position: relative;
  width: min(560px, 94vw);
  max-height: min(720px, 92dvh);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: #111215;
  box-shadow: 0 34px 110px rgba(0,0,0,0.58);
  padding: 22px;
}
.te-ai-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}
.te-ai-modal__close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.te-ai-modal__eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.te-ai-modal__title { margin: 8px 42px 0 0; color: #fff; font-size: 22px; line-height: 1.15; }
.te-ai-modal__sub { margin-top: 8px; color: rgba(255,255,255,0.62); font-size: 12px; }
.te-ai-modal__fields { margin-top: 18px; display: grid; gap: 8px; }
.te-ai-modal__field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 92px auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  padding: 10px;
}
.te-ai-modal__field.is-empty { opacity: 0.56; }
.te-ai-modal__label { color: rgba(255,255,255,0.56); font-size: 11px; font-weight: 700; }
.te-ai-modal__value { color: #fff; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.te-ai-modal__source { color: rgba(255,255,255,0.42); font-size: 11px; min-height: 1em; }
.te-ai-modal__use {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  padding: 6px 9px;
  cursor: pointer;
}
.te-ai-modal__use:disabled { opacity: 0.35; cursor: not-allowed; }
.te-ai-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.te-ai-modal__primary {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #050506;
  font-size: 12px;
  font-weight: 850;
  padding: 9px 14px;
  cursor: pointer;
}
.te-ai-modal__primary:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 560px) {
  .te-autofill__main { align-items: stretch; flex-direction: column; }
  .te-autofill__btn { width: 100%; }
  .te-ai-modal__field { grid-template-columns: 1fr auto; }
  .te-ai-modal__label,
  .te-ai-modal__source { grid-column: 1 / -1; }
}

/* ---------- CHECK ROWS ---------- */
.te-check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: border-color 120ms, background 120ms;
}
.te-check > span { flex: 1; min-width: 0; text-align: left; }
.te-check:hover { border-color: color-mix(in oklch, var(--text-3) 40%, var(--line)); }
.te-check input[type="checkbox"] { margin: 0; accent-color: var(--accent); cursor: pointer; flex: 0 0 16px; width: 16px; height: 16px; }
.te-check__name {
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--text-2);
}
.te-check--accent .te-check__name { color: var(--accent); }
.te-check__hint {
  display: block; margin-top: 1px;
  font-style: normal; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  color: var(--text-3); font-size: 11px;
  opacity: 0.7;
}
.te-check--inline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: transparent; border: 0;
}
.te-check--inline .te-check__name { display: none; }

/* ---------- BUTTONS ---------- */
.te-btn {
  font: 600 12px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
  border-radius: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 120ms, border-color 120ms, color 120ms, transform 80ms, filter 120ms;
}
.te-btn:active { transform: translateY(1px); }
.te-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.te-btn--ghost { background: var(--bg-2); color: var(--text-2); }
.te-btn--ghost:hover { background: var(--bg-3); color: var(--text); }
.te-btn--add {
  align-self: flex-start;
  background: transparent; color: var(--text-3);
  border-style: dashed;
}
.te-btn--add:hover { color: var(--text); border-color: color-mix(in oklch, var(--text-3) 40%, var(--line)); }
.te-btn--save {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.te-btn--save:hover:not(:disabled) { filter: brightness(1.08); }
.te-btn--wide { width: 100%; justify-content: center; padding: 11px 18px; }
.te-btn--light {
  background: #f1f1f3; color: #1a0f06; border-color: #f1f1f3;
}
.te-btn--print {
  background: #2d6cf0; border-color: #2d6cf0; color: #fff;
  width: 100%; justify-content: center; padding: 12px;
  font-size: 14px; margin-top: 8px;
}
.te-btn--print:hover { filter: brightness(1.08); }
.te-btn--add-mk {
  background: oklch(0.34 0.10 260);
  border-color: oklch(0.34 0.10 260);
  color: #fff;
}

/* mini buttons inside trails / labels */
.te-mini {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11px/1 "Inter", system-ui, sans-serif;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-2);
  padding: 5px 9px;
  cursor: pointer;
  text-transform: none; letter-spacing: 0;
}
.te-mini:hover { background: var(--bg-3); color: var(--text); border-color: color-mix(in oklch, var(--text-3) 40%, var(--line)); }
.te-mini:disabled { opacity: 0.4; cursor: not-allowed; }
.te-mini--xs { padding: 3px 7px; font-size: 10px; }
.te-mini--ai {
  background: color-mix(in oklch, oklch(0.55 0.21 290) 18%, var(--bg-2));
  border-color: color-mix(in oklch, oklch(0.55 0.21 290) 50%, var(--line));
  color: oklch(0.78 0.18 290);
}
.te-mini--ai:hover { background: color-mix(in oklch, oklch(0.55 0.21 290) 28%, var(--bg-2)); color: #fff; }

/* disclosure */
.te-disclose {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: border-color 120ms;
}
.te-disclose:hover { border-color: color-mix(in oklch, var(--text-3) 40%, var(--line)); color: var(--text); }
.te-disclose__caret { display: inline-block; transition: transform 140ms; color: var(--text-3); }
.te-disclose--on .te-disclose__caret { transform: rotate(90deg); }
.te-disclose strong { color: var(--text); margin-right: 6px; font-weight: 600; }
.te-disclose em { font-style: normal; color: var(--text-3); }
.te-smart {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  margin-top: -14px;
  background: var(--bg-2);
}
.te-smart__actions { display: flex; justify-content: flex-end; }

/* ---------- TRANSFORM ---------- */
.te-tuning {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}
.te-tuning__lbl {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
  gap: 12px;
}
.te-tuning__lbl em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); opacity: 0.75; margin-left: 6px; }
.te-tuning__saved { white-space: nowrap; color: var(--text-2); }
.te-tuning__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.te-tuning__pill {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.te-tuning__pill em {
  font-style: normal; font-weight: 400;
  font-size: 11px; color: var(--text-3); margin-left: 4px;
}
.te-tuning__pill:hover { border-color: color-mix(in oklch, var(--text-3) 40%, var(--line)); }
.te-tuning__pill.is-on {
  background: color-mix(in oklch, var(--accent) 8%, var(--bg-2));
  border-color: var(--accent);
  color: var(--accent);
}
.te-tuning__pill.is-on em { color: var(--accent); opacity: 0.8; }

.te-keepnote {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: oklch(0.74 0.14 145);
  margin-left: 30px;
}

/* ---------- WAVEFORM ---------- */
.te-wf {
  position: relative;
  height: 160px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 16px;
}
.te-wf__bars {
  position: absolute; inset: 16px;
  display: flex; align-items: center;
  gap: 1px;
}
.te-wf__bar {
  flex: 1;
  background: var(--text-3);
  opacity: 0.45;
  border-radius: 1px;
  min-height: 4px;
}
.te-wf__bar.is-active { background: var(--accent); opacity: 1; }
.te-wf__handle {
  position: absolute; top: 16px; bottom: 16px;
  width: 4px;
  background: var(--accent);
  z-index: 2;
  cursor: ew-resize;
}
.te-wf__handle::before, .te-wf__handle::after {
  content: ""; position: absolute; left: -4px;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 2px;
}
.te-wf__handle::before { top: -6px; }
.te-wf__handle::after { bottom: -6px; }
.te-wf__handle--l { left: 14px; }
.te-wf__handle--r { right: 14px; }
.te-wf__pin {
  position: absolute; top: 8px; bottom: 8px;
  left: 38%;
  width: 3px;
  background: var(--accent);
  z-index: 3;
  pointer-events: none;
}
.te-wf__pin::before {
  content: ""; position: absolute; top: -4px; left: -5px;
  width: 13px; height: 13px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 3px;
}

.te-wf__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.te-wf__len { font-size: 12px; color: var(--text-2); }
.te-wf__legend { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.te-leg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.te-leg em { font-style: normal; color: var(--text-3); margin-left: 2px; }
.te-leg__sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.te-leg__sw--active { background: var(--accent); }
.te-leg__sw--track { background: var(--text-3); opacity: 0.5; }
.te-leg__sw--pin   { background: var(--accent); border: 2px solid var(--bg); box-sizing: border-box; }
.te-leg__sw--trim  { background: var(--accent); border-radius: 2px; }

/* ---------- INSIGHTS ---------- */
.te-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.te-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 18px 12px;
  text-align: center;
}
.te-stat__v {
  font-size: 24px; font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.te-stat__l {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 8px;
}
.te-event {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-event__title { font-size: 13px; font-weight: 600; color: var(--text); }
.te-event__sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.te-event__date { font-size: 11px; color: var(--text-3); }

/* ---------- STEMS / FILES ---------- */
.te-files { display: flex; flex-direction: column; gap: 8px; }
.te-file-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-file-name { font-size: 13px; font-weight: 600; color: var(--text); }
.te-file-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ---------- MARKERS ---------- */
.te-mk-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: end; }
.te-mk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.te-mk {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  font-size: 13px;
}
.te-mk__sec {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-2); font-size: 12px;
}

/* ---------- SPLITS ---------- */
.te-splits-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.te-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.te-pill--ok { color: oklch(0.74 0.14 145); border-color: color-mix(in oklch, oklch(0.74 0.14 145) 40%, var(--line)); }
.te-pill--warn { color: oklch(0.72 0.16 25); border-color: color-mix(in oklch, oklch(0.72 0.16 25) 50%, var(--line)); background: color-mix(in oklch, oklch(0.72 0.16 25) 10%, var(--bg-2)); }
.te-splits-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  overflow: hidden;
}
.te-splits-head-row, .te-splits-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 0.8fr 0.8fr 1fr 24px;
  gap: 6px;
  padding: 8px 10px;
  align-items: center;
}
.te-splits-head-row {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.te-splits-row + .te-splits-row { border-top: 1px solid var(--line); }
.te-splits-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.te-splits-bundle { display: flex; }

/* ---------- LYRICS ---------- */
.te-lyric-empty {
  display: flex; flex-direction: column;
  gap: 10px; align-items: stretch;
  padding: 18px 0;
}

/* ---------- COMMENTS ---------- */
.te-comments { display: flex; flex-direction: column; gap: 8px; }
.te-comment {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-comment__head {
  font-size: 12px; color: var(--text);
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 4px;
}
.te-comment__anchor { color: var(--text-3); font-size: 11px; }
.te-comment__body { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.te-compose {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  border-radius: 10px;
  background: var(--bg-2);
}
.te-compose__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- EMPTY STATES ---------- */
.te-empty {
  font-size: 13px; color: var(--text-3);
  text-align: center;
  padding: 18px 12px;
}
.te-empty--padded { padding: 36px 16px; }
.te-empty--center { padding: 12px 0; }
.te-empty--dashed {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
}

/* ---------- FOOTER ---------- */
.te-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.te-foot__hint {
  font-size: 11px; color: var(--text-3);
  margin-left: auto; margin-right: 8px;
  letter-spacing: 0.02em;
}
.te-foot__kbd {
  display: inline-block; margin-left: 6px;
  padding: 1px 5px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-3); background: var(--bg);
}

/* ============================================================
   v2 ADDITIONS — DAW Inspector mode
   ============================================================ */

/* Inline-edit ------------------------------------------------ */
.te-ie__view {
  display: inline-block;
  border-radius: 4px;
  padding: 0 2px;
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color 120ms, background 120ms;
}
.te-ie__view:hover { border-bottom-color: var(--line); }
.te-ie__view:focus { outline: none; border-bottom-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, transparent); }
.te-ie__view--empty { color: var(--text-3); font-style: italic; opacity: 0.3; }

.te-ie::placeholder,
.te-ie--big::placeholder,
.te-ie--ta::placeholder {
  font-style: italic !important;
  color: var(--text-3);
  opacity: 0.25;
}
.te-ie::placeholder,
.te-ie--big::placeholder,
.te-ie--ta::placeholder {
  font-style: italic;
}
.te-ie__view--big { font: inherit; }
.te-ie {
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 6px;
  font: inherit;
  outline: none;
  width: 100%;
  max-width: 100%;
}
.te-ie--big { font-size: 18px; font-weight: 600; }
.te-ie--ta { resize: vertical; min-height: 60px; }

/* Header big pills ------------------------------------------ */
.te-head__pills {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.te-bigpill {
  display: flex; flex-direction: column; gap: 2px;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  min-width: 64px;
  text-align: left;
  transition: border-color 120ms, background 120ms;
}
.te-bigpill:hover { border-color: color-mix(in oklch, var(--accent) 50%, var(--line)); background: var(--bg); }
.te-bigpill--ro { cursor: default; opacity: 0.85; }
.te-bigpill--ro:hover { border-color: var(--line); background: var(--bg-2); }
.te-bigpill__v { font-size: 16px; font-weight: 600; line-height: 1; font-family: "JetBrains Mono", ui-monospace, monospace; }
.te-bigpill__l { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-3); }
.te-bigpill__sub { font-size: 11px; opacity: 0.55; margin-left: 1px; font-weight: 500; }
.te-bigpill__lock { font-size: 13px; opacity: 0.55; }
.te-bigpill--locked { opacity: 0.5; cursor: pointer; }
.te-bigpill--locked:hover { opacity: 0.75; border-color: color-mix(in oklch, var(--accent) 30%, var(--line)); }

.te-head__sep { color: var(--text-3); margin: 0 6px; opacity: 0.5; }
.te-mini--qf { margin-left: 8px; color: var(--text-3); }

/* Section AI badge ------------------------------------------ */
.te-section__ai {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.10em;
  color: var(--accent);
  padding: 2px 6px;
  border: 1px solid color-mix(in oklch, var(--accent) 40%, var(--line));
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 6%, transparent);
}

/* Tags chip input ------------------------------------------- */
.te-chipinput {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 6px 8px;
  min-height: 38px;
}
.te-chipinput:focus-within { border-color: var(--accent); }
.te-chipinput__in {
  flex: 1 1 120px; min-width: 120px;
  border: 0; outline: none;
  background: transparent; color: var(--text);
  font: inherit;
  padding: 4px 2px;
}
.te-chipinput__in::placeholder,
.te-credit-chipinput__in::placeholder,
.te-credit-chipinput .te-ac input::placeholder,
.te-credcard__name::placeholder {
  font-style: italic !important;
  color: var(--placeholder-color, rgba(255,255,255,0.24));
  opacity: 0.82;
}
.te-chipinput__in::placeholder,
.te-credit-chipinput__in::placeholder,
.te-credit-chipinput .te-ac input::placeholder,
.te-credcard__name::placeholder {
  font-style: italic;
}
.te-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: color-mix(in oklch, var(--accent) 14%, var(--bg-2));
  color: var(--text);
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
}
.te-chip--credit {
  background: color-mix(in oklch, var(--credit-color, var(--accent)) 18%, var(--bg-2));
  border-color: color-mix(in oklch, var(--credit-color, var(--accent)) 42%, var(--line));
}
.te-chip button {
  background: transparent; border: 0; color: var(--text-3);
  cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 2px;
}
.te-chip button:hover { color: var(--text); }

/* AI Button ------------------------------------------------- */
.te-aibtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in oklch, var(--accent) 40%, var(--line));
  background: color-mix(in oklch, var(--accent) 8%, var(--bg-2));
  color: var(--accent);
  font: 600 11px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.te-aibtn:hover { background: color-mix(in oklch, var(--accent) 14%, var(--bg-2)); }
.te-aibtn:disabled { opacity: 0.6; cursor: progress; }
.te-aibtn__ico { display: inline-flex; }
.te-aibtn.is-busy { animation: te-aishimmer 1.4s ease-in-out infinite; }
@keyframes te-aishimmer { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Pitch row + avatars --------------------------------------- */
.te-pitchrow { display: flex; gap: 8px; }
.te-avatars { display: flex; gap: 4px; margin-top: 8px; }
.te-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, oklch(0.65 0.18 220), oklch(0.55 0.18 280));
  color: #fff; font: 700 11px/1 "Inter", sans-serif;
}

/* Credits grid ---------------------------------------------- */
.te-credgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.te-credcard {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  transition: border-color 120ms;
}
.te-credcard:hover { border-color: color-mix(in oklch, var(--accent) 30%, var(--line)); }
.te-credcard__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font: 700 13px/1 "Inter", sans-serif;
  flex: 0 0 32px;
}
.te-credcard__body { flex: 1 1 auto; min-width: 0; }
.te-credcard__role { font-size: 9px; font-weight: 700; letter-spacing: 0.10em; color: var(--text-3); margin-bottom: 2px; }
.te-credit-chipinput {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  gap: 6px 8px;
  row-gap: 6px;
  column-gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
}
.te-credit-chipinput:focus-within {
  border-color: var(--accent);
}
.te-credit-chipinput .te-ac {
  flex: 1 1 96px;
  min-width: 96px;
}
.te-credit-chipinput__in {
  min-width: 96px;
  width: 100%;
  font-size: 12.5px;
  line-height: 1.2;
  padding: 3px 0;
}
.te-credcard__name {
  width: 100%; border: 0; background: transparent; color: var(--text);
  font: 500 13px/1.2 "Inter", sans-serif;
  padding: 0; outline: none;
}
.te-credcard__name::placeholder { color: var(--placeholder-color, rgba(255,255,255,0.24)); font-style: italic !important; opacity: 0.82; }

/* Rights ---------------------------------------------------- */
.te-rightstrail { display: inline-flex; align-items: center; gap: 6px; }
.te-rights-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.te-stpill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg);
}
.te-stpill--ok { color: oklch(0.74 0.14 145); border-color: color-mix(in oklch, oklch(0.74 0.14 145) 40%, var(--line)); background: color-mix(in oklch, oklch(0.74 0.14 145) 8%, var(--bg)); }
.te-stpill--warn { color: oklch(0.72 0.16 70); border-color: color-mix(in oklch, oklch(0.72 0.16 70) 50%, var(--line)); background: color-mix(in oklch, oklch(0.72 0.16 70) 10%, var(--bg)); }
.te-stpill--err { color: oklch(0.66 0.18 25); border-color: color-mix(in oklch, oklch(0.66 0.18 25) 50%, var(--line)); background: color-mix(in oklch, oklch(0.66 0.18 25) 10%, var(--bg)); }
.te-stpill--neutral { color: var(--text-3); }

/* AI cards -------------------------------------------------- */
.te-aigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.te-aicard {
  padding: 12px;
  border: 1px solid color-mix(in oklch, var(--accent) 25%, var(--line));
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 6%, var(--bg-2)), var(--bg-2));
  display: flex; flex-direction: column; gap: 8px;
}
.te-aicard__head { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; }
.te-aicard .te-aibtn { width: 100%; justify-content: center; padding: 9px 12px; font-size: 12px; letter-spacing: 0.04em; }
.te-aicard__head strong { font-weight: 600; color: var(--text); font-size: 13px; }
.te-aicard p { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.4; }

/* Mini waveform --------------------------------------------- */
.te-miniwf { display: flex; align-items: center; gap: 1px; flex: 0 0 120px; }
.te-miniwf__bar {
  flex: 1; min-width: 1px;
  background: color-mix(in oklch, var(--text) 34%, transparent);
  opacity: 0.5;
  border-radius: 1px;
}
.te-miniwf__bar.is-played { opacity: 1; }
.te-miniwf__bar.is-hot { background: color-mix(in oklch, var(--accent) 70%, currentColor); opacity: 0.9; }

/* Waveform tab v2 ------------------------------------------- */
.te-wfbox {
  position: relative;
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 22px 16px 16px;
  overflow: hidden;
  box-sizing: border-box;
}
.te-wfbox__bars { position: absolute; top: 22px; right: 16px; bottom: 16px; left: 16px; width: calc(100% - 32px); box-sizing: border-box; display: flex; align-items: center; gap: 1px; z-index: 1; }
.te-wfbox .te-wf__bar {
  flex: 1; min-width: 1px;
  background: color-mix(in oklch, var(--text) 36%, transparent); opacity: 0.78; min-height: 4px;
  border-radius: 1px;
}
.te-wfbox--pending .te-wf__bar {
  opacity: 0.46;
  background: color-mix(in oklch, var(--text) 44%, var(--accent));
}
.te-wfbox__pending {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 6;
  padding: 3px 7px;
  border: 1px solid color-mix(in oklch, var(--line) 72%, transparent);
  border-radius: 6px;
  background: color-mix(in oklch, var(--bg-2) 82%, transparent);
  color: var(--text-2);
  font: 700 10px/1.1 "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.te-wfbox .te-wf__bar.is-active { background: var(--accent); opacity: 1; }
.te-wfbox .te-wf__bar.is-trimmed { opacity: 0.2; }
.te-wfbox .te-wf__bar.is-hot { box-shadow: 0 0 6px color-mix(in oklch, var(--accent) 70%, transparent); background: color-mix(in oklch, var(--accent) 60%, var(--text)); }
.te-wfbox__mask {
  position: absolute;
  top: 22px;
  bottom: 16px;
  background: rgba(0,0,0,0.28);
  pointer-events: none;
  z-index: 2;
}
.te-wfbox__mask--l { left: 16px; }
.te-wfbox__mask--r { right: 16px; }
.te-wfbox__playhead {
  position: absolute;
  top: 14px;
  bottom: 12px;
  width: 2px;
  transform: translateX(-1px);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 0 12px color-mix(in oklch, var(--accent) 60%, transparent);
  border-radius: 999px;
  pointer-events: none;
  z-index: 4;
}
.te-wfbox__handle {
  position: absolute; top: 16px; bottom: 16px; width: 3px;
  background: oklch(0.66 0.18 25); cursor: ew-resize;
  z-index: 5;
}
.te-wfbox__handle--l { left: 14px; }
.te-wfbox__handle--r { right: 14px; }
.te-wfbox__marker {
  position: absolute; top: 4px; bottom: 16px;
  pointer-events: none;
  z-index: 3;
}
.te-wfbox__pin {
  position: absolute; top: 16px; bottom: 0; width: 2px;
  background: var(--accent); opacity: 0.8;
  left: 0;
}
.te-wfbox__lbl {
  position: absolute; top: 0; left: -1px;
  padding: 1px 5px;
  background: var(--accent); color: #fff;
  font: 700 9px/1 "Inter", sans-serif;
  letter-spacing: 0.06em;
  border-radius: 3px;
  white-space: nowrap;
}
.te-wfbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.te-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); cursor: pointer;
  margin-left: auto;
}
.te-toggle input { accent-color: var(--accent); }
.te-leg__sw--hot { background: color-mix(in oklch, var(--accent) 60%, var(--text-3)); box-shadow: 0 0 4px color-mix(in oklch, var(--accent) 70%, transparent); }

/* Stems v2 -------------------------------------------------- */
.te-dropzone {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 13px;
  transition: border-color 120ms, background 120ms;
}
.te-dropzone.is-on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, var(--bg-2)); color: var(--text); }
.te-dropzone strong { color: var(--text); margin-right: 4px; }

.te-stemlist { display: flex; flex-direction: column; gap: 6px; }
.te-stemrow {
  display: grid;
  grid-template-columns: 28px 1fr 120px auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-stemrow__play {
  width: 24px; height: 24px;
  border-radius: 50%; border: 0;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.te-stemrow__play:hover { filter: brightness(1.1); }
.te-stemrow__name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.te-stemrow__meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.te-stem-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* Markers v2 ------------------------------------------------ */
.te-mkbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.te-mktrack {
  position: relative;
  height: 90px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 16px 12px;
  cursor: crosshair;
  user-select: none;
  margin-bottom: 12px;
}
.te-mktrack__bars { position: absolute; inset: 16px 12px; display: flex; align-items: center; gap: 1px; pointer-events: none; }
.te-mktrack__bar { flex: 1; min-width: 1px; background: var(--text-3); opacity: 0.4; border-radius: 1px; min-height: 3px; }
.te-mkpin {
  position: absolute; top: 0; bottom: 0;
  cursor: grab;
  display: flex; flex-direction: column; align-items: center;
}
.te-mkpin.is-drag { cursor: grabbing; z-index: 5; }
.te-mkpin__head {
  position: absolute; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-2);
  margin-left: -5px;
}
.te-mkpin__stem {
  position: absolute; top: 18px; bottom: 8px;
  width: 1.5px;
  background: var(--accent);
  opacity: 0.7;
}
.te-mkpin__lbl {
  position: absolute; top: -2px; left: 8px;
  padding: 2px 6px;
  font: 700 9px/1 "Inter", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent); color: #fff;
  border-radius: 3px;
  white-space: nowrap;
}
.te-mkpin--intro .te-mkpin__head, .te-mkpin--intro .te-mkpin__stem, .te-mkpin--intro .te-mkpin__lbl { background: oklch(0.65 0.16 240); }
.te-mkpin--verse .te-mkpin__head, .te-mkpin--verse .te-mkpin__stem, .te-mkpin--verse .te-mkpin__lbl { background: oklch(0.66 0.16 200); }
.te-mkpin--hook .te-mkpin__head, .te-mkpin--hook .te-mkpin__stem, .te-mkpin--hook .te-mkpin__lbl { background: oklch(0.72 0.18 70); }
.te-mkpin--drop .te-mkpin__head, .te-mkpin--drop .te-mkpin__stem, .te-mkpin--drop .te-mkpin__lbl { background: oklch(0.66 0.20 25); }
.te-mkpin--bridge .te-mkpin__head, .te-mkpin--bridge .te-mkpin__stem, .te-mkpin--bridge .te-mkpin__lbl { background: oklch(0.65 0.16 320); }
.te-mkpin--outro .te-mkpin__head, .te-mkpin--outro .te-mkpin__stem, .te-mkpin--outro .te-mkpin__lbl { background: oklch(0.55 0.05 220); }

/* Markers list rows have grid w/ trash btn col */
.te-mk { grid-template-columns: 56px 1fr 110px auto; }

/* Legal v2 -------------------------------------------------- */
.te-clearance {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-bottom: 8px;
}
.te-clearance__pill {
  cursor: pointer;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.te-clearance__pill.is-on { box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 60%, transparent); }

.te-chain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.te-chain::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 1.5px; background: var(--line); }
.te-chain__row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 0;
  font-size: 12px;
}
.te-chain__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); margin-left: -1.5px; }
.te-chain__row strong { color: var(--text); margin-right: 6px; font-weight: 600; }
.te-chain__row em { font-style: normal; color: var(--text-2); }
.te-chain__when { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* Splits progress bar --------------------------------------- */
.te-splits-prog { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.te-splits-prog__bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  display: flex;
}
.te-splits-prog__seg { display: block; height: 100%; transition: width 240ms cubic-bezier(.2,.8,.2,1); }
.te-splits-prog__empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--text-3); text-transform: uppercase;
}
.te-splits-prog__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* GPU Stems Progress (fits Track Editor vibe) ---------------- */
.te-gpu-progress {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.te-gpu-progress__bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.te-gpu-progress__fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    #8b5cf6 0%,
    #a78bfa 40%,
    #c4b5fd 50%,
    #a78bfa 60%,
    #8b5cf6 100%
  );
  background-size: 200% 100%;
  transition: width 220ms cubic-bezier(.2, .8, .2, 1);
  border-radius: 999px;
  box-shadow: 
    0 0 8px rgba(139, 92, 246, 0.5),
    0 0 16px rgba(139, 92, 246, 0.25);
  animation: te-gpu-shimmer 1.8s linear infinite;
}

@keyframes te-gpu-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.te-gpu-progress__text {
  font-size: 11.5px;
  font-weight: 600;
  color: #a78bfa;
  letter-spacing: 0.01em;
}
.te-gpu-progress__note {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.3;
}

/* Lyrics v2 ------------------------------------------------- */
.te-lyric-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.te-lyric-actions { display: inline-flex; align-items: center; gap: 6px; }
.te-lyrics { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.te-lyrics__line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: background 120ms, color 120ms;
}
.te-lyrics__line:hover { background: var(--bg-2); color: var(--text); }
.te-lyrics__line.is-active {
  background: color-mix(in oklch, var(--accent) 12%, var(--bg-2));
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.te-lyrics__line.is-hl .te-lyrics__txt { color: var(--text); }
.te-lyrics__t {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; color: var(--text-3);
}
.te-lyrics__txt { font-weight: 500; line-height: 1.35; }
.te-lyrics__hl { color: var(--accent); display: inline-flex; }

/* Comments waveform ----------------------------------------- */
.te-cmtwf {
  position: relative;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.te-cmtwf__bars { position: absolute; inset: 10px 12px; display: flex; align-items: center; gap: 1px; }
.te-cmtwf__bar { flex: 1; min-width: 1px; background: var(--text-3); opacity: 0.5; border-radius: 1px; }
.te-cmtwf__pin { position: absolute; top: -8px; bottom: 0; cursor: pointer; }
.te-cmtwf__head {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font: 700 11px/1 "Inter", sans-serif;
  margin-left: -11px;
  box-shadow: 0 0 0 2px var(--bg-2);
}
.te-cmtwf__pin::after {
  content: "";
  position: absolute; top: 22px; bottom: 0; left: -1px;
  width: 1.5px; background: var(--accent); opacity: 0.6;
}

/* Versions -------------------------------------------------- */
.te-versions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.te-version {
  display: grid;
  grid-template-columns: 24px 1fr 120px auto auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-version.is-current { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, var(--bg-2)); }
.te-version__play, .te-stemrow__play { cursor: pointer; }
.te-version__play:hover, .te-stemrow__play:hover { filter: brightness(1.12); transform: scale(1.06); }
.te-version__play:active, .te-stemrow__play:active { transform: scale(0.94); }
.te-version__play {
  width: 24px; height: 24px; border-radius: 50%; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, filter .12s ease;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.te-version__lbl { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.te-version__cur {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.te-version__sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Share ----------------------------------------------------- */
.te-shlinks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.te-shlink {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.te-shlink__who { font-size: 13px; font-weight: 600; color: var(--text); }
.te-shlink__sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.te-shlink__wm {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--accent);
}
.te-shlink__views { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.te-shlink__views strong { font-size: 16px; font-weight: 600; color: var(--text); font-family: "JetBrains Mono", ui-monospace, monospace; }
.te-shlink__views span { font-size: 9px; font-weight: 700; letter-spacing: 0.10em; color: var(--text-3); text-transform: uppercase; }
.te-mini--danger { color: oklch(0.66 0.18 25); }
.te-share-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* History --------------------------------------------------- */
.te-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.te-history__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.te-history__row:hover { background: var(--bg-2); }
.te-history__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 50%, var(--text-3)));
  color: #fff; font: 700 11px/1 "Inter", sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
}
.te-history__main strong { font-weight: 600; color: var(--text); margin-right: 4px; }
.te-history__when {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* Buttons --------------------------------------------------- */
.te-btn--sm { padding: 4px 8px; font-size: 11px; }
.te-btn--save .te-aibtn__ico { display: inline-flex; }
}


/* ============================================================
   ANALYTICS TAB (Track > Insights)
   ============================================================ */
.te-pane--analytics { gap: 18px; }

/* Paywall (free/starter/pro see this instead of Insights content) */
.ta-paywall {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 28px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(124,92,255,.05), rgba(124,92,255,.02) 60%, transparent);
  position: relative; overflow: hidden;
}
.ta-paywall::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background: radial-gradient(600px 240px at 80% -20%, rgba(124,92,255,.18), transparent 60%);
}
.ta-paywall__badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  font: 600 10.5px/1 ui-sans-serif, system-ui; letter-spacing: .14em;
  background: linear-gradient(180deg, #1a1a20, #0a0a0e);
  color: #f5f3ee; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  position: relative; z-index: 1;
}
.ta-paywall__title { font: 600 18px/1.2 ui-sans-serif, system-ui; color: var(--fg); position: relative; z-index: 1; }
.ta-paywall__sub { font-size: 13px; line-height: 1.55; color: var(--fg-2); max-width: 540px; position: relative; z-index: 1; }
.ta-paywall__bullets { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--fg-2); position: relative; z-index: 1; padding: 4px 0 6px; }
.ta-paywall__cta {
  appearance: none; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: #0a0a0e;
  font: 600 13px/1 ui-sans-serif, system-ui;
  position: relative; z-index: 1;
  transition: filter .12s ease, transform .08s ease;
}
.ta-paywall__cta:hover { filter: brightness(1.08); }
.ta-paywall__cta:active { transform: scale(.98); }
.ta-paywall__foot { font-size: 11.5px; color: var(--fg-3); position: relative; z-index: 1; }
.ta-paywall__foot strong { color: var(--fg-2); font-weight: 600; }
.te-pane--analytics .ta-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  padding: 18px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.ta-section__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.ta-section__title { font-size: 14px; font-weight: 600; color: var(--text); }
.ta-section__sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.45; }

/* STAT GRID */
.ta-statgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.ta-stat {
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.ta-stat--prim {
  background: linear-gradient(155deg, color-mix(in oklch, var(--accent) 14%, var(--bg-2)) 0%, var(--bg-2) 100%);
  border-color: color-mix(in oklch, var(--accent) 40%, var(--line));
}
.ta-stat__lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-3); text-transform: uppercase;
}
.ta-stat__v {
  font: 600 26px/1 "Inter", system-ui, sans-serif;
  color: var(--text); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.ta-stat--prim .ta-stat__v { color: var(--accent); }
.ta-stat__sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.ta-stat__bar {
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--text-3) 18%, transparent);
  overflow: hidden;
}
.ta-stat__bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, color-mix(in oklch, var(--accent) 60%, white) 100%);
  border-radius: 999px;
}
.ta-trend--up { color: oklch(0.74 0.14 145); font-weight: 600; }
.ta-trend--down { color: oklch(0.66 0.18 25); font-weight: 600; }

/* HEATMAP */
.ta-legend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--text-3); letter-spacing: 0.04em;
}
.ta-legend__sw {
  width: 10px; height: 10px; border-radius: 2px;
  display: inline-block;
}
.ta-legend__sw--cold { background: oklch(0.50 0.04 230); }
.ta-legend__sw--hot { background: oklch(0.70 0.22 30); }
.ta-legend__bar {
  width: 60px; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, oklch(0.50 0.04 230), oklch(0.62 0.12 130), oklch(0.70 0.22 30));
}

.ta-heat {
  display: flex; align-items: flex-end;
  gap: 1.5px;
  height: 76px;
  padding: 4px 0;
}
.ta-heat__bar {
  flex: 1; min-width: 1px;
  border: 0; padding: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 100ms, box-shadow 100ms;
}
.ta-heat__bar:hover {
  transform: scaleY(1.06);
  box-shadow: 0 0 8px color-mix(in oklch, var(--accent) 40%, transparent);
}
.ta-heat__bar.is-peak {
  box-shadow: 0 0 10px color-mix(in oklch, var(--accent) 70%, transparent);
}
.ta-heat__axis {
  display: flex; justify-content: space-between;
  font: 500 10px/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-3);
  padding: 0 2px;
}
.ta-heat__hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-2);
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--accent) 6%, transparent);
  border: 1px dashed color-mix(in oklch, var(--accent) 25%, var(--line));
  align-self: flex-start;
}

/* SPARK / TIMELINE */
.ta-spark {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  align-items: end;
  height: 86px;
}
.ta-spark__col {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; height: 100%;
  justify-content: flex-end;
}
.ta-spark__bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), color-mix(in oklch, var(--accent) 50%, transparent));
  border-radius: 4px 4px 2px 2px;
  min-height: 2px;
}
.ta-spark__lbl {
  font: 600 9px/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-3); letter-spacing: 0.04em;
  white-space: nowrap;
  height: 12px;
}

/* GEO MAP */
.ta-geo {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.ta-geo__map {
  border-radius: 12px;
  background:
    radial-gradient(ellipse at center, color-mix(in oklch, var(--accent) 5%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, oklch(0.16 0.02 240) 0%, oklch(0.12 0.02 240) 100%);
  border: 1px solid var(--line);
  padding: 0;
  min-height: 280px;
  overflow: hidden;
  position: relative;
}
.ta-geo__map::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.5);
  border-radius: 12px;
}
.ta-geo__map svg { width: 100%; height: 100%; min-height: 280px; display: block; }
.ta-geo__list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.ta-geo__row {
  display: grid;
  grid-template-columns: 22px 1fr 70px 38px 32px;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  transition: background 120ms;
}
.ta-geo__row:hover { background: var(--bg-2); }
.ta-geo__rank {
  font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-3); letter-spacing: 0.06em;
}
.ta-geo__bar { position: relative; height: 4px; background: color-mix(in oklch, var(--text-3) 15%, transparent); border-radius: 999px; overflow: hidden; }
.ta-geo__bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ta-geo__city { color: var(--text); font-weight: 500; }
.ta-geo__pct { color: var(--text-2); font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; text-align: right; }
.ta-geo__plays { color: var(--text-3); font: 500 11px/1 "JetBrains Mono", ui-monospace, monospace; text-align: right; }

/* RECIPIENTS */
.ta-recips {
  display: flex; flex-direction: column;
  gap: 6px;
}
.ta-recip {
  display: grid;
  grid-template-columns: 36px 1fr 70px 160px 80px;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.ta-recip:hover { border-color: color-mix(in oklch, var(--accent) 25%, var(--line)); }
.ta-recip__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font: 700 12px/1 "Inter", sans-serif;
}
.ta-recip__main { min-width: 0; }
.ta-recip__name {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
}
.ta-recip__sub {
  font-size: 11px; color: var(--text-3); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ta-recip__ip { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--text-2); }
.ta-recip__plays {
  display: flex; flex-direction: column; align-items: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.ta-recip__plays strong { font: 600 16px/1 "Inter", sans-serif; color: var(--text); }
.ta-recip__plays span { font-size: 9px; color: var(--text-3); letter-spacing: 0.10em; text-transform: uppercase; margin-top: 4px; }
.ta-recip__complete { display: flex; flex-direction: column; gap: 5px; }
.ta-recip__cbar {
  height: 4px; border-radius: 999px;
  background: color-mix(in oklch, var(--text-3) 18%, transparent);
  overflow: hidden;
}
.ta-recip__cbar > span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.ta-recip__complete > span { font-size: 10px; color: var(--text-3); font-family: "JetBrains Mono", ui-monospace, monospace; }
.ta-recip__last {
  font-size: 11px; color: var(--text-3);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  text-align: right;
}
.ta-recip__pulse {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
  animation: ta-pulse 2.4s ease-in-out infinite;
}
.ta-recip__pulse--hot { background: oklch(0.74 0.14 145); box-shadow: 0 0 0 0 oklch(0.74 0.14 145); }
.ta-recip__pulse--engaged { background: oklch(0.72 0.16 70); }
.ta-recip__pulse--cool { background: oklch(0.55 0.05 220); animation: none; }
.ta-recip__pulse--cold { background: oklch(0.45 0.02 230); animation: none; }
@keyframes ta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 4px transparent; opacity: 0.7; }
}

@media (max-width: 880px) {
  .ta-statgrid { grid-template-columns: repeat(3, 1fr); }
  .ta-geo { grid-template-columns: 1fr; }
  .ta-recip { grid-template-columns: 32px 1fr 60px; }
  .ta-recip__complete, .ta-recip__last, .ta-recip__plays { display: none; }
}
