:root {
  color-scheme: dark;
  --bg: #070605;
  --surface: rgba(18, 16, 12, 0.9);
  --surface-2: rgba(32, 28, 20, 0.9);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f8fbff;
  --muted: #a8b4c8;
  --gold: #d8b76a;
  --gold-2: #fff0b8;
  --bronze: #8f6f33;
  --ivory: #ffffff;
  --blue: #d8b76a;
  --cyan: #d8b76a;
  --green: #f2d686;
  --amber: #f4c96a;
  --rose: #8d62ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

/* ── LIGHT THEME ─────────────────── */
body.theme-light {
  color-scheme: light;
  --bg: #faf8f3;
  --surface: rgba(255, 255, 255, 0.95);
  --surface-2: rgba(248, 244, 236, 0.96);
  --line: rgba(40, 32, 20, 0.14);
  --text: #221c12;
  --muted: #6b6353;
  --gold: #a8842f;
  --gold-2: #8a6a22;
  --bronze: #c8b585;
  --ivory: #2a2418;
  --green: #a8842f;
  --amber: #b8923a;
  --rose: #7a5fc0;
  --shadow: 0 24px 70px rgba(60, 48, 24, 0.16);
}
body.theme-light .ambient { opacity: 0.25; }

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

body[dir="rtl"] {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(84px);
  opacity: 0.38;
  transform: translateZ(0);
}

.ambient-a {
  top: 12%;
  left: -120px;
  background: rgba(111, 134, 255, 0.45);
}

.ambient-b {
  right: -120px;
  bottom: 10%;
  background: rgba(255, 138, 42, 0.22);
}

.shell {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* ── FIXED LEFT SIDEBAR ────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 248px;
  width: 248px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  transition: flex-basis 0.22s ease, width 0.22s ease;
  z-index: 40;
}
.sidebar.collapsed {
  flex-basis: 72px;
  width: 72px;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--line);
}
/* when collapsed, stack the logo and the collapse button so the
   button is never clipped — it must always be reachable */
.sidebar.collapsed .sidebar-top {
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 10px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  padding-top: 10px;
}
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
/* Start CTA — the prominent action */
.sidebar-cta {
  text-align: center;
  width: 100%;
  min-height: 46px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(216,183,106,0.22);
}
/* theme + language sit together in one tidy row */
.sidebar-prefs {
  display: flex;
  gap: 8px;
}
.sidebar-prefs .theme-toggle {
  flex: 1 1 auto;
  justify-content: center;
}

/* content area to the right of the sidebar */
.content-area {
  flex: 1 1 auto;
  min-width: 0;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 0 16px 40px;
}
.sidebar-open {
  display: none;
}

/* ── collapsed sidebar — clean icon-only rail ──────────────── */
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-tx,
.sidebar.collapsed .nav-group-title {
  display: none;
}
.sidebar.collapsed .sidebar-nav {
  align-items: center;
}
.sidebar.collapsed .nav-group {
  width: 100%;
  align-items: center;
}
.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 auto;
}
.sidebar.collapsed .nav-ic {
  width: auto;
  font-size: 17px;
}
.sidebar.collapsed .sidebar-nav a.active {
  box-shadow: inset 0 0 0 1px rgba(216,183,106,0.4);
}
/* collapsed footer — icon-sized controls */
.sidebar.collapsed .sidebar-footer {
  align-items: center;
}
.sidebar.collapsed .sidebar-prefs {
  flex-direction: column;
  width: 100%;
  align-items: center;
}
.sidebar.collapsed .language-select {
  display: none;
}
.sidebar.collapsed .sidebar-cta {
  width: 44px;
  height: 44px;
  min-height: 0;
  font-size: 0;
  padding: 0;
  border-radius: 12px;
}
.sidebar.collapsed .sidebar-cta::after {
  content: "▶";
  font-size: 14px;
  line-height: 1;
}
.sidebar.collapsed .nav-collapse-icon {
  display: inline-block;
  transform: rotate(180deg);
}
.sidebar.collapsed .theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  flex: 0 0 auto;
}
.sidebar.collapsed #themeToggleLabel { display: none; }
.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  margin: 18px 0 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(24px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}
.topbar .brand,
.topbar .header-actions {
  padding-top: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #d8b76a;
  color: #090805;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(53, 215, 255, 0.22);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(216, 183, 106, 0.18);
}

.nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--surface-2);
}
.nav a {
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}
/* ── Sidebar nav groups ────────────────────────────────────── */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.nav-group + .nav-group {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
}
.nav-group-title {
  margin: 2px 0 4px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}
.sidebar-nav a.active {
  background: rgba(216,183,106,0.14);
  color: var(--gold);
}
.nav-ic {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--gold);
}
.nav-tx { white-space: nowrap; }
.nav-collapse {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  flex: 0 0 auto;
}
.nav-collapse:hover { color: var(--gold); }

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.language-select {
  flex: 0 0 auto;
  width: 108px;
  height: 38px;
  border-radius: 8px;
  padding: 0 8px;
  box-sizing: border-box;
}
.sidebar-prefs .theme-toggle {
  height: 38px;
  padding: 0 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
  white-space: nowrap;
}

.button.primary {
  background: #d8b76a;
  color: #090805;
  box-shadow: 0 18px 40px rgba(216, 183, 106, 0.2);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.button.gold {
  border-color: rgba(216, 183, 106, 0.45);
  color: var(--gold-2);
  background: rgba(216, 183, 106, 0.11);
}

.hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  min-height: 640px;
  padding-bottom: 54px;
}

.hero-copy {
  max-width: 790px;
}

.hero-mini-copy {
  align-self: start;
  padding-top: 44px;
}

.hero-mini-copy h1 {
  max-width: 250px;
  margin-bottom: 14px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.22;
}

