/* ─── podcli — Shared Styles ─── */

:root {
  --bg: #0f0e0d;
  --bg2: #16150f;
  --surface: #141210;
  --surface2: #191612;
  --surface3: #241f18;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #f4f2ee;
  --text2: #ada79c;
  --text3: #8a8377;
  --accent: #d97631;
  --accent-hover: #df8d53;
  --accent-2: #e6a476;
  --accent-edge: #ad5a20;
  --accent-subtle: rgba(217, 118, 49, 0.14);
  --accent-dim: rgba(217, 118, 49, 0.10);
  --accent-glow: rgba(217, 118, 49, 0.30);
  --green: #4ade80;
  --green-subtle: rgba(74, 222, 128, 0.09);
  --green-border: rgba(74, 222, 128, 0.22);
  --red: #f87171;
  --red-subtle: rgba(248, 113, 113, 0.09);
  --red-border: rgba(248, 113, 113, 0.22);
  --blue: #60a5fa;
  --blue-subtle: rgba(96, 165, 250, 0.10);
  --blue-border: rgba(96, 165, 250, 0.22);
  --yellow: #facc15;
  --amber: #fbbf24;
  --glass-bg: rgba(22, 21, 15, 0.6);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #000; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Landing patterns: glass surfaces ─── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--glass-border), 0 8px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 var(--glass-hi);
}
.glass-hover { transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .glass-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
      0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-hi);
  }
}
.img-outline { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }

/* ─── Layout ─── */
.app { max-width: 1080px; margin: 0 auto; padding: 48px 32px 96px; }
.header { margin-bottom: 36px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 8px; min-height: 24px; flex-wrap: wrap; }
.page-back { margin-bottom: 8px; }
.logo { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; color: var(--text3); margin-bottom: 10px; text-transform: uppercase; text-decoration: none; }
.logo span { color: var(--accent); }
h1 { font-size: 28px; font-weight: 700; letter-spacing: 0; line-height: 1.15; }
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.main-col { min-width: 0; }
.preview-col { position: relative; align-self: stretch; }

/* ─── Content preview (YouTube-style card) ─── */
.yt-card { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; max-width: 400px; }
.yt-thumb {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; position: relative;
  background: radial-gradient(125% 125% at 22% 12%, #4a3421, #221a12 58%, #120f0c);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  display: flex; align-items: flex-end; padding: 15px;
}
.yt-thumb.vertical { aspect-ratio: 9 / 16; max-width: 216px; }
.yt-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 55%);
}
.yt-thumb-title {
  position: relative; z-index: 1; font-weight: 800; font-size: 21px; line-height: 1.12;
  letter-spacing: -0.01em; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5); text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.yt-thumb.vertical .yt-thumb-title { font-size: 18px; -webkit-line-clamp: 5; }
.yt-thumb-title.placeholder { color: rgba(255, 255, 255, 0.4); font-weight: 600; }

/* ─── Preview Panel ─── */
.preview-panel { position: sticky; top: 32px; }
.preview-player {
  background: #000; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.preview-player video {
  width: 100%; display: block; background: #000;
}
.preview-player video.vertical {
  max-height: 480px; width: auto; margin: 0 auto;
}
.preview-empty {
  aspect-ratio: 16/9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text3); font-size: 13px;
}
.preview-empty .pe-icon { font-size: 28px; opacity: 0.3; }

/* ─── Style Preview (vertical phone mockup) ─── */
.style-preview {
  aspect-ratio: 9/16; width: 100%;
  background: #111114; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  position: relative; user-select: none;
}
.style-preview .sp-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 35% 30%, rgba(80,60,40,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 65% 55%, rgba(50,50,70,0.12) 0%, transparent 50%),
    linear-gradient(180deg, #16161a 0%, #111114 100%);
}
.style-preview .sp-person {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  width: 55%; aspect-ratio: 3/4;
  background: radial-gradient(ellipse at 50% 35%, rgba(140,120,100,0.15) 0%, rgba(80,70,60,0.06) 60%, transparent 80%);
  border-radius: 50% 50% 44% 44%;
}
.style-preview .sp-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
  pointer-events: none;
}
.style-preview .sp-captions {
  position: absolute; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 20px; text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), top 0.3s var(--ease);
}
.style-preview .sp-word {
  display: inline;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.style-preview .sp-logo {
  position: absolute; top: 14px; left: 14px;
  width: 32px; height: 32px; border-radius: 7px;
  overflow: hidden;
}
.preview-clip-range {
  padding: 8px 12px; background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
  display: flex; align-items: center; justify-content: space-between;
}
.preview-clip-range .clip-name {
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px;
}
.preview-back {
  padding: 0; background: none; border: none; color: var(--accent);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.preview-back:hover { opacity: 0.7; }
.preview-settings {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px;
}
.preview-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 11px; color: var(--text2); font-weight: 500;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.preview-tag strong { color: var(--text); font-weight: 600; text-transform: capitalize; }
.preview-tag.changed { border-color: var(--accent); background: var(--accent-subtle); }

/* ─── Live Phone Preview ─── */
.phone-frame {
  width: 100%; max-width: 280px; margin: 0 auto;
  aspect-ratio: 9/16; position: relative;
  background: #000; border-radius: 28px;
  border: 8px solid #1a1a1a;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
}
.phone-frame video,
.phone-frame .phone-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
}
.phone-frame .phone-notch {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 22px; background: #000;
  border-radius: 100px; z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.phone-frame .phone-caption {
  position: absolute; left: 10px; right: 10px;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 8px; text-align: center; pointer-events: none;
  font-family: Arial, Helvetica, sans-serif; line-height: 1.3;
  z-index: 2;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), bottom 0.2s var(--ease), top 0.2s var(--ease);
  max-height: 32%;  /* never grow beyond the lower-third caption zone */
  overflow: hidden;
}
.phone-frame .phone-caption .pc-word {
  display: inline;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.phone-frame .phone-gradient {
  position: absolute; inset: auto 0 0 0; height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 45%, transparent 100%);
  pointer-events: none; z-index: 1;
}
.phone-frame .phone-logo {
  position: absolute; top: 28px; left: 12px; width: 28px; height: 28px;
  border-radius: 6px; overflow: hidden; z-index: 3;
  background: rgba(0,0,0,0.5);
}
.phone-frame .phone-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: rgba(255,255,255,0.4); font-size: 11px; text-align: center; padding: 0 24px;
}

