/* ============ base ============ */
:root {
  --bg: #050505;
  --sidebar-bg: #0a0a0a;
  --panel-bg: #111112;
  --card-bg: #1a1a1c;
  --card-bg-2: #202023;
  --border: #29292c;
  --border-soft: #202022;
  --text: #f2f2f2;
  --text-dim: #9b9b9f;
  --text-faint: #6d6d72;
  --gold: #e3b341;
  --blue: #38b6f1;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font-family: inherit; }

#app { display: flex; height: 100vh; }

/* ============ sidebar ============ */
.sidebar {
  width: 284px;
  min-width: 284px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  position: relative;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #1c1c1e; color: var(--text); }
.icon-btn.round { border-radius: 50%; background: #232326; width: 38px; height: 38px; }
.icon-btn.round:hover { background: #2c2c30; }

.team-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 6px 16px;
  color: var(--text);
}
.team-switcher svg { color: var(--text-dim); }

.promo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #7a6224;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(227,179,65,.05), rgba(227,179,65,.02));
  cursor: pointer;
}
.promo-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d478, #d9a832);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.promo-title { font-size: 13.5px; font-weight: 600; }
.promo-timer { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #d6d6d8;
  text-align: left;
  transition: background .15s;
}
.nav-item svg { color: #b9b9bd; }
.nav-item:hover { background: #161618; }
.nav-item.active { background: #232326; color: #fff; }

.side-divider { height: 1px; background: var(--border-soft); margin: 14px 4px; }

.new-folder { color: #d6d6d8; }

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
}

.credits-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1c;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #dedee0;
}
.help-btn { border: 1px solid var(--border-soft); border-radius: 50%; }

/* ============ main panel ============ */
.main-panel {
  flex: 1;
  padding: 14px 14px 14px 0;
  min-width: 0;
  display: flex;
}

.view {
  display: none;
  flex: 1;
  position: relative;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.view.active { display: block; }

/* ---------- home ---------- */
.view-home { overflow-y: auto; }

.home-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 340px;
  pointer-events: none;
  background:
    radial-gradient(58% 130% at 18% -35%, rgba(43,120,178,.55), transparent 62%),
    radial-gradient(55% 130% at 55% -40%, rgba(120,80,90,.5), transparent 65%),
    radial-gradient(50% 130% at 88% -30%, rgba(198,120,58,.55), transparent 60%);
}
.home-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 118%, rgba(17,17,18,1) 40%, rgba(17,17,18,0) 78%);
}

.get-max-btn {
  position: absolute;
  top: 22px; right: 26px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(20,18,14,.55);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
}
.get-max-btn:hover { background: rgba(35,32,25,.7); }

.home-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 20px 60px;
}

.home-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.home-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 22px;
}
.home-subtitle { font-size: 15.5px; color: var(--text-dim); }

/* mode dropdown */
.mode-select { position: relative; }
.mode-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #232327;
  border: 1px solid #2e2e33;
  padding: 11px 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
}
.mode-btn:hover { background: #29292e; }
.mode-btn svg { color: var(--text-dim); }

.mode-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 262px;
  background: #131315;
  border: 1px solid #2a2a2e;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  display: none;
  z-index: 30;
}
.mode-menu.open { display: block; }