.hero-mini-copy p:not(.eyebrow) {
  max-width: 250px;
  font-size: 12px;
  line-height: 1.8;
}

.hero-mini-copy .hero-actions {
  margin-top: 18px;
}

.hero-mini-copy .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[dir="rtl"] .eyebrow {
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(44px, 6.4vw, 82px);
  line-height: 1.03;
  letter-spacing: 0;
  font-family: Prata, Georgia, serif;
  font-weight: 400;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.14;
  font-family: Prata, Georgia, serif;
  font-weight: 400;
}

body[dir="rtl"] h1,
body[dir="rtl"] h2 {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  font-weight: 800;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

p,
li {
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-actions {
  justify-content: flex-start;
  margin-top: 30px;
  flex-wrap: wrap;
}

.orbital-stage {
  position: relative;
  min-height: 560px;
  perspective: 1000px;
}

.stage-grid {
  position: absolute;
  inset: 48px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--surface);
  transform: rotateX(64deg) rotateZ(-8deg);
  transform-origin: center bottom;
  opacity: 0.7;
}

.floating-panel,
.panel,
.job-card,
.job-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel-main {
  position: absolute;
  inset: 10px 12px auto;
  min-height: 520px;
  padding: 20px;
  transform: rotateY(-7deg) rotateX(3deg);
  transform-style: preserve-3d;
}

body[dir="rtl"] .panel-main {
  transform: rotateY(7deg) rotateX(3deg);
}

.dashboard-board {
  background: var(--surface-2);
}

.panel-chip {
  position: absolute;
  right: 2px;
  bottom: 54px;
  display: grid;
  gap: 4px;
  width: 176px;
  padding: 18px;
  background: var(--surface-2);
}

body[dir="rtl"] .panel-chip {
  right: auto;
  left: 2px;
}

.panel-chip span {
  color: var(--muted);
  font-size: 13px;
}

.panel-chip strong {
  font-size: 32px;
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.preview-top strong {
  margin-left: 10px;
  color: var(--muted);
  font-size: 11px;
}

.preview-top span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0 14px;
}

.metric-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.metric-grid strong {
  display: block;
  margin-bottom: 5px;
  font-size: 24px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 13px;
}

.chart {
  display: flex;
  align-items: end;
  gap: 14px;
  height: 300px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chart span {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: #6f86ff;
  box-shadow: 0 12px 28px rgba(111, 134, 255, 0.16);
}

.hero-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(216, 183, 106, 0.42);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
}

.hero-live-chart {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.hero-live-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(100px, 0.9fr) 54px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.hero-live-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel,
.jobs {
  margin-bottom: 34px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 14px;
}

.dash-card {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.dash-card-large {
  grid-row: span 3;
}

.dash-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.dash-card p {
  margin: 10px 0 0;
  font-size: 11px;
}

.donut-card {
  position: relative;
  width: 96px;
  height: 96px;
  border: 12px solid #26395f;
  border-top-color: #6f86ff;
  border-right-color: #ff8a2a;
  border-radius: 999px;
}

.donut-card span {
  position: absolute;
  inset: 14px;
  border: 10px solid #17223c;
  border-top-color: #ff8a2a;
  border-radius: inherit;
}

.donut-card strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 16px;
}

.spark-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 92px;
}

.spark-bars span {
  flex: 1;
  min-width: 10px;
  border-radius: 6px 6px 0 0;
  background: #6f86ff;
}

.spark-bars span:nth-child(even) {
  background: #ff8a2a;
}

.dash-score-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 44px;
  line-height: 1;
}

.luxury-hero {
  display: block;
  min-height: auto;
  padding: 56px 0 72px;
  border-bottom: 1px solid rgba(216, 183, 106, 0.12);
}

.luxury-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}

.luxury-hero-copy { min-width: 0; }

.luxury-hero h1 {
  margin: 14px 0 22px;
  color: var(--text);
  font-family: Prata, Georgia, serif;
  font-size: clamp(44px, 5vw, 78px);
  font-weight: 400;
  line-height: 1.06;
}

.luxury-hero p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.luxury-hero .hero-actions { margin-top: 28px; }

/* Right column: motion panel + live stats */
.luxury-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* The title text becomes a window onto a flowing motion gradient */
.motion-title {
  background: linear-gradient(
    100deg,
    #d8b76a 0%, #fff0b8 22%, #ffffff 38%,
    #d8b76a 55%, #8f6f33 72%, #fff0b8 88%, #d8b76a 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: motionTitleFlow 9s linear infinite;
}
@keyframes motionTitleFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 280% 50%; }
}

/* Motion-graphic panel */
.hero-motion {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(216,183,106,0.28);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 60px rgba(216,183,106,0.1);
}
.hero-motion canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Live stat cards under the motion panel */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  border: 1px solid rgba(216,183,106,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  text-align: center;
}
.hero-stat strong {
  font-family: Prata, serif;
  font-size: 30px;
  color: var(--gold-2);
  line-height: 1;
}
.hero-stat span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 860px) {
  .luxury-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-motion { height: 180px; }
}

.luxury-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.luxury-hero .hero-actions {
  margin-top: 30px;
}

.chart-only-hero {
  display: block;
  min-height: 0;
  padding: 38px 0 56px;
}

.chart-dashboard {
  display: grid;
  grid-template-columns: 1fr 1.05fr 0.9fr;
  grid-template-rows: 124px 154px 124px;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.chart-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.welcome-card {
  display: grid;
  align-content: space-between;
  padding: 16px;
  background: var(--surface-2);
}

.status-row,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #dbe6ff;
  font-size: 12px;
  font-weight: 800;
}

.welcome-card > strong {
  color: var(--text);
  text-align: center;
  font-size: 20px;
}

.welcome-card nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: #6f86ff;
}