/* ─── TikTok Wireframe Overlay ─── */
.phone-frame .tt-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  color: rgba(255,255,255,0.95); font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.phone-frame .tt-top {
  position: absolute; top: 38px; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center; gap: 14px;
  font-size: 13px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.phone-frame .tt-top .tt-tab { opacity: 0.65; position: relative; padding-bottom: 4px; }
.phone-frame .tt-top .tt-tab.active { opacity: 1; }
.phone-frame .tt-top .tt-tab.active::after {
  content: ""; position: absolute; left: 25%; right: 25%; bottom: 0;
  height: 2px; border-radius: 2px; background: #fff;
}
.phone-frame .tt-top .tt-divider {
  width: 1px; height: 12px; background: rgba(255,255,255,0.4);
}
.phone-frame .tt-top .tt-following-dot {
  position: absolute; top: -2px; right: -6px;
  width: 5px; height: 5px; border-radius: 50%; background: #ff3b5c;
}
.phone-frame .tt-search {
  position: absolute; top: 38px; right: 12px;
  width: 18px; height: 18px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.55));
}

/* Right action rail */
.phone-frame .tt-rail {
  position: absolute; right: 8px; bottom: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.phone-frame .tt-rail .tt-action {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.75);
  color: #fff;
}
.phone-frame .tt-rail .tt-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.7));
}

/* Avatar with +follow badge */
.phone-frame .tt-rail .tt-avatar-wrap {
  position: relative; width: 34px; height: 34px; margin-bottom: 4px;
}
.phone-frame .tt-rail .tt-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #2a2a2a;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.phone-frame .tt-rail .tt-avatar svg {
  width: 22px; height: 22px; opacity: 0.45;
}
.phone-frame .tt-rail .tt-follow {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: #ff3b5c; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px; line-height: 1;
  border: 1.5px solid rgba(0,0,0,0); /* spacing illusion */
}

/* Music disc at bottom of rail */
.phone-frame .tt-rail .tt-disc {
  width: 32px; height: 32px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #555 0 5px, #1a1a1a 5px 14px, #2a2a2a 14px);
  border: 1.5px solid rgba(255,255,255,0.18);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  animation: tt-spin 6s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }

/* Bottom-left text block */
.phone-frame .tt-bottom {
  position: absolute; left: 12px; right: 56px; bottom: 42px;
  display: flex; flex-direction: column; gap: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7); color: #fff;
}
.phone-frame .tt-bottom .tt-handle {
  font-weight: 800; font-size: 12px; line-height: 1.2;
  letter-spacing: 0.3px;
}
.phone-frame .tt-bottom .tt-desc {
  font-size: 10.5px; line-height: 1.35;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.phone-frame .tt-bottom .tt-desc .tt-hash { color: #fff; }
.phone-frame .tt-bottom .tt-desc .tt-more { opacity: 0.7; font-weight: 600; margin-left: 2px; }
.phone-frame .tt-bottom .tt-translate {
  font-size: 10px; opacity: 0.55;
}
.phone-frame .tt-bottom .tt-music {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; opacity: 0.95; margin-top: 1px;
}
.phone-frame .tt-bottom .tt-music-note { font-size: 11px; line-height: 1; }

/* Bottom nav */
.phone-frame .tt-nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: center;
  height: 36px; padding: 0 6px;
  background: rgba(0,0,0,0.65);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.phone-frame .tt-nav .tt-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 8px; font-weight: 700; opacity: 0.78;
}
.phone-frame .tt-nav .tt-nav-item.active { opacity: 1; }
.phone-frame .tt-nav .tt-nav-icon { width: 18px; height: 18px; }
.phone-frame .tt-nav .tt-plus {
  width: 36px; height: 22px; border-radius: 6px;
  position: relative; display: flex; align-items: center; justify-content: center;
  background: #fff; color: #000;
  font-weight: 900; font-size: 14px; line-height: 1;
  box-shadow:
    -3px 0 0 #25f4ee,
    3px 0 0 #fe2c55;
}

/* Wireframe toggle button under the phone */
.preview-toggle-row {
  display: flex; justify-content: center; align-items: center;
  gap: 12px; margin-top: 10px; font-size: 11px; color: var(--text2);
}
.preview-toggle-row label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  user-select: none;
}
.preview-toggle-row input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent);
}

/* ─── Spec Recap Card ─── */
.spec-recap {
  margin-top: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 11px;
}
.spec-recap .sr-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px dashed var(--border);
}
.spec-recap .sr-row:last-child { border-bottom: none; }
.spec-recap .sr-key {
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; font-size: 10px;
}
.spec-recap .sr-val {
  color: var(--text); font-weight: 600; font-family: var(--font-mono);
  font-size: 11px; max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spec-recap .sr-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  border: 1px solid var(--border); margin-right: 6px; vertical-align: middle;
}

/* ─── Sections ─── */
.section { margin-bottom: 24px; }
.section.card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 40px -28px rgba(0, 0, 0, 0.9);
}
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--text2); margin-bottom: 10px; text-transform: uppercase; }
/* Muted helper / caption text. Reused instead of per-element inline font-size + color. */
.hint { font-size: 11px; color: var(--text3); line-height: 1.5; }
.hint-xs { font-size: 10px; color: var(--text3); line-height: 1.5; }
.meta { font-size: 12px; color: var(--text2); line-height: 1.5; }