.mode-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
}
.mode-option:hover { background: #202024; }
.mo-title { font-size: 13.5px; font-weight: 600; }
.mo-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.mode-option .check { visibility: hidden; }
.mode-option.selected .check { visibility: visible; }
.mode-menu-divider { height: 1px; background: #232327; margin: 5px 8px; }

/* import card */
.import-card {
  background: #161618;
  border: 1px solid #242427;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.dropzone {
  border: 1.5px dashed #333338;
  border-radius: 13px;
  background: #131315;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: #4b4b52; background: #17171a; }

.dz-inner { text-align: center; }

.dz-icon { position: relative; width: 74px; height: 74px; margin: 0 auto 26px; }
.dz-card-back {
  position: absolute;
  width: 52px; height: 66px;
  border-radius: 9px;
  background: #232326;
  transform: rotate(-10deg) translate(-6px, 4px);
  left: 8px; top: 2px;
}
.dz-card-front {
  position: absolute;
  width: 56px; height: 70px;
  border-radius: 10px;
  background: #37373b;
  left: 16px; top: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.dz-title { font-size: 14.5px; font-weight: 600; }
.dz-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

.import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 4px;
}
.ia-left { display: flex; align-items: center; gap: 10px; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #232326;
  border: 1px solid #2c2c30;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}
.pill-btn:hover { background: #2b2b2f; }
.pill-btn.small { padding: 7px 12px; font-size: 12px; }

.create-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6d6d72;
  background: #1c1c1f;
  transition: all .2s;
}
.create-btn:not(:disabled) {
  color: #0b0b0c;
  background: #f2f2f2;
}
.create-btn:not(:disabled):hover { background: #fff; }
.create-btn:disabled { cursor: default; }

/* style grid */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.style-card {
  position: relative;
  aspect-ratio: 9 / 14;
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, border-color .18s;
}
.style-card:hover { transform: translateY(-3px); border-color: #3a3a40; }
.style-card.selected { border-color: #f2f2f2; }

.style-thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.style-sample {
  text-align: center;
  line-height: 1.15;
  word-break: break-word;
}

.style-card .style-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 12px 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.72));
}

/* ---------- avatars ---------- */
.view-avatars, .view-search { display: none; flex-direction: column; }
.view-avatars.active, .view-search.active { display: flex; }

.page-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border-soft);
}
.page-header h2 { font-size: 17px; font-weight: 600; }

.avatars-body { padding: 22px 26px; overflow-y: auto; flex: 1; }

.avatars-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.chip-row { display: flex; gap: 8px; }
.chip {
  padding: 8px 15px;
  border-radius: 999px;
  background: #1c1c1f;
  border: 1px solid #26262a;
  font-size: 12.5px;
  font-weight: 500;
  color: #cfcfd2;
}
.chip:hover { background: #232327; }
.chip.active { background: #2b2b30; color: #fff; border-color: #3a3a40; }

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #06222f;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: filter .15s;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:disabled { opacity: .45; cursor: default; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.avatar-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  cursor: pointer;
}
.avatar-card:hover .avatar-face { transform: scale(1.04); }

.avatar-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease;
}
.avatar-initial {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  color: rgba(255,255,255,.92);
}

.avatar-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.65));
}
.avatar-name { font-size: 14px; font-weight: 600; }
.looks-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,.55);
  color: #e6e6e8;
}
.bookmark {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
  color: #fff;
  opacity: .85;
}

/* ---------- search ---------- */
.search-body { padding: 26px; flex: 1; overflow-y: auto; }
.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #1a1a1d;
  border: 1px solid #26262a;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-dim);
  max-width: 560px;
}
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.search-results { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.search-result-item {
  padding: 11px 14px;
  border-radius: 10px;
  background: #17171a;
  font-size: 13.5px;
  color: #d8d8da;
  display: flex;
  justify-content: space-between;
}
.search-result-item span:last-child { color: var(--text-faint); font-size: 12px; }

/* ---------- editor ---------- */
.view-editor { display: none; flex-direction: column; }
.view-editor.active { display: flex; }

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.project-name { font-size: 14px; font-weight: 600; flex: 1; }
.editor-top-actions { display: flex; align-items: center; gap: 12px; }
.free-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  color: #7fd77f;
  background: rgba(70,180,90,.12);
  border: 1px solid rgba(70,180,90,.3);
  padding: 5px 10px;
  border-radius: 999px;
}

/* export settings popover */
.export-wrap { position: relative; }
.export-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #131315;
  border: 1px solid #2a2a2e;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 55px rgba(0,0,0,.6);
  z-index: 40;
  display: none;
}
.export-panel.open { display: block; }
.ep-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.ep-group { margin-bottom: 14px; }
.ep-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); margin-bottom: 8px; }
.ep-seg { display: flex; gap: 6px; }
.ep-seg button {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  background: #1d1d20;
  border: 1px solid #2a2a2e;
  color: #cfcfd2;
  font-size: 12px;
  font-weight: 600;
}
.ep-seg button:hover { background: #232327; }
.ep-seg button.on { background: #f2f2f2; color: #0b0b0c; border-color: #f2f2f2; }
.ep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #222226;
}
.ep-est { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.editor-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.editor-col { display: flex; flex-direction: column; min-height: 0; }

.col-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--text-faint); }