.welcome-card nav a {
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.ranking-card {
  grid-row: span 2;
  padding: 16px;
}

.ranking-card .hero-live-chart {
  margin-top: 12px;
  border: 0;
  background: var(--surface-2);
}

.donut-panel,
.bars-panel,
.line-panel,
.mini-stats {
  padding: 16px;
}

.donut-panel {
  display: grid;
  align-content: center;
}

.bars-panel {
  grid-column: 3;
}

.line-panel {
  grid-column: 3;
  background: var(--surface-2);
}

.line-panel svg {
  width: 100%;
  height: 92px;
  margin-top: 10px;
  overflow: visible;
}

.line-panel path {
  fill: none;
  stroke: #6f86ff;
  stroke-width: 7;
  stroke-linecap: round;
}

.line-panel circle {
  fill: #ffffff;
  stroke: #6f86ff;
  stroke-width: 5;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-stats div {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.mini-stats strong {
  color: var(--text);
  font-size: 26px;
}

.mini-stats span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  padding: 28px;
  background-color: var(--surface);
}

.search-wrap {
  width: min(460px, 100%);
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.search-wrap #searchInput {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

/* Open dropdown list — explicit colors so options are never
   rendered with white text on a white background. */
select option,
select optgroup {
  background-color: #16130d;
  color: var(--text);
}
body.theme-light select option,
body.theme-light select optgroup {
  background-color: #ffffff;
  color: #221c12;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(53, 215, 255, 0.76);
  box-shadow: 0 0 0 4px rgba(53, 215, 255, 0.12);
}

label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.web-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  margin: 24px 0 20px;
}

.source-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.source-card,
.tool-card,
.role-item,
.slide-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
}

.source-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.source-card strong {
  font-size: 16px;
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}
@media (max-width: 760px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .filters { grid-template-columns: 1fr; }
}

.advanced-search {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: -8px 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
@media (max-width: 560px) {
  .advanced-search { grid-template-columns: 1fr; }
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--gold);
  cursor: pointer;
}
.toggle-row span {
  color: var(--text);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: grid;
  gap: 14px;
  min-height: 338px;
  padding: 18px;
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(53, 215, 255, 0.34);
  background: rgba(255, 255, 255, 0.072);
}

.tool-top,
.tool-actions,
.tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-top {
  justify-content: space-between;
}

.logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--gold-2);
  font-weight: 950;
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price {
  color: var(--amber);
  font-weight: 900;
}