/* ─── Form Elements ─── */
input[type="text"], input[type="number"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 14px;
  color: var(--text); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, input:not([type]):focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle);
}
input[type="text"]:focus-visible,
input[type="number"]:focus-visible,
input[type="password"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
textarea {
  font-size: 12px; resize: vertical; min-height: 120px; line-height: 1.7;
}
textarea.code-input {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
}
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23ada79c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ─── Buttons ─── */
.btn {
  padding: 10px 18px; border-radius: var(--radius); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  transition: transform 0.16s var(--ease-out), background 0.15s var(--ease), box-shadow 0.16s var(--ease-out), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
  display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary {
  background: var(--accent); color: #241803;
  box-shadow: 0 4px 0 0 var(--accent-edge), 0 10px 20px -6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn-primary:disabled { opacity: 0.25; cursor: not-allowed; }
.btn-ghost {
  background: var(--surface3); color: var(--text);
  box-shadow: 0 4px #1a1a1f, 0 11px 18px -5px #000000d9,
    0 0 0 1px #ffffff14, inset 0 1px #ffffff24;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface3); }
.btn-ghost:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger {
  background: var(--surface3); color: var(--text2);
  box-shadow: 0 4px #1a1a1f, 0 11px 18px -5px #000000d9,
    0 0 0 1px #ffffff14, inset 0 1px #ffffff24;
}
.btn-danger:hover:not(:disabled) { color: var(--red); box-shadow: 0 5px #1a1a1f, 0 11px 18px -5px #000000d9, 0 0 0 1px var(--red-border), inset 0 1px #ffffff24; }
.btn-danger:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 1px var(--red-border), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-go {
  width: 100%; padding: 14px; font-size: 15px; justify-content: center;
  background: var(--accent); color: #241803; border-radius: var(--radius);
  box-shadow: 0 5px 0 0 var(--accent-edge), 0 12px 22px -6px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-go:hover:not(:disabled) { background: var(--accent-hover); }
.btn-go:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn-go:disabled { opacity: 0.25; cursor: not-allowed; }
/* A button that's mid-request keeps its fill (not the disabled fade) so the label stays readable */
.btn:has(.spinner) { opacity: 1; cursor: progress; }
.btn-primary .spinner, .btn-go .spinner { border-color: rgba(36, 24, 3, 0.28); border-top-color: #241803; }
.title-option {
  text-align: left; width: 100%; padding: 9px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
  font-size: 13px; line-height: 1.4;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.title-option:hover { border-color: var(--accent); background: var(--accent-subtle); }
.title-option.selected { border-color: var(--accent); background: var(--accent-subtle); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-blue { background: var(--accent-subtle); color: var(--accent); }

/* ─── Drop Zone ─── */
.drop-zone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  position: relative; overflow: hidden;
}
.drop-zone:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.012); }
.drop-zone.drag-over { border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 0 0 4px var(--accent-subtle); }
.drop-zone.uploading { border-color: var(--accent); border-style: solid; pointer-events: none; }
.drop-zone .icon { font-size: 28px; margin-bottom: 8px; opacity: 0.35; line-height: 1; }
.drop-zone .label { font-size: 13px; color: var(--text2); line-height: 1.5; }
.drop-zone .label strong { color: var(--accent); font-weight: 600; }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-bar { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--accent); border-radius: 0 2px 2px 0; transition: width 0.25s var(--ease); }
.drop-zone .dz-icon { font-size: 28px; opacity: 0.3; margin-bottom: 8px; }
.drop-zone .dz-text { font-size: 13px; color: var(--text2); line-height: 1.5; }
.drop-zone .dz-text strong { color: var(--accent); font-weight: 600; }

/* ─── File Badge ─── */
.file-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--green-subtle);
  border: 1px solid var(--green-border); border-radius: var(--radius);
}
.file-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.file-badge .name { font-size: 13px; color: var(--green); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-badge .meta { font-size: 11px; color: var(--text2); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 2px; background: var(--surface); border-radius: var(--radius); padding: 3px; margin-bottom: 14px; }
.tab {
  flex: 1; text-align: center; padding: 8px 12px;
  border-radius: calc(var(--radius) - 3px); font-size: 13px;
  font-weight: 600; color: var(--text2); cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  user-select: none;
}
.tab:hover:not(.active) { color: var(--text); }
.tab.active { background: var(--accent); color: #241803; }

/* ─── Settings ─── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field-label { font-size: 11px; color: var(--text2); font-weight: 600; display: block; margin-bottom: 6px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; }

/* ─── Asset pills ─── */
.asset-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 10px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 12px; color: var(--text); max-width: 200px;
}
.asset-pill-icon { display: flex; align-items: center; flex-shrink: 0; color: var(--text2); }
.asset-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.asset-pill-x {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: transparent; color: var(--text3); font-size: 14px;
  cursor: pointer; flex-shrink: 0; padding: 0; line-height: 1;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.asset-pill-x:hover { background: var(--surface); color: var(--red); }
.asset-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; background: transparent;
  border: 1px dashed var(--border); border-radius: 20px;
  font-size: 12px; color: var(--text3); cursor: pointer;
  font-family: inherit; font-weight: 500;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.asset-add:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text2); }

/* ─── Overflow menu ─── */
.overflow-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px; min-width: 120px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.overflow-menu-label {
  padding: 6px 10px 4px; font-size: 10px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.overflow-menu-item {
  display: block; width: 100%; text-align: left; padding: 6px 10px;
  background: none; border: none; color: var(--text2); font-size: 12px;
  font-family: inherit; cursor: pointer; border-radius: 6px;
  transition: background 0.1s var(--ease), color 0.1s var(--ease);
}
.overflow-menu-item:hover { background: var(--surface2); color: var(--text); }

/* ─── Progress ─── */
.progress-track { background: var(--surface2); border-radius: 4px; height: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s var(--ease); }
.progress-fill.indeterminate { width: 35% !important; animation: shimmer 1.4s ease-in-out infinite; }
.status-line { font-size: 13px; color: var(--text2); display: flex; justify-content: space-between; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; flex-shrink: 0; }
.spinner.sm { width: 14px; height: 14px; border-width: 1.5px; }

/* ─── Clip List ─── */
.clip-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; margin-bottom: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), opacity 0.15s var(--ease);
  cursor: pointer;
}
.clip-item:hover { border-color: var(--border-hover); }
.clip-item.dimmed { opacity: 0.35; }
.clip-item.selected { border-color: var(--accent); background: rgba(217, 118, 49, 0.04); }
.checkbox {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  flex-shrink: 0;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox.checked { background: var(--accent); border-color: var(--accent); }
.clip-info { flex: 1; min-width: 0; }
.clip-title { font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.clip-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.clip-meta .err { color: var(--red); }
.clip-meta .warn { color: var(--amber); }
.clip-actions { display: flex; gap: 4px; flex-shrink: 0; }
.clip-status { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.clip-status.pending { border: 1.5px dashed var(--border); }
.clip-status.exported { background: var(--green-subtle); color: var(--green); }
.status-dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.status-dot.ok { background: var(--green-subtle); color: var(--green); }
.status-dot.fail { background: var(--red-subtle); color: var(--red); }

/* ─── Error ─── */
.error-bar { padding: 12px 16px; background: var(--red-subtle); border: 1px solid var(--red-border); border-radius: var(--radius); margin-bottom: 20px; font-size: 13px; color: var(--red); display: flex; align-items: center; gap: 10px; }
.error-bar span { flex: 1; }
.spacer { height: 1px; background: var(--border); margin: 28px 0; opacity: 0.4; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 1000; display: flex; align-items: center; justify-content: center; cursor: pointer; animation: fadeIn 0.15s var(--ease); }
.modal-body { max-width: 380px; width: 92%; cursor: default; animation: scaleIn 0.2s var(--ease); }
.modal-body video { width: 100%; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,0.5); }

/* ─── Animations ─── */
.fade-in { animation: fadeIn 0.3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { transform: translateX(-120%); } 100% { transform: translateX(350%); } }
@keyframes clipReveal { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.clip-reveal { animation: clipReveal 0.35s var(--ease) both; }
@keyframes tagFlash { 0% { border-color: var(--accent); background: var(--accent-subtle); } 100% { border-color: var(--border); background: var(--surface); } }

/* ─── MCP Hints ─── */
.mcp-hints {
  margin-top: 20px;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  animation: fadeIn 0.3s var(--ease);
}
.mcp-hints-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.mcp-hints-icon {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--accent); font-weight: 800; flex-shrink: 0;
}
.mcp-hints-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text2); text-transform: uppercase;
}
.mcp-hints-subtitle {
  font-size: 11px; color: var(--text3); margin-left: auto;
}
.mcp-hint-list {
  display: flex; flex-direction: column; gap: 6px;
}
.mcp-hint {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease), opacity 0.15s var(--ease);
  user-select: none;
}
.mcp-hint:hover {
  border-color: #7c5ae055; background: rgba(124, 90, 224, 0.04);
}
.mcp-hint:active { transform: scale(0.99); }
.mcp-hint.copied {
  border-color: var(--green-border); background: var(--green-subtle);
}
.mcp-hint-prompt {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mcp-hint-desc {
  font-size: 11px; color: var(--text3); white-space: nowrap; flex-shrink: 0;
}
.mcp-hint-copy {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; flex-shrink: 0; font-size: 12px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease-out);
}
.mcp-hint-copy:hover { background: var(--surface2); color: var(--text); }
.mcp-hint-category {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.mcp-hint-category.analyze { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.mcp-hint-category.create { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
.mcp-hint-category.refine { background: var(--accent-subtle); color: var(--accent); }
.mcp-hint-category.export { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }

/* ─── Nav (knowledge, integration pages) ─── */
.nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.nav .logo { margin-bottom: 0; }
.nav-link {
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-decoration: none; padding: 6px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover { border-color: var(--border-hover); color: var(--text); }
.subtitle { font-size: 14px; color: var(--text2); margin-top: 8px; line-height: 1.6; }

/* ─── Knowledge page ─── */
.dir-path {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 5px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text2);
}
.knowledge-drop-zone { margin-bottom: 10px; }
.file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  position: relative;
}
.file-card:hover { border-color: var(--border-hover); }
.file-card.active { border-color: var(--accent); background: var(--accent-subtle); }
.file-name {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  font-weight: 600; color: var(--text); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { font-size: 11px; color: var(--text3); }
.file-preview { font-size: 12px; color: var(--text2); margin-top: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-delete {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface3); border: 0;
  color: var(--text3); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px #1a1a1f, 0 11px 18px -5px #000000d9,
    0 0 0 1px #ffffff14, inset 0 1px #ffffff24;
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
  opacity: 0;
}
.file-card:hover .file-delete { opacity: 1; }
.file-delete:hover { color: var(--red); background: var(--red-subtle); box-shadow: 0 5px #1a1a1f, 0 11px 18px -5px #000000d9, 0 0 0 1px var(--red-border), inset 0 1px #ffffff24; }
.file-delete:active { transform: translateY(4px); box-shadow: 0 0 0 1px var(--red-border), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.editor-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-top: 20px;
}
.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.editor-filename {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  font-weight: 600; color: var(--text);
}
.editor-actions { display: flex; gap: 6px; }
.editor-textarea {
  width: 100%; min-height: 320px; padding: 16px;
  background: transparent; border: none; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  line-height: 1.7; resize: vertical; outline: none;
}
.new-file-row { display: flex; gap: 8px; margin-top: 16px; }
.new-file-input {
  flex: 1; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none;
}
.new-file-input:focus { border-color: var(--accent); }
.new-file-input:focus-visible,
.editor-textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.new-file-input::placeholder { color: var(--text3); }
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--green-subtle); border: 1px solid var(--green-border);
  color: var(--green); font-size: 13px; font-weight: 600;
  animation: fadeIn 0.2s var(--ease);
}
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); font-size: 13px; }

/* ─── Integration page ─── */
.status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; margin-bottom: 32px;
}
.status-bar.ok { background: var(--green-subtle); border: 1px solid var(--green-border); color: var(--green); }
.status-bar.err { background: var(--red-subtle); border: 1px solid var(--red-border); color: var(--red); }
.status-bar.warn { background: var(--blue-subtle); border: 1px solid var(--blue-border); color: var(--blue); }
.status-bar .status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-bar.ok .status-dot { background: var(--green); }
.status-bar.err .status-dot { background: var(--red); }
.status-bar.warn .status-dot { background: var(--blue); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  transition: border-color 0.2s var(--ease);
}
.card:hover { border-color: var(--border-hover); }
.card-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--text2); text-transform: uppercase; margin-bottom: 16px;
}
.card-title {
  font-size: 16px; font-weight: 700; margin-bottom: 6px; display: flex;
  align-items: center; gap: 8px;
}
.card-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 16px; }
.code-block {
  position: relative; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.code-filename { font-size: 11px; font-weight: 600; color: var(--text2); font-family: 'JetBrains Mono', monospace; }
.copy-btn {
  position: relative; overflow: hidden;
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  font-family: inherit; color: var(--text2); background: transparent;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  min-width: 70px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease-out);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-button {
  position: relative; overflow: hidden;
  --copy-text-dur: 150ms;
  --copy-text-y: 4px;
  --copy-text-blur: 2px;
  --copy-icon-dur: 250ms;
  --copy-icon-scale: 0.25;
  --copy-swap-ease: ease-in-out;
}
.btn.copy-button {
  min-width: 76px;
}
.copy-button-layer {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition:
    opacity var(--copy-text-dur) var(--copy-swap-ease),
    transform var(--copy-text-dur) var(--copy-swap-ease),
    filter var(--copy-text-dur) var(--copy-swap-ease);
}
.copy-button-success {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(var(--copy-text-y)); filter: blur(var(--copy-text-blur));
}
.copy-button.is-copied {
  border-color: var(--green-border); color: var(--green);
}
.copy-button.is-copied .copy-button-idle {
  opacity: 0; transform: translateY(calc(var(--copy-text-y) * -1)); filter: blur(var(--copy-text-blur));
}
.copy-button.is-copied .copy-button-success {
  opacity: 1; transform: translateY(0); filter: blur(0);
}
.copy-button-icon {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition:
    opacity var(--copy-icon-dur) var(--copy-swap-ease),
    transform var(--copy-icon-dur) var(--copy-swap-ease),
    filter var(--copy-icon-dur) var(--copy-swap-ease);
}
.copy-button-success .copy-button-icon {
  opacity: 0;
  transform: scale(var(--copy-icon-scale));
  filter: blur(var(--copy-text-blur));
}
.copy-button.is-copied .copy-button-idle .copy-button-icon {
  opacity: 0;
  transform: scale(var(--copy-icon-scale));
  filter: blur(var(--copy-text-blur));
}
.copy-button.is-copied .copy-button-success .copy-button-icon {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}
.copy-button.is-icon-only {
  min-width: 0; padding: 0;
}
.copy-button.is-icon-only .copy-button-layer {
  width: 100%; height: 100%;
}
.copy-button.is-icon-only .copy-button-success {
  display: flex;
}
@media (prefers-reduced-motion: reduce) {
  .copy-button-layer,
  .copy-button-icon {
    transition: opacity 120ms var(--ease);
    transform: none;
    filter: none;
  }
  .copy-button-success,
  .copy-button.is-copied .copy-button-idle,
  .copy-button-success .copy-button-icon,
  .copy-button.is-copied .copy-button-idle .copy-button-icon {
    transform: none;
    filter: none;
  }
}
pre {
  padding: 16px; overflow-x: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; line-height: 1.7; color: var(--text); tab-size: 2;
}
pre .key { color: #60a5fa; }
pre .str { color: #4ade80; }
pre .comment { color: var(--text3); font-style: italic; }
pre .punct { color: var(--text2); }
.steps { counter-reset: step; }
.step {
  position: relative; padding-left: 40px; margin-bottom: 24px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text2);
}
.step-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }
.step-desc code {
  background: var(--surface2); padding: 2px 7px; border-radius: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  color: var(--accent); border: 1px solid var(--border);
}

/* ─── Setup checklist ─── */
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.setup-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.setup-step:first-child { border-top: none; }
.setup-mark {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 1px dashed var(--border); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.setup-step.done .setup-mark { border: 1px solid var(--green-border); background: var(--green-subtle); }
.setup-body { flex: 1; min-width: 0; }
.setup-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.setup-step.done .setup-title { color: var(--text2); }
.setup-desc { font-size: 12px; color: var(--text3); line-height: 1.5; margin-top: 2px; }
.setup-action { flex-shrink: 0; }
.setup-action .btn { text-decoration: none; }
.tool-grid { display: grid; gap: 8px; }
.tool-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--surface2);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: border-color 0.15s var(--ease);
}
.tool-item:hover { border-color: var(--border); }
.tool-name {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  font-weight: 600; color: var(--accent); white-space: nowrap;
}
.tool-desc { font-size: 12.5px; color: var(--text2); line-height: 1.5; }
.divider { height: 1px; background: var(--border); margin: 32px 0; opacity: 0.4; }