/* left styles column */
.styles-col {
  width: 218px;
  min-width: 218px;
  border-right: 1px solid var(--border-soft);
  padding: 16px 12px;
}
.styles-col .col-title { padding: 0 6px 12px; }

.style-list {
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 2px 2px 16px;
}

.style-tile {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  overflow: hidden;
  padding: 6px;
}
.style-tile:hover { filter: brightness(1.15); }
.style-tile.selected { border-color: #f2f2f2; }
.style-tile .tile-sample { font-size: 13px; line-height: 1.05; text-align: center; }
.style-tile .tile-name { font-size: 10px; color: rgba(255,255,255,.75); font-weight: 600; font-family: "Inter", sans-serif; }

/* center player column */
.player-col {
  flex: 1;
  align-items: center;
  padding: 22px 20px 16px;
  overflow-y: auto;
}

.player-frame {
  position: relative;
  height: min(62vh, 560px);
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,.5);
}
.player-frame video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.caption-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.caption-text {
  position: absolute;
  max-width: 86%;
  text-align: center;
  transform: translateY(-50%);
  transition: opacity .12s;
}
.caption-text .w { display: inline-block; margin: 0 .14em; }

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,5,6,.82);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
  z-index: 5;
}
.player-overlay.visible { display: flex; }
.overlay-text { font-size: 14px; font-weight: 600; }
.overlay-sub { font-size: 12px; color: var(--text-dim); max-width: 240px; }