.tag {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.tool-card p {
  margin-bottom: 0;
  font-size: 14px;
}

.tool-actions {
  align-self: end;
  justify-content: space-between;
}

.mini-link {
  color: var(--green);
  font-weight: 900;
}

.compare-table {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

body[dir="rtl"] th,
body[dir="rtl"] td {
  text-align: right;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.studio-layout,
.media-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.panel-sub {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(111, 134, 255, 0.18);
  border-radius: 8px;
  background: var(--surface);
}

.section-head.compact {
  margin-bottom: 14px;
}

.intel-layout,
.register-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.utility-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

pre {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 44px 14px 14px;
  border: 1px solid rgba(111, 134, 255, 0.18);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--gold-2);
  white-space: pre-wrap;
}

.output-box {
  position: relative;
}

.copy-mini {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(111, 134, 255, 0.35);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--gold-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.register-form {
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: end;
}

.studio-controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.upload-box {
  padding: 18px;
  border: 1px dashed rgba(111, 134, 255, 0.55);
  border-radius: 8px;
  background: rgba(111, 134, 255, 0.08);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.video-preview-wrap,
.media-output {
  display: grid;
  gap: 14px;
}

.video-preview,
.media-preview {
  position: relative;
  display: grid;
  min-height: 220px;
  max-height: 70vh;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

/* Background-art images in the studio still fill their frame. */
.video-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Uploaded caption media scales to fit any size/aspect ratio
   without cropping or distortion. */
.media-preview img,
.media-preview video {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.caption-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.performance-chart {
  display: block;
  width: 100%;
  min-height: 200px;
  padding: 22px;
  border: 1px solid rgba(216, 183, 106, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(216,183,106,0.06), transparent 60%),
    rgba(0, 0, 0, 0.32);
}
#chart3DLabel {
  margin-bottom: 14px;
}
.live-bar-row.is-highlighted .bar-names strong {
  color: var(--gold-2);
  font-weight: 700;
}

.performance-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(111, 134, 255, 0.18);
  border-radius: 8px;
  background: var(--surface-2);
}

.performance-row {
  display: grid;
  grid-template-columns: 32px minmax(110px, 1fr) minmax(120px, 1.4fr) 42px;
  gap: 10px;
  align-items: center;
}

.performance-row strong {
  display: grid;
  gap: 3px;
}

.performance-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.performance-row em {
  display: grid;
  gap: 2px;
  color: var(--gold-2);
  font-style: normal;
  font-weight: 800;
}

.source-note {
  margin: 8px 0 18px;
  color: var(--gold-2);
  font-size: 13px;
}

.logo.small {
  width: 32px;
  height: 32px;
}

.score-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.score-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d8b76a;
}

.video-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.58);
  animation: shadeSweep var(--slide-duration, 4s) ease-in-out infinite alternate;
}

body[dir="rtl"] .video-shade {
  background: rgba(0, 0, 0, 0.58);
}

.video-copy {
  position: absolute;
  inset-inline-start: 34px;
  bottom: 34px;
  z-index: 3;
  max-width: min(74%, 620px);
}

.video-kicker,
.video-title,
.video-caption,
.video-line {
  display: block;
  animation-duration: var(--slide-duration, 4s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.video-kicker {
  margin-bottom: 12px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  animation-name: elementDrift;
}

.video-title {
  color: var(--ivory);
  font-family: Prata, Georgia, serif;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.04;
  animation-name: titleReveal;
}

body[dir="rtl"] .video-title {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  font-weight: 800;
}

.video-caption {
  max-width: 560px;
  margin-top: 14px;
  color: rgba(255, 250, 240, 0.78);
  line-height: 1.7;
  animation-name: captionRise;
}

.video-line {
  width: 132px;
  height: 2px;
  margin-top: 18px;
  background: #6f86ff;
  animation-name: lineGrow;
}

.video-progress {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  z-index: 4;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.video-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  background: #6f86ff;
  animation: progressFill var(--slide-duration, 4s) linear infinite;
}

.chart-overlay {
  position: absolute;
  right: 34px;
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: end;
  gap: 10px;
  width: min(34%, 300px);
  height: 170px;
  padding: 18px;
  border: 1px solid rgba(111, 134, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
}

body[dir="rtl"] .chart-overlay {
  right: auto;
  left: 34px;
}

.chart-overlay span {
  flex: 1;
  min-width: 8px;
  border-radius: 6px 6px 0 0;
  background: #6f86ff;
  animation: barRise var(--slide-duration, 4s) ease-in-out infinite alternate;
  transform-origin: bottom;
}

.preview-placeholder {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.motion-zoom {
  animation: motionZoom var(--slide-duration, 4s) ease-in-out infinite alternate;
}

.motion-pan {
  animation: motionPan var(--slide-duration, 4s) ease-in-out infinite alternate;
}

.motion-fade {
  animation: motionFade var(--slide-duration, 4s) ease-in-out infinite alternate;
}

.motion-rise {
  animation: motionRise var(--slide-duration, 4s) ease-in-out infinite alternate;
}

@keyframes motionZoom {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

@keyframes motionPan {
  from { transform: scale(1.08) translateX(-3%); }
  to { transform: scale(1.08) translateX(3%); }
}

@keyframes motionFade {
  from { opacity: 0.68; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1.04); }
}

@keyframes motionRise {
  from { transform: scale(1.06) translateY(3%); }
  to { transform: scale(1.06) translateY(-3%); }
}

@keyframes shadeSweep {
  from { opacity: 0.9; transform: translateX(-2%); }
  to { opacity: 0.72; transform: translateX(2%); }
}

@keyframes elementDrift {
  from { opacity: 0.72; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes titleReveal {
  from { opacity: 0.86; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes captionRise {
  from { opacity: 0.58; transform: translateY(14px); }
  to { opacity: 0.96; transform: translateY(0); }
}

@keyframes lineGrow {
  from { opacity: 0.5; transform: scaleX(0.35); transform-origin: left; }
  to { opacity: 1; transform: scaleX(1); transform-origin: left; }
}

@keyframes progressFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes barRise {
  from { transform: scaleY(0.18); opacity: 0.65; }
  to { transform: scaleY(1); opacity: 1; }
}

.studio-status {
  min-height: 24px;
  margin: 0;
  color: var(--gold-2);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.slide-item {
  display: grid;
  grid-template-columns: 64px minmax(120px, 1fr) repeat(5, minmax(110px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.slide-item img {
  width: 64px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.slide-item p {
  margin: 0;
  font-size: 13px;
}

.slide-item label {
  gap: 6px;
}

.slide-item input,
.slide-item select {
  min-height: 38px;
}

.job-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
}

.job-card,
.job-result {
  padding: 22px;
}

.job-card {
  align-content: start;
}

.job-result {
  min-height: 260px;
}

.role-list {
  display: grid;
  gap: 12px;
}

.role-item {
  padding: 14px;
}

.role-item strong {
  display: block;
  margin-bottom: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  /* the fixed sidebar becomes an off-canvas slide-out drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    flex-basis: 248px;
    width: 248px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  /* collapsed state is irrelevant on mobile — always show full drawer */
  .sidebar.collapsed {
    flex-basis: 248px;
    width: 248px;
  }
  .sidebar.collapsed .brand-name,
  .sidebar.collapsed .nav-tx,
  .sidebar.collapsed .nav-group-title,
  .sidebar.collapsed .language-select { display: revert; }
  .nav-collapse { display: none; }
  .content-area {
    width: 100%;
    padding: 0 14px 40px;
  }
  /* hamburger button to open the drawer */
  .sidebar-open {
    display: grid;
    place-items: center;
    position: sticky;
    top: 10px;
    width: 42px;
    height: 42px;
    margin: 12px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    z-index: 30;
  }
  /* dim backdrop when the drawer is open */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  .hero,
  .studio-layout,
  .media-layout,
  .job-layout {
    grid-template-columns: 1fr;
  }

  .orbital-stage {
    min-height: 450px;
  }

  .panel-main {
    inset: 18px;
  }

  .source-links,
  .tool-grid,
  .advanced-search,
  .intel-layout,
  .performance-chart,
  .register-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head,
  .web-search-form {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .section-head .search-wrap {
    width: 100%;
  }

  .chart-dashboard {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }
  .chart-dashboard > .chart-card {
    grid-column: auto;
    grid-row: auto;
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .topbar {
    top: 8px;
    margin-bottom: 34px;
  }

  .brand span:last-child {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .language-select {
    width: 96px;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 39px;
  }

  .metric-grid,
  .filters,
  .advanced-search,
  .intel-layout,
  .register-form,
  .performance-chart,
  .source-links,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .chart-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 14px;
  }
  .chart-dashboard > .chart-card {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-height: 150px;
  }
  .ranking-card {
    grid-row: auto;
  }
  .mini-stats {
    grid-template-columns: 1fr 1fr;
  }

  .panel,
  .job-card,
  .job-result {
    padding: 18px;
  }
  /* video studio — stack controls, un-stick the preview, single-column grids */
  .vstudio-stage {
    position: static;
  }
  .vstudio-block .control-grid {
    grid-template-columns: 1fr;
  }
  .vtab-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .vs-info-row {
    grid-template-columns: 1fr 1fr 28px;
  }
  /* safety net — nothing overflows the viewport on phones */
  .panel, .chart-card, .tool-card, .credit-card {
    max-width: 100%;
  }
  canvas, svg, img, video {
    max-width: 100%;
  }
  .nav {
    -webkit-overflow-scrolling: touch;
  }

  .panel-main {
    transform: none;
  }

  .panel-chip {
    display: none;
  }

  .video-preview,
  .media-preview {
    min-height: 300px;
  }

  .slide-item {
    grid-template-columns: 56px 1fr;
  }

  .slide-item label,
  .slide-item .button {
    grid-column: 1 / -1;
  }
}

/* ── AI LUXURY UPGRADES ──────────────────────────────── */
.ai-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #d8b76a 0%, #f7df9c 50%, #d8b76a 100%);
  background-size: 200% 200%;
  animation: goldShimmer 3s ease infinite;
  color: #090805;
  font-weight: 700;
  letter-spacing: 0.02em;
  gap: 8px;
  border: none;
  box-shadow: 0 0 0 1px rgba(216,183,106,0.4), 0 20px 50px rgba(216,183,106,0.25);
}

.ai-btn:hover {
  box-shadow: 0 0 0 1px rgba(216,183,106,0.7), 0 24px 60px rgba(216,183,106,0.4);
  transform: translateY(-1px);
}

.ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-btn-icon {
  font-size: 14px;
  animation: pulse 2s ease infinite;
}

@keyframes goldShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.ai-note {
  font-size: 12px;
  color: var(--bronze);
  margin: 8px 0 0;
  line-height: 1.5;
}

.ai-output {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(216,183,106,0.15);
  border-radius: 10px;
  padding: 18px;
  font-size: 13px;
  line-height: 1.75;
  color: #e8dfc8;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
  transition: border-color 0.3s;
}

.ai-output:not(:empty) {
  border-color: rgba(216,183,106,0.3);
  box-shadow: 0 0 30px rgba(216,183,106,0.05);
}

.json-out {
  color: #a8c8a8;
  border-color: rgba(168,200,168,0.15);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
}

.json-out:not(:empty) {
  border-color: rgba(168,200,168,0.3);
}

/* Highlight JSON keys */
.json-out { color: #c8e6c8; }

/* Output box upgrade */
.output-box {
  position: relative;
  margin-top: 16px;
}

.output-box .copy-mini {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 12px;
  font-size: 11px;
  min-height: 28px;
  background: rgba(216,183,106,0.12);
  border: 1px solid rgba(216,183,106,0.3);
  border-radius: 6px;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
}

.output-box .copy-mini:hover {
  background: rgba(216,183,106,0.22);
}

/* Loading animation for AI outputs */
.ai-output.loading::after {
  content: "▋";
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Caption section badge */
.eyebrow.ai-powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eyebrow.ai-powered::before {
  content: "✦";
  color: var(--gold);
}

/* Media preview enhancement */
.media-preview {
  border: 1px solid rgba(216,183,106,0.2);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}

.media-preview:has(img) {
  border-color: rgba(216,183,106,0.4);
  box-shadow: 0 0 40px rgba(216,183,106,0.08);
}

.media-preview img,
.media-preview video {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Upload box enhancement */
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed rgba(216,183,106,0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(216,183,106,0.03);
  text-align: center;
}

.upload-box:hover {
  border-color: rgba(216,183,106,0.6);
  background: rgba(216,183,106,0.06);
}

.upload-box input { display: none; }

.utility-card {
  position: relative;
  overflow: hidden;
}

.utility-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216,183,106,0.4), transparent);
}

/* ── HEADER MOTION ───────────────────────────────────── */
.topbar {
  animation: slideDown 0.6s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Compact title */
h1[data-i18n="heroTitle"] {
  font-size: clamp(32px, 4.5vw, 58px) !important;
}

/* ── MODELS TICKER ───────────────────────────────────── */
.models-ticker-wrap {
  width: 100%;
  overflow: hidden;
  padding: 10px 0;
  margin: 18px 0 30px;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.models-ticker {
  display: flex;
  gap: 0;
  width: max-content;
  animation: tickerScroll 40s linear infinite;
}
.models-ticker:hover { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 18px;
  border-right: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s;
}
.ticker-item:hover { color: var(--gold); }
.ticker-item img {
  width: 18px; height: 18px;
  border-radius: 4px;
  opacity: 0.85;
}

/* ── LIVE CHART ─────────────────────────────────────── */
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 20px;
}
.chart-tabs {
  display: flex;
  gap: 8px;
}
.chart-tab {
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.chart-tab.active,
.chart-tab:hover {
  background: rgba(216,183,106,0.12);
  border-color: rgba(216,183,106,0.4);
  color: var(--gold);
}
.live-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16,185,129,0.08);
  font-size: 12px;
  color: #10B981;
  font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: livePulse 1.5s ease infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #10B981; }
  50%       { opacity: 0.5; box-shadow: 0 0 16px #10B981; }
}
.live-chart { display: flex; flex-direction: column; gap: 10px; }
.chart-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.live-bar-row {
  display: grid;
  grid-template-columns: 220px 1fr 80px;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bar-meta img { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; }
.bar-names { min-width: 0; }
.bar-names strong { display: block; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-names small  { font-size: 10px; color: var(--muted); }
.bar-track {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
}
.bar-val {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* ── VIDEO TEMPLATE STUDIO ──────────────────────────────── */
.vstudio-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.vstudio-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.vstudio-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vstudio-label {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.vstudio-block label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.vstudio-block input[type="text"],
.vstudio-block input[type="number"],
.vstudio-block select {
  padding: 9px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
}
.template-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.template-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.template-card:hover { transform: translateY(-2px); }
.template-card.selected {
  border-color: var(--gold);
  background: rgba(216,183,106,0.1);
  box-shadow: 0 0 22px rgba(216,183,106,0.12);
}
.template-card strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
/* small template icon — a compact rounded swatch */
.template-swatch {
  width: 100%;
  height: 30px;
  border-radius: 6px;
  border: 1px solid;
  display: grid;
  place-items: center;
}
.template-swatch span {
  width: 44%;
  height: 4px;
  border-radius: 99px;
}
/* collapsible template section */
.vs-template-collapse { width: 100%; }
.vs-template-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.vs-template-summary::-webkit-details-marker { display: none; }
.vs-template-summary::after {
  content: "▾";
  color: var(--gold);
  font-size: 12px;
  margin-left: auto;
  transition: transform 0.2s ease;
}
.vs-template-collapse:not([open]) .vs-template-summary::after {
  transform: rotate(-90deg);
}
.vs-template-current {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}
.vstudio-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.vstudio-stage {
  position: sticky;
  top: 16px;
  align-self: start;
}
.vs-preview {
  display: grid;
  place-items: center;
  width: 100%;
  /* the box hugs the canvas — height follows the media's shape,
     so there's no wasted black space around a wide or tall clip */
  min-height: 260px;
  border: 1px solid rgba(216,183,106,0.2);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  padding: 10px;
}
.vs-preview canvas {
  display: block;
  /* fill available width; cap height so a tall portrait clip can't
     push the studio off-screen. Aspect ratio always preserved. */
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  border-radius: 8px;
}
@media (max-width: 860px) {
  .vstudio-layout { grid-template-columns: 1fr; }
}

/* ── ADVANCED VIDEO STUDIO — additional controls ────────── */
.upload-box.small {
  padding: 14px;
  font-size: 12px;
}
.vstudio-block .control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.vstudio-block .toggle-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}
.vstudio-block .toggle-row input {
  width: auto;
}
.vstudio-block select {
  cursor: pointer;
}
.vs-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.vs-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}
.vs-size-control input[type="range"] {
  width: 130px;
  accent-color: var(--gold);
  cursor: pointer;
}
.vs-size-control em {
  font-style: normal;
  color: var(--gold-2);
  min-width: 38px;
  text-align: right;
}
.vs-preview {
  text-align: center;
}
.vs-preview canvas {
  margin: 0 auto;
}

/* ── THEME TOGGLE ───────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--gold);
  background: rgba(216,183,106,0.1);
}
.theme-toggle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #070605 50%, #d8b76a 50%);
  border: 1px solid var(--line);
}
body.theme-light .theme-toggle-dot {
  background: linear-gradient(135deg, #f6f3fb 50%, #8b6fc7 50%);
}

/* ── ABOUT / CREDITS SECTION ────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.credit-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.credit-avatar {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Prata, serif;
  font-size: 20px;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}
.credit-meta strong {
  font-size: 16px;
  color: var(--text);
  display: block;
}
.credit-meta span {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.credit-card p {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* ── TOOL FINDER — view toggle & list mode ──────────────── */
.view-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.04);
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.view-btn svg { fill: currentColor; }
.view-btn:hover { color: var(--text); }
.view-btn.active {
  background: rgba(216,183,106,0.16);
  color: var(--gold);
}

/* List view: tools render as full-width rows */
.tool-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Compact list row — fixed small height, no oversized cards */
.tool-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.tool-row:hover { border-color: var(--gold); }
.tool-row .logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  overflow: hidden;
}
.tool-row .logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-row-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.tool-row-main h3 {
  font-size: 15px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-row-main .tag { flex-shrink: 0; font-size: 11px; }
.tool-row .price { font-size: 13px; flex-shrink: 0; white-space: nowrap; }
.tool-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tool-row-actions .button { padding: 6px 12px; font-size: 12px; }
@media (max-width: 680px) {
  .tool-row { flex-wrap: wrap; gap: 8px; }
  .tool-row-main { flex-basis: 100%; }
}

/* Jump-to highlight flash */
@keyframes toolCardFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,183,106,0); }
  30%      { box-shadow: 0 0 0 3px rgba(216,183,106,0.55), 0 0 30px rgba(216,183,106,0.3); }
}
.tool-card-flash {
  animation: toolCardFlash 1.6s ease;
  border-color: var(--gold) !important;
}

/* ── VIDEO STUDIO — category tabs ───────────────────────── */
.vtab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.vtab {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.vtab:hover { color: var(--text); }
.vtab.active {
  background: rgba(216,183,106,0.14);
  border-color: rgba(216,183,106,0.4);
  color: var(--gold);
}
.vtab-hidden { display: none !important; }

/* ── LIGHT THEME — fix hardcoded light text ─────────────────
   These selectors hardcode white/cream colors that become
   invisible on the light background. Force them to theme vars. */
body.theme-light .dash-title,
body.theme-light .welcome-card > strong,
body.theme-light .welcome-card nav a,
body.theme-light .mini-stats strong,
body.theme-light .luxury-hero h1:not(.motion-title),
body.theme-light h1, body.theme-light h2, body.theme-light h3,
body.theme-light .tool-card h3,
body.theme-light .credit-meta strong,
body.theme-light .hero-stat strong,
body.theme-light .bar-names strong,
body.theme-light .ai-output,
body.theme-light pre,
body.theme-light td, body.theme-light th {
  color: var(--text);
}
body.theme-light .luxury-hero p:not(.eyebrow),
body.theme-light .credit-card p,
body.theme-light p {
  color: var(--muted);
}
body.theme-light .badge,
body.theme-light [class*="chip"] {
  color: var(--gold-2);
}
/* SVG icons that hardcode white fill */
body.theme-light svg[fill="#ffffff"],
body.theme-light .view-btn svg {
  fill: currentColor;
}
/* Inputs/textareas readable in light mode */
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: rgba(255,255,255,0.7);
  color: var(--text);
}
body.theme-light .ai-output,
body.theme-light pre {
  background: rgba(255,255,255,0.6);
}

/* Tool count + free-toggle as a clear switch */
.tool-count {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}
.toggle-row {
  cursor: pointer;
  user-select: none;
}
.toggle-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle-row input[type="checkbox"]:checked {
  background: var(--gold);
}
.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

/* ── AE-STYLE TIMELINE STRIP ────────────────────────────── */
.vs-timeline {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}
.vs-timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.vs-play-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(216,183,106,0.14);
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}
.vs-play-btn:hover { background: rgba(216,183,106,0.26); }
.vs-timecode {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text);
}
.vs-timeline-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.vs-track-area {
  position: relative;
  padding: 8px 0;
  cursor: pointer;
}
.vs-tracks { display: flex; flex-direction: column; gap: 6px; }
.vs-track {
  display: flex;
  align-items: center;
  height: 30px;
}
.vs-track-label {
  width: 64px;
  flex-shrink: 0;
  padding-left: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vs-track-lane {
  flex: 1;
  height: 100%;
  margin-right: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  position: relative;
}
.vs-clip {
  position: absolute;
  inset: 3px 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: #0c0a06;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0.4;            /* dim until that layer has content */
  transition: opacity 0.2s;
}
.vs-clip.is-active { opacity: 1; }
.vs-clip-media { background: linear-gradient(90deg,#d8b76a,#fff0b8); }
.vs-clip-text  { background: linear-gradient(90deg,#7a9cff,#b9c8ff); }
.vs-clip-logo  { background: linear-gradient(90deg,#6fce9f,#bdeccf); }
.vs-clip-music { background: linear-gradient(90deg,#c98fe0,#e6c4f0); }
/* playhead */
.vs-playhead {
  position: absolute;
  top: 0; bottom: 0;
  left: 76px;
  width: 2px;
  background: #ff5a5a;
  pointer-events: none;
}
.vs-playhead-grip {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 13px; height: 11px;
  background: #ff5a5a;
  border-radius: 2px 2px 4px 4px;
}

/* Inline helper note inside a studio panel */
.vstudio-note {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* Price / Free badges */
.price-free {
  color: #6fce9f !important;
  font-weight: 700;
}
.price-paid {
  color: var(--muted);
}

/* Timeline undo/redo buttons */
.vs-tool-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}
.vs-tool-btn:hover:not(:disabled) {
  background: rgba(216,183,106,0.16);
  color: var(--gold);
}
.vs-tool-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* File input field inside the studio panels */
.file-field {
  display: grid;
  gap: 6px;
}
.file-field input[type="file"] {
  font-size: 13px;
  color: var(--muted);
  padding: 8px;
  min-height: auto;
}

/* ── MULTI-SLIDE SEQUENCE ───────────────────────────────── */
.vs-slide-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}
.vs-slide-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.vs-slide-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.vs-slide-row:hover { border-color: var(--gold); }
.vs-slide-row.active {
  border-color: var(--gold);
  background: rgba(216,183,106,0.12);
}
.vs-slide-num {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
}
.vs-slide-info {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vs-slide-info em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  margin-left: 6px;
}
.vs-slide-del {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.vs-slide-del:hover { background: rgba(255,90,90,0.2); color: #ff8888; }
.vs-add-slide {
  display: inline-flex;
  cursor: pointer;
}
.vs-slide-editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

/* Infographic JSON validation status */
.vs-err { color: #e8806a !important; }
.vs-ok  { color: #6fae6f !important; }

/* Active-slide indicator inside the slide editor */
.vs-active-tag {
  margin: 0 0 4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(216,183,106,0.14);
  border: 1px solid rgba(216,183,106,0.35);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}

/* Consolidated per-slide setting sections inside the Slides panel */
.vs-sec-head {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
}
.vs-slide-section {
  margin: 10px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.vs-slide-section .vstudio-label {
  margin-top: 0;
}

/* Collapsible per-slide setting sections */
details.vs-slide-section {
  margin: 10px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}
details.vs-slide-section > summary {
  margin: 0;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.vs-slide-section > summary::-webkit-details-marker { display: none; }
details.vs-slide-section > summary::after {
  content: "▾";
  color: var(--gold);
  font-size: 12px;
  transition: transform 0.2s;
}
details.vs-slide-section:not([open]) > summary::after {
  transform: rotate(-90deg);
}
details.vs-slide-section > summary:hover { color: var(--gold); }
details.vs-slide-section > *:not(summary) {
  margin-left: 14px;
  margin-right: 14px;
}
details.vs-slide-section > *:last-child { margin-bottom: 14px; }

/* Load-example button in the infographic panel */
.vs-example-btn {
  align-self: flex-start;
  margin: 4px 0 8px;
  font-size: 12px;
  padding: 7px 14px;
}

/* Infographic stat-row form */
.vs-info-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 10px;
}
.vs-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 30px;
  gap: 6px;
  align-items: center;
}
.vs-info-row input {
  width: 100%;
  min-width: 0;
}
.vs-info-del {
  width: 30px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.vs-info-del:hover { background: rgba(255,90,90,0.2); color: #ff8888; }
.vs-stat-head { margin-top: 12px; }
.vs-info-advanced {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.vs-info-advanced > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  list-style: none;
}
.vs-info-advanced > summary::-webkit-details-marker { display: none; }
.vs-info-advanced > summary:hover { color: var(--gold); }
.vs-info-adv-body { padding-top: 10px; }

/* AI generation blocks (Puter.js) — infographic + news */
.vs-ai-block {
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid rgba(216,183,106,0.4);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(216,183,106,0.10), rgba(216,183,106,0.03));
}
.vs-ai-block .vstudio-label { margin-top: 0; }
.vs-ai-block textarea {
  width: 100%;
  min-width: 0;
  margin: 8px 0;
  resize: vertical;
}
.vs-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 9px 16px;
}
.vs-ai-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.vs-ai-btn .ai-btn-icon { font-size: 13px; }

/* ── Collapsible tool category groups ──────────────────────── */
.tool-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tool-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.tool-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 700;
  font-size: 16px;
}
.tool-group-head::-webkit-details-marker { display: none; }
.tool-group-head::after {
  content: "▾";
  color: var(--gold);
  font-size: 13px;
  transition: transform 0.2s ease;
  margin-left: auto;
}
.tool-group:not([open]) .tool-group-head::after {
  transform: rotate(-90deg);
}
.tool-group-head:hover { color: var(--gold); }
.tool-group-name { letter-spacing: 0.01em; }
.tool-group-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(216,183,106,0.14);
  border: 1px solid rgba(216,183,106,0.3);
  border-radius: 99px;
  padding: 2px 10px;
}
.tool-group > .tool-grid,
.tool-group > .tool-grid.is-list {
  padding: 4px 18px 20px;
}

/* ── About section — feature highlights, stats, mission ────── */
.about-highlight {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 6px 0 22px;
  padding: 24px;
  border: 1px solid rgba(216,183,106,0.3);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(216,183,106,0.09), rgba(216,183,106,0.02));
}
.about-highlight-mark {
  flex: 0 0 auto;
  color: var(--gold);
}
.about-highlight h3 {
  margin: 0 0 6px;
  font-family: Prata, serif;
  font-size: 20px;
  color: var(--text);
}
.about-highlight p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.about-stat {
  text-align: center;
  padding: 18px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.about-stat strong {
  display: block;
  font-family: Prata, serif;
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
}
.about-stat span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.about-feature {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}
.about-feature:hover {
  border-color: rgba(216,183,106,0.4);
  transform: translateY(-3px);
}
.about-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
  color: var(--gold);
  background: rgba(216,183,106,0.12);
}
.about-feature h4 {
  margin: 12px 0 6px;
  font-size: 15px;
  color: var(--text);
}
.about-feature p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.creator-card {
  border-color: rgba(216,183,106,0.35);
  background: linear-gradient(150deg, rgba(216,183,106,0.07), transparent);
}
@media (max-width: 640px) {
  .about-highlight { flex-direction: column; text-align: center; gap: 14px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Scroll-to-top button ──────────────────────────────────── */
.scroll-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216,183,106,0.5);
  border-radius: 50%;
  background: linear-gradient(150deg, #f3dca0, #d8b76a 55%, #a8843f);
  color: #1a1408;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4), 0 0 22px rgba(216,183,106,0.25);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.scroll-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 34px rgba(0,0,0,0.45), 0 0 30px rgba(216,183,106,0.4);
}
.scroll-top-arrow {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
@media (max-width: 640px) {
  .scroll-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ── Live chart refresh control ────────────────────────────── */
.chart-live-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chart-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(216,183,106,0.4);
  border-radius: 8px;
  background: rgba(216,183,106,0.08);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.chart-refresh-btn:hover {
  background: rgba(216,183,106,0.16);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(216,183,106,0.18);
}
.chart-refresh-btn:active { transform: translateY(0); }
.chart-refresh-ic {
  font-size: 15px;
  display: inline-block;
}
.chart-refresh-btn.loading .chart-refresh-ic {
  animation: chartSpin 0.8s linear infinite;
}
@keyframes chartSpin {
  to { transform: rotate(360deg); }
}

/* ── Intro scene — background picker ───────────────────────── */
.intro-bg-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.intro-bg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s;
}
.intro-bg-card:hover { transform: translateY(-2px); }
.intro-bg-card.selected {
  border-color: var(--gold);
  background: rgba(216,183,106,0.1);
}
.intro-bg-swatch {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  border: 1px solid;
}
.intro-bg-card small {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.vs-slide-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── About — changelog / version section ───────────────────── */
.changelog {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.changelog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.changelog-head h3 {
  margin: 0;
  font-family: Prata, serif;
  font-size: 20px;
  color: var(--text);
}
.version-badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #14110b;
  background: linear-gradient(150deg, #f3dca0, #d8b76a);
  border-radius: 99px;
  padding: 4px 12px;
}
.changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.changelog-list li {
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.changelog-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.changelog-ver {
  flex: 0 0 auto;
  width: 42px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(216,183,106,0.12);
  border: 1px solid rgba(216,183,106,0.3);
  border-radius: 7px;
}
.changelog-list strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
}
.changelog-list p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.changelog-note {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* ── Segmented toggles — theme & language ──────────────────── */
.sidebar-prefs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seg-toggle {
  display: flex;
  width: 100%;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.seg-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: linear-gradient(150deg, #f3dca0, #d8b76a);
  color: #14110b;
  box-shadow: 0 2px 8px rgba(216,183,106,0.25);
}
.seg-ic { font-size: 13px; line-height: 1; }
/* collapsed sidebar — stack the toggles, icons only */
.sidebar.collapsed .sidebar-prefs {
  flex-direction: column;
  width: 100%;
}
.sidebar.collapsed .seg-toggle {
  width: 44px;
  margin: 0 auto;
}
.sidebar.collapsed .seg-tx { display: none; }
.sidebar.collapsed .seg-btn { padding: 0; min-width: 0; }

/* video-link add row in the slides panel */
.vs-link-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.vs-link-add input {
  flex: 1 1 auto;
  min-width: 0;
}

/* auto story builder */
.vs-auto-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
#vsAutoTopic {
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

/* per-slide footage upload button */
.vs-slide-footage {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
  cursor: pointer;
}

/* global colour filter control at the top of the slides panel */
.vs-global-filter {
  display: block;
  margin: 4px 0 12px;
}