/* ─── Presets ─── */
.preset-bar {
  display: flex; gap: 6px; align-items: center; margin-bottom: 14px;
}
.preset-bar select {
  flex: 1; padding: 8px 12px; font-size: 12px;
}
.preset-bar .btn { flex-shrink: 0; }
.preset-save-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 14px;
  animation: fadeIn 0.2s var(--ease);
}
.preset-save-row input {
  flex: 1; padding: 8px 12px; font-size: 12px;
}

/* ─── Advanced Settings ─── */
.advanced-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 10px;
}
.advanced-grid .field {
  display: flex; flex-direction: column; gap: 4px;
}
.advanced-grid .field-row {
  display: flex; align-items: center; gap: 8px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.toggle-row .toggle-label {
  font-size: 12px; color: var(--text2); font-weight: 500;
}
.toggle {
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; position: relative;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  flex-shrink: 0;
}
.toggle.on {
  background: var(--accent); border-color: var(--accent);
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.2s var(--ease);
}
.toggle.on::after { transform: translateX(16px); }
.range-value {
  font-size: 11px; color: var(--text); font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 28px; text-align: right;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.13); outline: none;
  cursor: pointer;
}
input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ─── Clip Editing ─── */
.clip-edit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s var(--ease);
}
.clip-edit-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; width: 400px; max-width: 92vw;
  animation: scaleIn 0.2s var(--ease);
}
.clip-edit-panel h3 {
  font-size: 14px; font-weight: 700; margin-bottom: 16px;
}
.clip-edit-panel .edit-field {
  margin-bottom: 12px;
}
.clip-edit-panel .edit-field label {
  font-size: 11px; color: var(--text2); font-weight: 600;
  display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.clip-edit-panel .edit-field input,
.clip-edit-panel .edit-field textarea {
  font-size: 13px; padding: 9px 12px;
}
.clip-edit-panel .edit-field textarea {
  min-height: 60px; font-family: inherit;
}
.clip-edit-panel .time-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end;
}
.clip-edit-panel .time-row .arrow {
  color: var(--text3); font-size: 14px; padding-bottom: 10px;
}
.clip-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px;
}
.clip-item .clip-edit-btn {
  opacity: 0; padding: 4px 8px; font-size: 11px;
  transition: opacity 0.15s var(--ease);
  flex-shrink: 0;
}
.clip-item:hover .clip-edit-btn { opacity: 1; }