.spinner {
  width: 30px; height: 30px;
  border: 3px solid #2c2c30;
  border-top-color: #f2f2f2;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-controls {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  max-width: 480px;
  margin-top: 16px;
}
.scrubber {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #2a2a2e;
  cursor: pointer;
  position: relative;
}
.scrub-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: #f2f2f2;
}
.time-label { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

.caption-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  background: #161619;
  border: 1px solid #222226;
  padding: 10px 16px;
  border-radius: 12px;
}
.cc-field { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-dim); }
.cc-field input[type="range"] { width: 90px; accent-color: #f2f2f2; }
.cc-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.cc-toggle input { accent-color: #f2f2f2; }
.cc-select {
  background: #202024;
  border: 1px solid #2c2c30;
  border-radius: 8px;
  color: #e4e4e6;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
}
.cc-select:focus { border-color: #3a3a42; }
#musicBtn.active { background: #2a2f24; border-color: #4a5a34; color: #cfe89a; }

/* transcript tools */
.transcript-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 12px;
}
.tool-stat { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ti-text .filler { color: #ff8b7a; text-decoration: line-through; opacity: .7; }

/* right transcript column */
.transcript-col {
  width: 320px;
  min-width: 320px;
  border-left: 1px solid var(--border-soft);
  padding: 16px 14px;
}
.col-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  gap: 8px;
}
.col-title-actions { display: flex; align-items: center; gap: 6px; }
.col-title-actions .pill-btn.small { padding: 6px 10px; }

/* export panel: action buttons (subtitle downloads) */
.ep-actions button:hover { background: #2b2f36; border-color: #3a4350; color: #cfe0ff; }
.ep-actions button:active { transform: scale(.96); }
.transcript-lang {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 2px 12px;
}
.transcript-lang .cc-field span { font-weight: 500; }

.transcript-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  padding: 0 2px 12px;
}
.transcript-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
}
.transcript-item {
  background: #17171a;
  border: 1px solid #202024;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
}
.transcript-item:hover { border-color: #2e2e33; }
.transcript-item.current { border-color: #4a4a52; background: #1d1d21; }
.ti-time { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; margin-bottom: 4px; display: flex; justify-content: space-between; }
.ti-time button { color: var(--text-faint); font-size: 10.5px; }
.ti-time button:hover { color: #ff7b72; }
.ti-text {
  font-size: 13px;
  color: #e4e4e6;
  line-height: 1.45;
  outline: none;
  border-radius: 4px;
}
.ti-text:focus { background: #232328; }

.transcript-add { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.transcript-add input {
  flex: 1;
  background: #1a1a1d;
  border: 1px solid #26262a;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.transcript-add input:focus { border-color: #3a3a42; }

/* toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #232327;
  border: 1px solid #333338;
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2b2b2f; border-radius: 99px; border: 2px solid var(--panel-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* responsive-ish */
@media (max-width: 1180px) {
  .style-grid { grid-template-columns: repeat(3, 1fr); }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .transcript-col { width: 270px; min-width: 270px; }
}
@media (max-width: 980px) {
  .sidebar { display: none; }
  .main-panel { padding: 10px; }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(3, 1fr); }
  .styles-col { display: none; }
}

/* ---------- record view ---------- */
.view-record { display: none; flex-direction: column; }
.view-record.active { display: flex; }

.record-body { flex: 1; display: flex; min-height: 0; }

.record-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 18px;
}

.record-frame {
  position: relative;
  height: min(64vh, 580px);
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,.5);
}
.record-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.record-frame.mirror video { transform: scaleX(-1); }

.cam-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  background: #0d0d0f;
}
.cam-placeholder.hidden { display: none; }
.cam-ph-text { font-size: 14px; font-weight: 600; color: #cfcfd2; margin-top: 8px; }
.cam-ph-sub { font-size: 12px; color: var(--text-faint); }

.teleprompter {
  position: absolute;
  left: 0; right: 0; top: 12%;
  height: 46%;
  overflow: hidden;
  padding: 0 22px;
  display: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.teleprompter.on { display: block; }
.tele-scroll {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
  will-change: transform;
}

.rec-indicator {
  position: absolute;
  top: 14px; left: 14px;
  display: none;
  align-items: center;
  gap: 7px;
  background: rgba(0,0,0,.55);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.rec-indicator.on { display: flex; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4a4a; animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: .3; } }

.record-controls {
  display: flex;
  align-items: center;
  gap: 26px;
}
.rec-shutter {
  width: 66px; height: 66px;
  border-radius: 50%;
  border: 4px solid #fff;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  transition: transform .12s;
}
.rec-shutter:disabled { opacity: .4; }
.rec-shutter:not(:disabled):active { transform: scale(.94); }
.shutter-inner {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #ff4a4a;
  transition: all .18s;
}
.rec-shutter.recording .shutter-inner {
  width: 26px; height: 26px;
  border-radius: 7px;
}

.record-side {
  width: 360px;
  min-width: 360px;
  border-left: 1px solid var(--border-soft);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tele-input {
  flex: 1;
  min-height: 180px;
  background: #141416;
  border: 1px solid #242427;
  border-radius: 12px;
  color: #e8e8ea;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  resize: none;
  outline: none;
}
.tele-input:focus { border-color: #3a3a42; }
.tele-row { display: flex; align-items: center; gap: 20px; }
.tele-hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* caption entrance animations (applied to whole caption element) */
.caption-text.anim-pop { animation: cap-pop .32s cubic-bezier(.2,1.3,.4,1) both; }
.caption-text.anim-bounce { animation: cap-bounce .5s cubic-bezier(.2,1.5,.3,1) both; }
.caption-text.anim-fadeup { animation: cap-fadeup .35s ease both; }
@keyframes cap-pop { from { transform: translateY(-50%) scale(.6); opacity: 0; } to { transform: translateY(-50%) scale(1); opacity: 1; } }
@keyframes cap-bounce { 0% { transform: translateY(-30%) scale(.7); opacity: 0; } 60% { transform: translateY(-58%) scale(1.06); } 100% { transform: translateY(-50%) scale(1); opacity: 1; } }
@keyframes cap-fadeup { from { transform: translateY(-30%); opacity: 0; } to { transform: translateY(-50%); opacity: 1; } }

@media (max-width: 1180px) {
  .record-side { width: 300px; min-width: 300px; }
}
@media (max-width: 980px) {
  .record-side { display: none; }
}