/* ─── Energy Badges ─── */
.energy-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  flex-shrink: 0;
}
.energy-badge.high { background: rgba(248,113,113,0.1); color: #f87171; }
.energy-badge.medium { background: rgba(251,191,36,0.1); color: #fbbf24; }
.energy-badge.low { background: rgba(96,165,250,0.1); color: #60a5fa; }
.energy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; color: var(--text2);
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.energy-btn:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); }
.energy-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Responsive ─── */
@media (max-width: 920px) {
  .app { padding: 36px 20px 80px; }
  .layout { grid-template-columns: 1fr; gap: 0; }
  .preview-col { display: none; }
  .mcp-hint-desc { display: none; }
}
@media (max-width: 640px) {
  .app { padding: 28px 16px 64px; }
  .file-grid { grid-template-columns: 1fr; }
  .setup-step { flex-wrap: wrap; }
  .setup-action { padding-left: 32px; }
}

/* ── Dashboard shell ── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; box-sizing: border-box;
  border-right: 1px solid var(--border); background: var(--surface);
  padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; padding: 4px 8px 18px; }
.sidebar-logo img { height: 22px; }
.sidebar-section { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); padding: 16px 12px 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); color: var(--text2);
  text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { background: var(--accent-subtle); color: var(--accent); }
.sidebar-link .ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.sidebar-link.disabled { opacity: 0.4; pointer-events: none; }
.sidebar-link .soon { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.shell-main { flex: 1; min-width: 0; }
.shell-main .app { margin: 0; max-width: 1080px; }
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .sidebar-logo { padding: 4px 8px; }
  .sidebar-section { display: none; }
}

/* ── Custom clip player ── */
.clip-player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; width: 100%; }
.clip-player video { display: block; width: 100%; height: auto; cursor: pointer; }
.clip-player-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0; transition: opacity 0.18s;
}
.clip-player:hover .clip-player-bar, .clip-player.paused .clip-player-bar { opacity: 1; }
.clip-player-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; display: flex; }
.clip-player-time { color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.clip-player-track { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); cursor: pointer; position: relative; }
.clip-player-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }

/* ── Thumbnail editor ── */
.thumb-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; background: var(--bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.thumb-stage img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.thumb-fields .full { grid-column: 1 / -1; }
.thumb-swatch-row { display: flex; align-items: center; gap: 8px; }
.thumb-swatch-row input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }

/* ── Library card grid ── */
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.clip-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: border-color 0.12s, transform 0.12s; }
.clip-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.clip-card-del { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius-sm); background: var(--surface3); color: #fff; cursor: pointer; opacity: 0; box-shadow: 0 5px #1a1a1f, 0 11px 18px -5px #000000d9, 0 0 0 1px #ffffff14, inset 0 1px #ffffff24; transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), opacity 0.12s var(--ease), background 0.12s var(--ease), color 0.12s var(--ease); }
.clip-card:hover .clip-card-del { opacity: 1; }
.clip-card-del:hover:not(:disabled) { background: var(--red-subtle); color: var(--red); box-shadow: 0 5px #1a1a1f, 0 11px 18px -5px #000000d9, 0 0 0 1px var(--red-border), inset 0 1px #ffffff24; }
.clip-card-del:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 1px var(--red-border), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.clip-card-del:disabled { opacity: 0.4; cursor: default; }
.clip-card-media { aspect-ratio: 9 / 16; width: 100%; display: block; object-fit: cover; background: #000; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.clip-card-media.empty { display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 22px; }
.clip-card-body { padding: 10px 11px; }
.clip-card-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-card-meta { font-size: 10.5px; color: var(--text3); margin-top: 5px; }
.episode-block + .episode-block { margin-top: 22px; }
.episode-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.episode-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.episode-head .sub { font-size: 11px; color: var(--text3); }

/* ── Settings pages (Config / Integrations / MCP) ── */
.set-kv { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.set-kv:last-child { border-bottom: none; }
.set-kv .k { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text2); }
.set-kv .v { font-family: var(--font-mono, monospace); font-size: 13px; color: var(--text); word-break: break-all; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.set-note { margin-top: 14px; font-size: 12px; padding: 10px 12px; border-radius: var(--radius-sm); }
.set-note.ok { background: var(--green-subtle); color: var(--green); }
.set-note.err { background: var(--red-subtle); color: var(--red); }
.set-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-link { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent); text-decoration: none; }
.set-link:hover { color: var(--accent-hover); }
.int-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.int-row:last-child { border-bottom: none; }
.int-row .name { font-size: 14px; font-weight: 600; }
.int-row .desc { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ── Code block (MCP setup) ── */
.code-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 10px; }
.code-block-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text2); font-family: var(--font-mono, monospace); }
.code-block pre { margin: 0; padding: 13px 14px; font-family: var(--font-mono, monospace); font-size: 12.5px; line-height: 1.6; color: var(--text); overflow-x: auto; white-space: pre; }

/* ── Thumbnail variations ── */
.thumb-variations { display: flex; gap: 8px; margin-top: 12px; }
.thumb-variation { flex: 1; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: #000; cursor: pointer; padding: 0; }
.thumb-variation.selected { border-color: var(--accent); }
.thumb-variation img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Clip detail layout ── */
.clip-media { display: flex; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.clip-media-col { width: 300px; flex-shrink: 0; }
.clip-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.clip-controls .section { margin: 0; }

/* ── Thumbnail template editor ── */
.tmpl-layout { display: flex; gap: 28px; align-items: flex-start; }
.tmpl-preview { width: 300px; flex-shrink: 0; position: sticky; top: 24px; }
.tmpl-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .tmpl-layout { flex-direction: column; } .tmpl-preview { position: static; } }

/* ── Motion layer (respects reduced-motion) ── */
@media (prefers-reduced-motion: no-preference) {
  @keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
  @keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  .shell-main > * { animation: pageIn 0.24s var(--ease-out) both; }

  .reframe-overlay { animation: pageIn 0.16s var(--ease-out) both; }
  .reframe-modal { animation: modalIn 0.2s var(--ease-out) both; }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

  .clip-grid .clip-card { animation: cardIn 0.28s var(--ease-out) both; }
  .clip-grid .clip-card:nth-child(1) { animation-delay: 0.02s; }
  .clip-grid .clip-card:nth-child(2) { animation-delay: 0.05s; }
  .clip-grid .clip-card:nth-child(3) { animation-delay: 0.08s; }
  .clip-grid .clip-card:nth-child(4) { animation-delay: 0.11s; }
  .clip-grid .clip-card:nth-child(5) { animation-delay: 0.14s; }
  .clip-grid .clip-card:nth-child(6) { animation-delay: 0.17s; }
  .clip-grid .clip-card:nth-child(n+7) { animation-delay: 0.2s; }

  .clip-controls .section, .tmpl-fields .section { animation: riseIn 0.26s var(--ease-out) both; }
  .clip-controls .section:nth-child(2) { animation-delay: 0.05s; }
  .clip-controls .section:nth-child(3) { animation-delay: 0.1s; }
  .clip-controls .section:nth-child(4) { animation-delay: 0.15s; }

  .thumb-variation { transition: border-color 0.15s var(--ease), transform 0.12s var(--ease); }
  .thumb-variation:hover { transform: translateY(-2px); }
  .thumb-stage img, .clip-card-media { transition: opacity 0.3s var(--ease); }
  .sidebar-link { transition: background 0.14s var(--ease), color 0.14s var(--ease), transform 0.14s var(--ease); }
  .sidebar-link:hover { transform: translateX(2px); }
  .set-note { animation: riseIn 0.25s var(--ease) both; }
}

/* ── Polish: balanced headings, image outlines, tabular figures ── */
h1, h2, h3 { text-wrap: balance; }
p, li, figcaption, blockquote, .subtitle, .file-preview, .card-desc, .int-row .desc, .set-note, .empty-state {
  text-wrap: pretty;
}
.thumb-stage img, .thumb-variation img { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.clip-card-meta, .clip-meta span, .clip-card-title { font-variant-numeric: tabular-nums; }

/* ── Clip detail (player hero + editor) ── */
.clip-detail { display: flex; gap: 28px; align-items: flex-start; }
.clip-detail-player { width: 330px; flex-shrink: 0; position: sticky; top: 24px; }
.clip-detail-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.clip-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.clip-meta span { font-size: 11px; color: var(--text2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.thumb-edit { display: flex; gap: 14px; align-items: flex-start; }
.thumb-edit-preview { width: 150px; flex-shrink: 0; }
.thumb-edit-controls { flex: 1; min-width: 0; }
@media (max-width: 820px) { .clip-detail { flex-direction: column; } .clip-detail-player { position: static; width: 100%; max-width: 330px; } }

/* ── Reframe editor ── */
.reframe-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.reframe-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; width: min(560px, 95vw); max-height: 92vh; overflow: auto; }
.reframe-stage { position: relative; width: 100%; background: #000; border-radius: var(--radius-sm); overflow: hidden; user-select: none; touch-action: none; cursor: ew-resize; }
.reframe-stage video { width: 100%; display: block; }
.reframe-box { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); pointer-events: none; }

/* ── Reframe timeline ── */
.rf-track { position: relative; height: 30px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; margin-top: 12px; overflow: hidden; }
.rf-kf { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--green); transform: translateX(-1px); pointer-events: none; }
.rf-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; box-shadow: 0 0 6px var(--accent); }

/* ── Reframe trim region/handles ── */
.rf-region { position: absolute; top: 0; bottom: 0; background: var(--accent-subtle); pointer-events: none; }
.rf-handle { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--accent); transform: translateX(-1px); pointer-events: none; }

/* ── Reframe timeline polish (grabbable handles) ── */
.rf-track { height: 44px; }
.rf-handle { width: 10px; border-radius: 4px; top: -3px; bottom: -3px; transform: translateX(-5px); cursor: ew-resize; box-shadow: 0 0 0 1px rgba(0,0,0,0.45); z-index: 2; pointer-events: auto; }
.rf-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 16px; background: rgba(0,0,0,0.4); transform: translate(-50%,-50%); border-radius: 1px; }
.rf-track:hover .rf-handle { box-shadow: 0 0 0 1px var(--accent-glow); }
.rf-playhead { z-index: 3; }

/* ── Reframe: camera-switch (cut) markers ── */
.rf-cut { position: absolute; top: 0; bottom: 0; width: 2px; background: #facc15; opacity: 0.75; transform: translateX(-1px); pointer-events: none; }

/* ── Streamed content reveal ── */
.stream-in { animation: stream-in 0.24s var(--ease-out) both; }
@keyframes stream-in {
  from { opacity: 0; transform: translateY(4px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stream-in { animation: none; }
}

/* ── Command palette (global search) ── */
.sidebar-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 6px 0 14px; padding: 8px 10px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text3); font-family: inherit; font-size: 13px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar-search:hover { border-color: var(--border-hover); color: var(--text2); }
.sidebar-search span { flex: 1; text-align: left; }
.sidebar-search kbd { font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text3); }

.cmdk-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  animation: fadeIn 0.12s var(--ease);
}
.cmdk {
  width: 100%; max-width: 580px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  animation: scaleIn 0.16s var(--ease-out);
}
.cmdk-head { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-search-icon { color: var(--text3); flex-shrink: 0; }
.cmdk-head input { flex: 1; border: none !important; background: transparent !important; box-shadow: none !important; padding: 15px 0 !important; font-size: 15px; color: var(--text); }
.cmdk-kbd { font-size: 10px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }
.cmdk-list { max-height: 54vh; overflow-y: auto; padding: 8px; }
.cmdk-empty { padding: 28px; text-align: center; color: var(--text3); font-size: 13px; }
.cmdk-group + .cmdk-group { margin-top: 6px; }
.cmdk-group-label { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text3); padding: 6px 10px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; background: none; border: none; border-radius: var(--radius-sm);
  color: var(--text2); font-family: inherit; font-size: 13.5px; cursor: pointer;
}
.cmdk-item.active { background: var(--surface2); color: var(--text); }
.cmdk-item-icon { display: inline-flex; color: var(--text3); flex-shrink: 0; }
.cmdk-item.active .cmdk-item-icon { color: var(--accent); }
.cmdk-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub { font-size: 11px; color: var(--text3); text-transform: capitalize; flex-shrink: 0; }
.cmdk-item-enter { color: var(--text3); flex-shrink: 0; }

/* ── Assets page ── */
.asset-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.asset-count { color: var(--text3); font-weight: 500; margin-left: 4px; }
.asset-url-row { display: flex; gap: 8px; margin-bottom: 12px; }
.asset-url-row input { flex: 1; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.asset-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.asset-card:hover { border-color: var(--border-hover); }
.asset-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-edge); }
.asset-check {
  position: absolute; top: 8px; left: 8px; z-index: 2; display: flex;
  background: rgba(15, 14, 13, 0.6); border-radius: 5px; padding: 2px; backdrop-filter: blur(4px);
}
.asset-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); display: block; }
.asset-thumb { width: 100%; height: 120px; object-fit: contain; background: var(--bg2); display: block; }
.asset-thumb.clickable { cursor: zoom-in; transition: opacity 0.15s var(--ease); }
.asset-thumb.clickable:hover { opacity: 0.85; }
.asset-url-toggle { opacity: 0.55; transition: opacity 0.15s var(--ease); }
.asset-url-toggle:hover { opacity: 1; }
.asset-thumb-file { display: flex; align-items: center; justify-content: center; color: var(--text3); font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.asset-thumb-audio { display: flex; align-items: center; justify-content: center; height: 120px; }
.asset-row { display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 10px; }
.asset-meta { min-width: 0; flex: 1; }
.asset-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-rename { font-size: 13px; font-weight: 600; padding: 2px 6px !important; width: 100%; }
.asset-default-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); background: var(--accent-subtle); padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.asset-sub { font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.asset-actions { display: flex; gap: 2px; flex-shrink: 0; }
.asset-menu-wrap { position: relative; display: flex; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; border: none; background: transparent;
  color: var(--text3); cursor: pointer; border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn.active { color: var(--accent); }
.icon-btn.danger:hover { color: var(--red); }

.asset-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 168px; background: transparent; color: var(--text3);
  border: 1px dashed var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-weight: 500; font-family: inherit;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.asset-add-tile:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.asset-add-tile:disabled { cursor: default; opacity: 0.6; }

.asset-audio-player { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 12px; }
.asset-audio-btn {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #241803;
}
.asset-audio-track { flex: 1; height: 4px; border-radius: 2px; background: var(--surface); cursor: pointer; position: relative; }
.asset-audio-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
.asset-audio-time { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.asset-bulkbar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 60;
  padding: 10px 12px 10px 18px; background: var(--surface3);
  border: 1px solid var(--border-hover); border-radius: 999px;
  font-size: 13px; color: var(--text2);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: bulkbar-in 0.18s var(--ease-out) both;
}
.asset-bulkbar > span { font-weight: 600; color: var(--text); margin-right: 6px; }
@keyframes bulkbar-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .asset-bulkbar { animation: none; } }

.recent-sources { max-width: 190px; font-size: 12px; flex-shrink: 0; }

/* ── Analytics ── */
.analytics-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text2); }
.analytics-status-sub { color: var(--text3); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex-shrink: 0; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-subtle); }
.analytics-steps { font-size: 12px; color: var(--text2); line-height: 1.7; margin: 8px 0 14px; padding-left: 18px; }
.analytics-empty { color: var(--text3); font-size: 13px; padding: 4px 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-icon { display: inline-flex; color: var(--accent); margin-bottom: 10px; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text3); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }

.insights { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 4px; }
.insight { padding-left: 12px; border-left: 2px solid var(--accent); }
.insight-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.insight-value { font-size: 16px; font-weight: 700; color: var(--text); margin: 3px 0; text-transform: capitalize; }
.insight-metric { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }

.analytics-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.analytics-charts .section { margin-bottom: 0; }
.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-key { color: var(--text); text-transform: capitalize; }
.bar-count { color: var(--text3); }
.bar-val { color: var(--text2); font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-track { height: 7px; border-radius: 4px; background: var(--surface3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-edge), var(--accent)); transition: width 0.5s var(--ease-out); }

.analytics-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.analytics-row:last-child { border-bottom: 0; }
.analytics-row-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-row-sub { font-size: 12px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

.top-clip { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.top-clip:last-child { border-bottom: 0; }
.top-clip:hover .top-clip-title { color: var(--accent); }
.rank-badge {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface3); color: var(--text2); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.top-clip:first-of-type .rank-badge { background: var(--accent-subtle); color: var(--accent); }
.top-clip-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.15s var(--ease); }
.top-clip-metrics { display: flex; gap: 16px; font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.top-clip-metrics .metric-strong { color: var(--text); font-weight: 600; }

.analytics-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 56px 24px; margin-top: 8px; color: var(--text3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.analytics-hero > svg { color: var(--accent); }
.analytics-hero-title { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 14px; }
.analytics-hero-sub { font-size: 13px; color: var(--text2); line-height: 1.6; max-width: 440px; margin-top: 8px; }

/* ── Confirm dialog + lightbox ── */
.confirm-dialog {
  background: var(--surface); border: 1px solid var(--border-hover);
  border-radius: var(--radius); padding: 22px; box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.confirm-dialog h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.confirm-dialog p { margin: 0 0 18px; font-size: 13px; color: var(--text2); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lightbox-audio { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 16px; }
.lightbox-file { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; text-align: center; color: var(--text2); font-family: var(--font-mono); font-size: 14px; }
.lightbox-name { margin-top: 12px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); }
.asset-bottom-space { height: 72px; }

/* ── Tooltip (shared, portalled) ── */
.tt-wrap { display: inline-flex; }
.tooltip {
  z-index: 100; pointer-events: none; white-space: nowrap;
  background: var(--surface3); color: var(--text); border: 1px solid var(--border);
  font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  animation: tooltip-in 0.12s var(--ease-out) both;
}
@keyframes tooltip-in { from { opacity: 0; transform: translate(-50%, calc(-100% + 3px)); } }
.tooltip-bottom { animation: none; }
@media (prefers-reduced-motion: reduce) { .tooltip { animation: none; } }

/* ── Asset picker (reused across pages) ── */
.asset-picker { position: relative; display: inline-flex; flex-direction: column; gap: 6px; min-width: 200px; }
.asset-picker-label { font-size: 11px; font-weight: 600; color: var(--text2); }
.asset-picker-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer; font-family: inherit; font-size: 13px;
  transition: border-color 0.15s var(--ease);
}
.asset-picker-btn:hover:not(:disabled) { border-color: var(--border-hover); }
.asset-picker-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.asset-picker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-picker-name.muted { color: var(--text3); }
.picker-thumb { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; background: var(--bg2); flex-shrink: 0; }
.picker-thumb-file { display: block; }
.asset-picker-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); max-height: 280px; overflow-y: auto;
}
.asset-picker-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 6px 8px; background: none; border: none; color: var(--text2);
  font-family: inherit; font-size: 13px; cursor: pointer; border-radius: 6px;
}
.asset-picker-opt:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.asset-picker-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.asset-picker-foot .asset-picker-opt { flex: 1; }
.asset-picker-link { font-size: 12px; color: var(--accent); text-decoration: none; padding: 6px 10px; flex-shrink: 0; }
.asset-picker-link:hover { text-decoration: underline; }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cap-card {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: left;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.cap-card:hover { border-color: var(--border-hover); }
.cap-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-edge); }
.cap-preview {
  height: 84px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a2f3a, #14171d); padding: 8px; text-align: center;
}
.cap-label { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.cap-hormozi { font-family: var(--font-sans); font-weight: 800; font-size: 15px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 4px #000; }
.cap-karaoke { font-family: var(--font-sans); font-weight: 700; font-size: 14px; color: #fff; }
.cap-karaoke::first-letter { color: var(--yellow); }
.cap-subtle { font-family: var(--font-sans); font-weight: 500; font-size: 12px; color: #e5e7eb; }
.cap-branded { font-family: var(--font-sans); font-weight: 800; font-size: 14px; text-transform: uppercase; color: #fff; background: rgba(0,0,0,0.8); padding: 3px 8px; border-radius: 8px; }
