/* ── LecturAI Design System ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  --primary: #1A73E8;
  --primary-dark: #1557B0;
  --primary-light: #E8F0FE;
  --accent: #1967D2;
  --text: #202124;
  --text-muted: #5F6368;
  --border: #DADCE0;
  --bg: #F8F9FA;
  --white: #ffffff;
  --surface: #F1F3F4;
  --error: #D93025;
  --success: #188038;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(60,64,67,.1), 0 2px 6px rgba(60,64,67,.08);
  --shadow-md: 0 2px 8px rgba(60,64,67,.12), 0 4px 16px rgba(60,64,67,.08);
  --shadow-lg: 0 8px 24px rgba(60,64,67,.14), 0 2px 8px rgba(60,64,67,.1);
  --font: 'Google Sans', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--white); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
img { max-width: 100%; }

/* ── Scroll-reveal entrance ──────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ── Button ripple (JS adds .ripple class) ───────────────────────────────── */
.btn { position: relative; overflow: hidden; }
.btn-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0); animation: rippleAnim .5s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 0.92rem;
  font-weight: 600; border: 2px solid transparent; transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-light); }
.btn-large { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-icon { background: none; border: none; color: var(--text-muted); font-size: 1rem; padding: 4px 8px; border-radius: 4px; }
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 0;
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-text { font-size: 1.15rem; font-weight: 700; color: var(--primary); letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link { padding: 7px 14px; border-radius: 20px; font-size: 0.88rem; color: var(--text-muted); font-weight: 500; transition: all .15s; }
.nav-link:hover { color: var(--text); background: var(--surface); }

/* ── Hamburger menu ──────────────────────────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px; background: none; border: none;
  cursor: pointer; padding: 4px; border-radius: 8px; margin-left: auto;
  transition: background .15s;
}
.hamburger:hover { background: var(--surface); }
.hamburger-line {
  width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ───────────────────────────────────────────────────── */
.mobile-nav {
  display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 99; opacity: 0;
  transition: opacity .25s;
}
.mobile-nav.open { opacity: 1; }
.mobile-nav-inner {
  background: var(--white); padding: 16px 20px 32px;
  display: flex; flex-direction: column; gap: 4px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.mobile-nav-link {
  display: block; padding: 12px 16px; border-radius: 8px; font-size: .95rem;
  font-weight: 500; color: var(--text); text-decoration: none; transition: background .15s;
}
.mobile-nav-link:hover { background: var(--surface); }
.mobile-nav-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-nav-auth { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 0; }

@media (max-width: 768px) {
  .nav { display: none; }
  .auth-area { display: none; }
  .user-area { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; pointer-events: none; }
  .mobile-nav.open { pointer-events: all; }
  .header-inner { gap: 16px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 16px; }
  .logo-text { font-size: 1rem; }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero-section {
  padding: 80px 0 70px;
  background: linear-gradient(160deg, #EAF1FD 0%, #F0F4FF 50%, #F8F9FA 100%);
  overflow: hidden;
  position: relative;
}
.hero-section--animated { }

/* Floating orbs */
.hero-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hero-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .25;
}
.hero-orb--1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #4285F4, transparent 70%);
  top: -100px; right: -80px;
  animation: orbFloat1 10s ease-in-out infinite;
}
.hero-orb--2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #34A853, transparent 70%);
  bottom: -60px; left: -60px;
  animation: orbFloat2 12s ease-in-out infinite;
}
.hero-orb--3 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, #FBBC04, transparent 70%);
  top: 40%; left: 40%;
  animation: orbFloat3 9s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-24px) scale(1.04)} }
@keyframes orbFloat2 { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(20px) scale(1.06)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(16px,-12px)} 66%{transform:translate(-10px,18px)} }

/* Hero layout */
.hero-container { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-container { grid-template-columns: 1fr; } .hero-right { display: none; } }

/* Hero left */
.hero-left { }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.95); border: 1px solid #BDD3F8;
  border-radius: 100px; padding: 6px 16px; font-size: 0.82rem;
  font-weight: 600; color: var(--primary); margin-bottom: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(26,115,232,.1);
  animation: slideDown .5s ease both;
}
.hero-badge--animated { }
.hero-badge-dot {
  width: 8px; height: 8px; background: #10B981; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16,185,129,.5);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Typewriter */
.typewriter-wrap { display: inline-block; }
.typewriter { border-right: 3px solid var(--primary); padding-right: 4px; }

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 20px;
  animation: slideUp .6s ease .1s both;
}
.gradient-text {
  background: linear-gradient(135deg, #1A73E8, #0F52BA);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-subtitle {
  font-size: 1.08rem; color: var(--text-muted); max-width: 480px;
  margin-bottom: 32px; line-height: 1.65;
  animation: slideUp .6s ease .2s both;
}
.hero-cta-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  animation: slideUp .6s ease .3s both;
}
.hero-cta-sub {
  font-size: 0.78rem; color: var(--text-muted);
  animation: slideUp .6s ease .35s both;
}

/* Pulsing primary CTA */
.hero-btn-pulse {
  position: relative;
  box-shadow: 0 0 0 0 rgba(26,115,232,.4);
  animation: heroCtaPulse 2.5s ease-in-out 1.5s infinite;
}
@keyframes heroCtaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,115,232,.4); }
  70%  { box-shadow: 0 0 0 14px rgba(26,115,232,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,115,232,0); }
}

/* Hero stats */
.hero-stats {
  display: flex; align-items: center; gap: 20px; margin-top: 28px; flex-wrap: wrap;
  animation: slideUp .6s ease .45s both;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hero-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.hero-stat > span:nth-child(2) { font-size: 1rem; font-weight: 700; color: var(--primary); line-height: 1; }
.hero-stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; text-align: center; margin-top: 2px; }
.hero-stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Hero Demo Card (right side) ─────────────────────────────────────────── */
.hero-right { position: relative; }
.hero-demo-card {
  background: var(--white); border-radius: 16px;
  box-shadow: 0 24px 80px rgba(26,115,232,.14), 0 4px 16px rgba(0,0,0,.08);
  overflow: hidden;
  animation: cardEntrance .7s cubic-bezier(.22,.68,0,1.2) .4s both;
  border: 1px solid rgba(199,210,254,.6);
}
@keyframes cardEntrance { from { opacity:0; transform: translateY(32px) scale(.97); } to { opacity:1; transform:none; } }

.demo-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #202124;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.demo-dots { display: flex; gap: 6px; }
.demo-dot { width: 12px; height: 12px; border-radius: 50%; }
.demo-dot--red { background: #FF5F57; }
.demo-dot--yellow { background: #FEBC2E; }
.demo-dot--green { background: #28C840; }
.demo-card-title { font-size: 0.75rem; color: rgba(255,255,255,.5); font-family: 'Courier New', monospace; }

.demo-card-body { padding: 18px 20px; }

/* Demo progress bar */
.demo-progress-wrap { background: #F3F4F6; border-radius: 100px; height: 6px; overflow: hidden; margin-bottom: 14px; }
.demo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  animation: demoProgress 3s ease-in-out infinite;
}
@keyframes demoProgress {
  0%   { width: 0%; }
  30%  { width: 40%; }
  60%  { width: 75%; }
  85%  { width: 92%; }
  100% { width: 100%; }
}

/* Demo steps */
.demo-step {
  font-size: 0.8rem; padding: 5px 0; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.demo-step--done { color: var(--success); }
.demo-step--active {
  color: var(--primary); font-weight: 600;
  animation: stepBlink 1.2s ease-in-out infinite;
}
@keyframes stepBlink { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Demo result (fades in after delay) */
.demo-result {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  animation: demoResultReveal 1s ease 2.5s both;
}
@keyframes demoResultReveal { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.demo-result-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 10px; }
.demo-chapter { margin-bottom: 8px; }
.demo-chapter-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 4px; margin-bottom: 2px;
}
.demo-chapter-text { font-size: 0.78rem; color: var(--text-muted); }
.demo-keypoints { margin-top: 10px; }
.demo-kp { font-size: 0.75rem; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.demo-kp-item {
  font-size: 0.75rem; color: var(--text-muted); padding: 2px 0;
  opacity: 0;
}
.demo-kp-item--1 { animation: kpReveal .4s ease 3.2s forwards; }
.demo-kp-item--2 { animation: kpReveal .4s ease 3.7s forwards; }
.demo-kp-item--3 { animation: kpReveal .4s ease 4.2s forwards; }
@keyframes kpReveal { from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:none} }

/* Floating badges */
.demo-float {
  position: absolute;
  font-size: 0.75rem; font-weight: 700;
  padding: 7px 14px; border-radius: 100px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.demo-float--1 {
  background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0;
  top: -16px; right: 40px;
  animation: floatBadge1 3s ease-in-out 4.5s infinite both;
}
.demo-float--2 {
  background: var(--primary-light); color: var(--primary); border: 1px solid #BDD3F8;
  bottom: 20px; left: -30px;
  animation: floatBadge2 3.5s ease-in-out 5s infinite both;
}
@keyframes floatBadge1 { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-8px) rotate(1deg)} }
@keyframes floatBadge2 { 0%,100%{transform:translateY(0) rotate(2deg)} 50%{transform:translateY(-6px) rotate(-1deg)} }

/* General entrance animations */
@keyframes slideDown { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:none} }
@keyframes slideUp   { from{opacity:0;transform:translateY(16px)}  to{opacity:1;transform:none} }

/* Legacy compat */
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.social-proof { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin-top: 48px; }
.sp-item { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); }

/* ── Ad Banner ───────────────────────────────────────────────────────────── */
.ad-banner { padding: 12px 0; min-height: 80px; }
.ad-inline { margin: 24px 0; min-height: 80px; }

/* ── App Section ─────────────────────────────────────────────────────────── */
.app-section { padding: 60px 0; background: var(--bg); }
.app-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }

.app-panel {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 32px; box-shadow: var(--shadow);
}
.panel-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 24px;
  text-align: center; cursor: pointer; transition: all .2s; background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.drop-icon { margin-bottom: 12px; }
.drop-title { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.drop-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }

/* File preview */
.file-preview { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--primary-light); border-radius: var(--radius-sm); margin-top: 12px; }
.file-icon { font-size: 1.8rem; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 500; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 0.8rem; color: var(--text-muted); }

/* Settings */
.settings-row { margin: 16px 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; font-weight: 500; }
.hint { color: var(--text-muted); font-weight: 400; }
.form-select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: var(--font); background: var(--white); }
.form-select:focus { outline: none; border-color: var(--primary); }

.privacy-note { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* ── Idle state ──────────────────────────────────────────────────────────── */
.idle-state { text-align: center; padding: 40px 20px; }
.idle-icon { font-size: 3rem; margin-bottom: 16px; }
.idle-state h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.idle-state p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.idle-features { list-style: none; text-align: left; display: inline-block; }
.idle-features li { font-size: 0.88rem; color: var(--text-muted); padding: 3px 0; }

/* ── Progress state ──────────────────────────────────────────────────────── */
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-header h3 { font-size: 1rem; font-weight: 600; }
.progress-pct { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.progress-bar-wrap { background: var(--bg); border-radius: 100px; height: 8px; overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 100px; transition: width .4s ease; width: 0%; }
.progress-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.pipeline-steps { display: flex; flex-direction: column; gap: 8px; }
.step { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); transition: all .3s; }
.step.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.step.done { background: #ECFDF5; color: var(--success); border-color: #A7F3D0; }
.progress-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 16px; }

/* ── Error state ─────────────────────────────────────────────────────────── */
.error-state { text-align: center; padding: 32px 20px; }
.error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-state h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--error); }
.error-msg { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; max-height: 120px; overflow-y: auto; }

/* ── Result state ────────────────────────────────────────────────────────── */
.result-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.result-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.result-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.meta-badge { padding: 3px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 100px; font-size: 0.76rem; color: var(--text-muted); }
.export-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tabs */
.result-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 8px 16px; border: none; background: none; font-size: 0.88rem; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; white-space: nowrap; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Tab toolbar */
.tab-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-count { font-size: 0.82rem; color: var(--text-muted); flex: 1; }
.search-input { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.88rem; font-family: var(--font); flex: 1; min-width: 160px; }
.search-input:focus { outline: none; border-color: var(--primary); }
.search-info { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; padding: 4px 0; }
mark { background: #FEF08A; border-radius: 2px; padding: 0 2px; }

/* Scene context card */
.scene-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; background: var(--white); position: relative; overflow: hidden; }
.scene-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.scene-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.scene-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.scene-header-text { flex: 1; min-width: 0; }
.scene-type-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.scene-type { font-size: 1rem; font-weight: 700; color: var(--text); }
.scene-confidence { font-size: 0.75rem; background: var(--success); color: #fff; padding: 2px 8px; border-radius: 100px; font-weight: 600; }
.scene-description { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.scene-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.scene-detail-item { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.scene-detail-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.scene-detail-value { font-size: 0.85rem; color: var(--text); line-height: 1.4; }
.scene-notable { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.scene-notable-tag { font-size: 0.78rem; background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: 100px; font-weight: 500; }

/* Overview */
.overview-card { background: var(--primary-light); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.overview-text { font-size: 0.95rem; line-height: 1.7; color: var(--text); }
.action-items { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius); padding: 16px; }
.action-items h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.action-items ul { list-style: none; }
.action-items li { font-size: 0.88rem; padding: 4px 0; display: flex; gap: 8px; align-items: flex-start; }
.action-items li::before { content: "→"; color: var(--primary); flex-shrink: 0; }

/* Chapters */
.chapter-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; transition: box-shadow .15s; }
.chapter-card:hover { box-shadow: var(--shadow); }
.chapter-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.chapter-title { font-size: 0.95rem; font-weight: 600; }
.chapter-ts { font-size: 0.8rem; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.chapter-summary { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }
.chapter-points { list-style: none; }
.chapter-points li { font-size: 0.84rem; color: var(--text-muted); padding: 2px 0 2px 14px; position: relative; }
.chapter-points li::before { content: "·"; position: absolute; left: 4px; color: var(--primary); }

/* Key points */
.keypoint-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.keypoint-item:last-child { border-bottom: none; }
.kp-ts { font-size: 0.8rem; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.kp-text { font-size: 0.9rem; line-height: 1.5; }

/* Terms */
.term-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.term-item:last-child { border-bottom: none; }
.term-name { font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.term-def { font-size: 0.88rem; color: var(--text-muted); margin-top: 2px; }

/* Transcript */
.transcript-wrap { max-height: 400px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.transcript-text { font-family: 'Courier New', monospace; font-size: 0.82rem; padding: 16px; white-space: pre-wrap; line-height: 1.7; color: var(--text); }

/* Result footer */
.result-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.share-row { display: flex; align-items: center; gap: 8px; }
.share-label { font-size: 0.82rem; color: var(--text-muted); }
.share-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); font-size: 0.82rem; transition: all .15s; }
.share-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Input toggle (file/URL) ─────────────────────────────────────────────── */
.input-toggle { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; }
.input-toggle-btn { flex: 1; padding: 7px 12px; border: none; background: none; border-radius: 6px; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); transition: all .15s; font-family: var(--font); }
.input-toggle-btn.active { background: var(--white); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }

.url-input-wrap { position: relative; }
.url-input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: var(--font); transition: border-color .15s; }
.url-input:focus { outline: none; border-color: var(--primary); }
.url-input.valid { border-color: var(--success); }
.url-platform { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 0.78rem; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 4px; pointer-events: none; }
.url-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

/* ── Chat / Dialog tab ───────────────────────────────────────────────────── */
.tab-btn-chat { color: var(--primary) !important; font-weight: 600 !important; }
.chat-wrap { display: flex; flex-direction: column; height: 460px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 4px 0 12px; display: flex; flex-direction: column; gap: 12px; }
.chat-welcome { text-align: center; padding: 24px 16px; color: var(--text-muted); }
.chat-welcome-icon { font-size: 2.5rem; margin-bottom: 10px; }
.chat-welcome-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.chat-welcome-sub { font-size: 0.85rem; margin-bottom: 14px; }
.chat-suggestions { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.chat-suggestion { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 0.82rem; cursor: pointer; transition: all .15s; color: var(--text); font-family: var(--font); text-align: left; width: 100%; max-width: 360px; }
.chat-suggestion:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; font-weight: 700; }
.chat-msg.user .chat-avatar { background: var(--primary); color: #fff; }
.chat-msg.ai .chat-avatar { background: var(--primary-light); color: var(--primary); }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 0.88rem; line-height: 1.6; }
.chat-msg.user .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai .chat-bubble { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.typing { color: var(--text-muted); font-style: italic; }
.chat-input-row { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.chat-input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: var(--font); }
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-send-btn { width: 40px; height: 40px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.chat-send-btn:hover { background: var(--primary-dark); }
.chat-send-btn:disabled { background: var(--border); cursor: not-allowed; }

/* ── Conversation tab ────────────────────────────────────────────────────── */
.conversation-list { display: flex; flex-direction: column; gap: 12px; max-height: 500px; overflow-y: auto; padding-right: 4px; }
.conv-turn { display: flex; gap: 10px; align-items: flex-start; }
.conv-turn.conv-right { flex-direction: row-reverse; }
.conv-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; background: var(--primary-light); color: var(--primary); text-align: center; line-height: 1.2; }
.conv-turn.conv-right .conv-avatar { background: #F3E8FF; color: var(--accent); }
.conv-body { max-width: 78%; }
.conv-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.conv-speaker { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.conv-turn.conv-right .conv-meta { flex-direction: row-reverse; }
.conv-ts { font-size: 0.72rem; color: var(--text-muted); }
.conv-tone { font-size: 0.68rem; padding: 1px 6px; border-radius: 100px; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.conv-bubble { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; border-top-left-radius: 4px; padding: 10px 14px; font-size: 0.88rem; line-height: 1.6; color: var(--text); }
.conv-turn.conv-right .conv-bubble { background: var(--primary-light); border-color: #BDD3F8; border-top-right-radius: 4px; border-top-left-radius: 12px; }

/* ── Vocabulary tab ──────────────────────────────────────────────────────── */
.vocabulary-list { display: flex; flex-direction: column; gap: 0; }
.vocab-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.vocab-item:last-child { border-bottom: none; }
.vocab-item[data-hidden="true"] { display: none; }
.vocab-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.vocab-word { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.vocab-pos { font-size: 0.72rem; background: var(--bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; color: var(--text-muted); font-weight: 500; }
.vocab-pronunciation { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.vocab-difficulty { font-size: 0.68rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; }
.vocab-difficulty.basic { background: #ECFDF5; color: #059669; }
.vocab-difficulty.intermediate { background: #FFFBEB; color: #D97706; }
.vocab-difficulty.advanced { background: #FEF2F2; color: #DC2626; }
.vocab-ts { font-size: 0.72rem; color: var(--primary); background: var(--primary-light); padding: 2px 7px; border-radius: 4px; margin-left: auto; }
.vocab-def { font-size: 0.88rem; color: var(--text); margin-bottom: 5px; line-height: 1.5; }
.vocab-example { font-size: 0.82rem; color: var(--text-muted); font-style: italic; margin-bottom: 5px; }
.vocab-synonyms { display: flex; flex-wrap: wrap; gap: 5px; }
.vocab-syn { font-size: 0.75rem; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 100px; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-box { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-box--sm { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; flex-shrink: 0; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; line-height: 1; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 16px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 24px 20px; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; border-top: 1px solid var(--border); }

/* PDF editor options */
.pdf-options-grid { display: flex; flex-direction: column; gap: 16px; }
.pdf-option-group { display: flex; flex-direction: column; gap: 6px; }
.pdf-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.pdf-input { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: var(--font); width: 100%; }
.pdf-input:focus { outline: none; border-color: var(--primary); }
.pdf-checks { display: flex; flex-direction: column; gap: 6px; }
.pdf-check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; cursor: pointer; }
.pdf-check input { accent-color: var(--primary); width: 15px; height: 15px; }
.pdf-frames-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.pdf-frame-item { position: relative; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all .15s; aspect-ratio: 16/9; }
.pdf-frame-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdf-frame-item.selected { border-color: var(--primary); }
.pdf-frame-item.selected::after { content: '✓'; position: absolute; top: 4px; right: 4px; background: var(--primary); color: #fff; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }

/* Translate status */
.translate-status { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; }
.translate-status.loading { background: var(--primary-light); color: var(--primary); }
.translate-status.success { background: #ECFDF5; color: #059669; }
.translate-status.error { background: #FEF2F2; color: #DC2626; }
.translated-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--primary); font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 100px; margin-left: 8px; cursor: pointer; }
.translated-badge:hover { background: #BDD3F8; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section-light { padding: 80px 0; background: var(--bg); }
.section-white { padding: 80px 0; background: var(--white); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text-muted); font-size: 1.05rem; margin-bottom: 48px; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 768px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card { text-align: center; padding: 32px 24px; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); }
.step-num { width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 700; margin: 0 auto 12px; }
.step-icon { font-size: 2rem; margin-bottom: 12px; }
.step-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 0.88rem; color: var(--text-muted); }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); transition: box-shadow .2s; }
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Pricing */
/* Pricing: old 3-col kept for compat, new 2-col overrides */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; } }

/* New 2-col pricing */
.pricing-eyebrow { text-align: center; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); margin-bottom: 12px; }
.pricing-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 28px; align-items: start;
  max-width: 800px; margin: 0 auto 32px;
}
@media (max-width: 700px) { .pricing-grid-2 { grid-template-columns: 1fr; max-width: 420px; } }

.pricing-card {
  padding: 32px 28px; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--white);
  position: relative; transition: transform .2s, box-shadow .2s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.pricing-card--free { }
.pricing-card--pro { }
.pricing-card--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #D2E3FC, 0 12px 40px rgba(26,115,232,.12);
}
.pricing-card--featured:hover { box-shadow: 0 0 0 3px #D2E3FC, 0 20px 60px rgba(26,115,232,.18); }

.pricing-badge-top {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--primary), #1557B0);
  color: #fff; font-size: 0.75rem; font-weight: 700;
  padding: 5px 16px; border-radius: 100px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(26,115,232,.3);
  animation: badgePop .4s cubic-bezier(.22,.68,0,1.4) .8s both;
}
@keyframes badgePop { from{opacity:0;transform:translateX(-50%) scale(.7)} to{opacity:1;transform:translateX(-50%) scale(1)} }

.pricing-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 100px; white-space: nowrap; }
.pricing-tier-icon { font-size: 2rem; margin-bottom: 8px; }
.pricing-tier { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.pro-label { color: var(--primary) !important; }
.pricing-price { font-size: 2.6rem; font-weight: 800; margin-bottom: 8px; line-height: 1; }
.pricing-price--pro { color: var(--primary); }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.pricing-divider { height: 1px; background: var(--border); margin: 16px 0; }

.pricing-features { list-style: none; margin-bottom: 24px; display: flex; flex-direction: column; gap: 2px; }
.pricing-features li { font-size: 0.88rem; padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--text); display: flex; align-items: flex-start; gap: 8px; }
.pricing-features li:last-child { border: none; }
.pf-check { flex-shrink: 0; font-weight: 700; color: var(--success); }
.pf-check--pro { color: var(--primary); }

.pricing-btn { transition: all .15s; }
.pricing-btn--pro {
  background: var(--primary);
  border: none;
  box-shadow: 0 4px 16px rgba(26,115,232,.3);
  font-size: 0.95rem;
}
.pricing-btn--pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,115,232,.4);
  background: var(--primary-dark);
}

.pricing-guarantee { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 10px; }

.pricing-nudge {
  max-width: 800px; margin: 0 auto;
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; color: var(--text);
}
.pricing-nudge span:first-child { font-size: 1.2rem; flex-shrink: 0; }

/* Duration pricing table */
.duration-pricing-table { max-width: 860px; margin: 0 auto; }
.dur-table { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; overflow: hidden; }
.dur-row {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
  padding: 11px 18px; gap: 10px; font-size: 13px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  align-items: center;
}
.dur-row:last-child { border-bottom: none; }
.dur-header {
  background: #f8fafc; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; color: #64748b;
}
.dur-cost {
  display: inline-block; background: #ede9fe; color: #7c3aed;
  border-radius: 12px; padding: 2px 10px; font-weight: 600; font-size: 12px;
}
.dur-label { font-size: 11px; color: #94a3b8; margin-left: 4px; }
.dur-ok   { color: #059669; font-size: 12px; }
.dur-warn { color: #d97706; font-size: 12px; }
.dur-no   { color: #9ca3af; font-size: 12px; }
@media (max-width: 640px) {
  .dur-row { grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 14px; }
  .dur-header div:nth-child(3), .dur-header div:nth-child(4) { display: none; }
  .dur-row div:nth-child(3), .dur-row div:nth-child(4) { display: none; }
}

/* FAQ */
.faq-container { max-width: 720px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-item summary { padding: 16px 20px; font-weight: 500; font-size: 0.95rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; color: var(--primary); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 20px 16px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Credit indicator (above submit button) ──────────────────────────────── */
.credit-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.84rem; margin-bottom: 10px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid #BDD3F8;
}
.credit-indicator.warn {
  background: #FEF3C7; color: #92400E; border-color: #FDE68A;
}
.credit-indicator.danger {
  background: #FEE2E2; color: #991B1B; border-color: #FECACA;
}
.credit-dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  flex-shrink: 0; opacity: .7;
}

/* ── Google Sign-In button ───────────────────────────────────────────────── */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px 16px; border-radius: 8px;
  border: 1.5px solid #dadce0; background: #fff; color: #3c4043;
  font-size: .92rem; font-weight: 500; cursor: pointer;
  transition: background .15s, box-shadow .15s; text-decoration: none;
  font-family: inherit;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.btn-google svg { flex-shrink: 0; }

/* Auth modal divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: .82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Password toggle */
.password-field { position: relative; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: .85rem; padding: 4px; line-height: 1;
}
.password-toggle:hover { color: var(--text); }

/* Password strength bar */
.pw-strength { margin-top: 6px; }
.pw-strength-bar {
  height: 3px; border-radius: 2px; background: var(--border);
  overflow: hidden; margin-bottom: 4px;
}
.pw-strength-fill {
  height: 100%; border-radius: 2px; width: 0;
  transition: width .3s, background .3s;
}
.pw-strength-fill.weak   { background: #EF4444; width: 33%; }
.pw-strength-fill.fair   { background: #F59E0B; width: 66%; }
.pw-strength-fill.strong { background: #10B981; width: 100%; }
.pw-strength-label { font-size: .72rem; color: var(--text-muted); }

/* Auth success state */
.auth-success {
  text-align: center; padding: 24px 16px;
}
.auth-success-icon { font-size: 2.5rem; margin-bottom: 12px; }
.auth-success h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.auth-success p { font-size: .88rem; color: var(--text-muted); }

/* ── Auth header area ────────────────────────────────────────────────────── */
.auth-area { display: flex; align-items: center; gap: 8px; }
.user-area { position: relative; }
.user-badge { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: background .15s; }
.user-badge:hover { background: var(--gray-50); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.user-tier-badge { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 100px; text-transform: uppercase; letter-spacing: .04em; background: var(--primary-light); color: var(--primary); }
.user-tier-badge.pro { background: #FEF3C7; color: #92400E; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 200px; z-index: 200; overflow: hidden; }
.user-menu-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.user-menu-email { font-size: .82rem; color: var(--text-muted); word-break: break-all; }
.user-menu-usage { font-size: .8rem; color: var(--text); margin-top: 4px; font-weight: 500; }
.user-menu-credits {
  margin-top: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--primary-light); border: 1px solid #BDD3F8;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.user-menu-credits.warn  { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.user-menu-credits.danger { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }
.user-menu-item { display: block; width: 100%; text-align: left; padding: 10px 16px; font-size: .88rem; background: none; border: none; cursor: pointer; color: var(--text); transition: background .15s; }
.user-menu-item:hover { background: var(--gray-50); }

/* ── Profile modal tabs ──────────────────────────────────────────────────── */
.profile-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); padding: 0 24px; background: var(--bg,#F9FAFB); }
.profile-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 10px 16px; font-size: .85rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap; }
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.ptab { }
.ptab.hidden { display: none; }

/* ── Summary history list ────────────────────────────────────────────────── */
.summary-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.summary-history-item:last-child { border-bottom: none; }
.shi-title { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.shi-meta { font-size: .76rem; color: var(--text-muted); }
.shi-actions { flex-shrink: 0; }

/* ── PDF Modal info banner ───────────────────────────────────────────────── */
.pdf-info-banner { display: flex; gap: 12px; align-items: flex-start; background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.pdf-info-icon { font-size: 1.4rem; flex-shrink: 0; }
.pdf-info-banner strong { display: block; font-size: .88rem; font-weight: 700; color: #3730A3; margin-bottom: 3px; }
.pdf-info-banner p { font-size: .8rem; color: #4338CA; line-height: 1.5; margin: 0; }

/* ── Profile / Account Settings Modal ───────────────────────────────────── */
.profile-section { margin-bottom: 24px; }
.profile-section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: .88rem; }
.profile-label { color: var(--text-muted); }
.profile-value { font-weight: 500; text-align: right; word-break: break-all; }
.profile-pw-fields { display: flex; flex-direction: column; gap: 10px; }
.profile-pw-fields .btn { align-self: flex-start; }
/* Usage bar */
.profile-usage-bar-wrap { margin-bottom: 10px; }
.profile-usage-bar-track { height: 10px; background: var(--gray-100,#F3F4F6); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.profile-usage-bar-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s; }
.profile-usage-bar-fill.warn { background: #F59E0B; }
.profile-usage-bar-fill.danger { background: #EF4444; }
.profile-usage-bar-labels { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-muted); }
.profile-usage-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-usage-pill { background: var(--gray-50,#F9FAFB); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: .78rem; color: var(--text); }
/* Plan comparison table */
.profile-compare-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 8px; }
.profile-compare-table th { padding: 6px 8px; text-align: center; font-weight: 700; border-bottom: 2px solid var(--border); }
.profile-compare-table th:first-child { text-align: left; }
.profile-compare-table td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.profile-compare-table td:first-child { text-align: left; color: var(--text); }
.profile-compare-table td strong { color: var(--primary); }

/* ── Auth modal forms ────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-field .form-label { display: block; margin-bottom: 5px; font-size: .85rem; font-weight: 500; }
.auth-error { background: #FEE2E2; color: #991B1B; font-size: .84rem; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.auth-switch { text-align: center; font-size: .84rem; color: var(--text-muted); margin-top: 14px; }
.auth-switch a { color: var(--primary); font-weight: 500; }
.auth-terms { text-align: center; font-size: .76rem; color: var(--text-muted); margin-top: 10px; }
.auth-terms a { color: var(--primary); }

/* ── Support / Contact section ───────────────────────────────────────────── */
.support-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .support-grid { grid-template-columns: 1fr; } }
.support-form-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.support-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.support-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .support-fields { grid-template-columns: 1fr; } }
.support-textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.contact-status { font-size: .88rem; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.contact-status.success { background: #D1FAE5; color: #065F46; }
.contact-status.error { background: #FEE2E2; color: #991B1B; }
.support-info { display: flex; flex-direction: column; gap: 16px; }
.support-info-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; }
.support-info-icon { font-size: 1.5rem; margin-bottom: 8px; }
.support-info-card h4 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.support-info-card p { font-size: .86rem; color: var(--text-muted); line-height: 1.5; }
.support-info-card a { color: var(--primary); font-weight: 500; }
.support-info-sub { font-size: .8rem !important; margin-top: 4px; }

/* ── Login required banner ───────────────────────────────────────────────── */
.login-required-banner { background: var(--primary-light); border: 1px solid #BDD3F8; border-radius: 8px; padding: 10px 14px; font-size: .85rem; color: var(--primary); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.login-required-banner button { margin-left: auto; font-size: .82rem; font-weight: 600; background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 5px 12px; cursor: pointer; }

/* ── Hero dual CTA ───────────────────────────────────────────────────────── */
.hero-dual-cta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; max-width: 720px; margin: 0 auto 40px; }
@media (max-width: 700px) { .hero-dual-cta { grid-template-columns: 1fr; } .hero-cta-divider { display: none; } }
.hero-cta-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; text-align: left; box-shadow: var(--shadow); }
.hero-cta-card--accent { border-color: #BDD3F8; background: linear-gradient(135deg, #EAF1FD 0%, #E8F0FE 100%); }
.hero-cta-icon { font-size: 2rem; margin-bottom: 10px; }
.hero-cta-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.hero-cta-card p { font-size: .84rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.hero-cta-divider { font-size: .88rem; font-weight: 600; color: var(--text-muted); text-align: center; }
.btn-accent { background: #1967D2; color: #fff; border-color: #1967D2; }
.btn-accent:hover { background: #1557B0; border-color: #1557B0; transform: translateY(-1px); }

/* ── Nav highlight ───────────────────────────────────────────────────────── */
.nav-link-highlight { color: var(--primary) !important; font-weight: 600; background: var(--primary-light); }
.nav-link-highlight:hover { background: #D2E3FC !important; }

/* ── Downloader section ──────────────────────────────────────────────────── */
.downloader-section { padding: 80px 0; background: linear-gradient(180deg, #EAF1FD 0%, #F0F4FF 30%, var(--white) 100%); }
.dl-header { text-align: center; margin-bottom: 32px; }
.dl-badge { display: inline-block; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 700; padding: 5px 14px; border-radius: 100px; margin-bottom: 16px; letter-spacing: .06em; text-transform: uppercase; }
.dl-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.dl-subtitle { font-size: 1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* Platforms strip */
.dl-platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px; }
.dl-platform { font-size: .8rem; font-weight: 600; padding: 5px 14px; border-radius: 100px; background: var(--white); border: 1px solid #BDD3F8; color: var(--primary); }
.dl-platform--more { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Downloader card */
.dl-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid #BDD3F8; padding: 28px; box-shadow: var(--shadow-md); max-width: 760px; margin: 0 auto; }
.dl-input-row { display: flex; gap: 10px; margin-bottom: 4px; }
.dl-url-input { flex: 1; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .95rem; font-family: var(--font); transition: border-color .15s; }
.dl-url-input:focus { outline: none; border-color: var(--primary); }
.dl-url-input.valid { border-color: var(--success); }

/* Meta preview */
.dl-meta { margin-top: 20px; }
.dl-meta-inner { display: grid; grid-template-columns: 160px 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 560px) { .dl-meta-inner { grid-template-columns: 1fr; } }
.dl-thumb { width: 160px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.dl-meta-title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.dl-meta-sub { display: flex; flex-wrap: wrap; gap: 8px; font-size: .8rem; color: var(--text-muted); margin-bottom: 12px; }
.dl-meta-sub span::before { content: "·"; margin-right: 8px; }
.dl-meta-sub span:first-child::before { content: ""; margin-right: 0; }
.dl-options-row { display: flex; gap: 12px; flex-wrap: wrap; }
.dl-option-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.dl-opt-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.dl-select { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; font-family: var(--font); background: var(--white); }
.dl-select:focus { outline: none; border-color: var(--primary); }
.dl-format-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.dl-login-note { background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 8px; padding: 8px 12px; font-size: .84rem; margin-bottom: 10px; }
.dl-login-note a { color: var(--primary); font-weight: 600; }

/* Download progress */
.dl-progress { margin-top: 16px; }
.dl-prog-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .88rem; }
.dl-prog-pct { font-weight: 700; color: var(--primary); }

/* Download ready */
.dl-ready { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 16px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 10px; }
.dl-ready-icon { width: 36px; height: 36px; background: var(--success); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.dl-ready-text { font-weight: 600; font-size: .95rem; flex: 1; }
.dl-ready-filename { width: 100%; font-size: .82rem; color: var(--text-muted); word-break: break-all; }

/* Error */
.dl-error { margin-top: 12px; background: #FEE2E2; color: #991B1B; border-radius: 8px; padding: 10px 14px; font-size: .88rem; }

/* Also summarize banner */
.dl-also-summarize { display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 760px; margin: 20px auto 0; padding: 14px 20px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; font-size: .88rem; color: var(--text-muted); flex-wrap: wrap; }
.dl-also-summarize span { font-weight: 500; color: var(--text); }

/* ── How It Works tabs ───────────────────────────────────────────────────── */
.how-tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 32px; }
.how-tab { padding: 9px 22px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--white); font-size: .9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.how-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }
.how-panel { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Features two-col ────────────────────────────────────────────────────── */
.features-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
@media (max-width: 900px) { .features-two-col { grid-template-columns: 1fr; } }
.feature-group { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; background: var(--white); }
.feature-group--accent { border-color: #BDD3F8; background: linear-gradient(160deg, #EAF1FD 0%, var(--white) 60%); }
.feature-group-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.feature-group-icon { font-size: 1.6rem; }
.feature-group-header h3 { font-size: 1.1rem; font-weight: 700; }
.features-list { display: flex; flex-direction: column; gap: 14px; }
.feature-item { display: flex; gap: 12px; align-items: flex-start; }
.fi-icon { width: 32px; height: 32px; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.feature-group--accent .fi-icon { background: #D2E3FC; }
.feature-item strong { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 2px; }
.feature-item p { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* ── Pricing label ───────────────────────────────────────────────────────── */
.pricing-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 10px 0 4px; }

/* ── FAQ two-col ─────────────────────────────────────────────────────────── */
.faq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 900px) { .faq-cols { grid-template-columns: 1fr; } }
.faq-section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #D2E3FC; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { background: #202124; color: #9AA0A6; padding: 60px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; margin-bottom: 48px; }
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .logo-text { color: var(--white); }
.footer-tagline { font-size: 0.88rem; margin-top: 8px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 600; color: var(--white); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 0.85rem; padding: 3px 0; transition: color .15s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 24px; border-top: 1px solid #3C4043; font-size: 0.82rem; }

/* ── Confetti animation ──────────────────────────────────────────────────── */
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(.5); opacity: 0; }
}

/* ── Progress bar pulse (active job) ────────────────────────────────────── */
.progress-bar-wrap--active .progress-bar {
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0%,100% { filter: brightness(1); }
  50%     { filter: brightness(1.2) drop-shadow(0 0 6px rgba(26,115,232,.5)); }
}

/* ── Result card entrance ────────────────────────────────────────────────── */
#result-state { animation: resultEntrance .4s cubic-bezier(.22,.68,0,1.1) both; }
@keyframes resultEntrance { from{opacity:0;transform:scale(.97)} to{opacity:1;transform:none} }

/* ── Section headers fade-in ─────────────────────────────────────────────── */
.section-title { animation: none; }
.section-light .section-title,
.section-dark .section-title { }

/* ── Ad section breaks ───────────────────────────────────────────────────── */
.ad-section-break {
  padding: 16px 0;
  min-height: 100px;
  text-align: center;
}
.dl-ready-ad {
  margin-top: 20px;
  width: 100%;
  min-height: 90px;
}

/* ── Sticky bottom ad bar ────────────────────────────────────────────────── */
.sticky-ad-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(32,33,36,.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid #3C4043;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap;
  animation: slideUpBar .3s ease both;
}
@keyframes slideUpBar { from { transform: translateY(100%); } to { transform: none; } }
.sticky-ad-bar.hidden { display: none !important; }
.sticky-ad-inner { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sticky-ad-close {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: #9CA3AF;
  width: 28px; height: 28px; border-radius: 50%; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.sticky-ad-close:hover { background: rgba(255,255,255,.2); color: #fff; }
.sticky-ad-upgrade {
  background: var(--primary);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: .82rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 0 12px rgba(26,115,232,.4);
  animation: heroCtaPulse 2.5s ease-in-out 2s infinite;
  flex-shrink: 0;
}

/* ── Upgrade success toast ───────────────────────────────────────────────── */
.upgrade-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  z-index: 9999;
  background: var(--primary);
  color: #fff; padding: 14px 28px; border-radius: 100px;
  font-size: .92rem; font-weight: 700;
  box-shadow: 0 8px 32px rgba(26,115,232,.4);
  opacity: 0; transition: transform .35s cubic-bezier(.22,.68,0,1.2), opacity .35s ease;
  pointer-events: none;
}
.upgrade-toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── General app toast ───────────────────────────────────────────────────── */
.app-toast {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 420px;
  padding: 14px 16px; border-radius: 12px;
  font-size: .88rem; font-weight: 500; line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(-12px) scale(.97);
  transition: opacity .25s ease, transform .25s cubic-bezier(.22,.68,0,1.2);
  pointer-events: none;
  background: #1e293b; color: #f1f5f9;
}
.app-toast.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.app-toast.success { background: #064e3b; border-left: 4px solid #10b981; }
.app-toast.error   { background: #450a0a; border-left: 4px solid #ef4444; }
.app-toast.warn    { background: #451a03; border-left: 4px solid #f59e0b; }
.app-toast.info    { background: #1e1b4b; border-left: 4px solid #6366f1; }
.app-toast-close {
  margin-left: auto; background: none; border: none; color: inherit;
  opacity: .6; cursor: pointer; font-size: 1rem; padding: 0 2px; flex-shrink: 0;
}
.app-toast-close:hover { opacity: 1; }

/* ── Credit toast (bottom-right, stack-style) ────────────────────────────── */
.credit-toast {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9998;
  display: flex; align-items: flex-start; gap: 12px;
  background: #1e2130; color: #f1f5f9;
  padding: 14px 18px; border-radius: 14px;
  max-width: 320px; width: max-content;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  border-left: 4px solid var(--primary);
  font-size: .88rem; line-height: 1.45;
  opacity: 0; transform: translateX(60px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,.68,0,1.2);
  pointer-events: none;
}
.credit-toast.visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.credit-toast.warn  { border-color: #F59E0B; }
.credit-toast.danger { border-color: #EF4444; }
.credit-toast-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.credit-toast-body { flex: 1; }
.credit-toast-title { font-weight: 700; font-size: .9rem; margin-bottom: 2px; }
.credit-toast-msg   { color: #94a3b8; font-size: .82rem; }
.credit-toast-action {
  display: inline-block; margin-top: 7px;
  background: var(--primary); color: #fff;
  padding: 4px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 700; text-decoration: none;
  cursor: pointer; border: none;
}
.credit-toast-action:hover { background: var(--primary-dark); }
.credit-toast-close {
  background: none; border: none; color: #64748b;
  font-size: 1rem; cursor: pointer; padding: 0 0 0 6px;
  align-self: flex-start; line-height: 1;
}
.credit-toast-close:hover { color: #f1f5f9; }

/* ── Credit education banner (top of page, dismissible) ─────────────────── */
.credit-edu-banner {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 100%);
  color: #e2e8f0; font-size: .85rem;
  padding: 10px 20px; display: flex; align-items: center;
  gap: 12px; position: relative; flex-wrap: wrap;
  border-bottom: 1px solid rgba(99,102,241,.3);
}
.credit-edu-banner .ceb-icon { font-size: 1.1rem; flex-shrink: 0; }
.credit-edu-banner .ceb-text { flex: 1; min-width: 200px; }
.credit-edu-banner .ceb-text strong { color: #a5b4fc; }
.credit-edu-banner .ceb-pills {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.credit-edu-banner .ceb-pill {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 3px 10px; font-size: .78rem;
  white-space: nowrap; color: #cbd5e1;
}
.credit-edu-banner .ceb-pill.free { border-color: #6366f1; color: #a5b4fc; }
.credit-edu-banner .ceb-pill.warn { border-color: #F59E0B; color: #FCD34D; }
.credit-edu-banner .ceb-pill.pro  { border-color: #10b981; color: #6ee7b7; }
.credit-edu-banner .ceb-dismiss {
  background: none; border: none; color: #64748b;
  font-size: 1.1rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: color .15s;
}
.credit-edu-banner .ceb-dismiss:hover { color: #e2e8f0; }

/* ── Low-credit sticky bottom bar ───────────────────────────────────────── */
.low-credit-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 990;
  background: linear-gradient(90deg, #7c2d12, #991b1b);
  color: #fef2f2; padding: 10px 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: .88rem; font-weight: 600;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  transform: translateY(100%); opacity: 0;
  transition: transform .4s cubic-bezier(.22,.68,0,1.2), opacity .3s ease;
}
.low-credit-bar.visible { transform: translateY(0); opacity: 1; }
.low-credit-bar a, .low-credit-bar button.lcb-btn {
  background: #fff; color: #991b1b;
  padding: 5px 16px; border-radius: 20px;
  font-weight: 700; font-size: .82rem;
  text-decoration: none; border: none; cursor: pointer;
  transition: background .15s;
}
.low-credit-bar a:hover, .low-credit-bar button.lcb-btn:hover { background: #fee2e2; }
.low-credit-bar .lcb-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 1.1rem; cursor: pointer; margin-left: 8px;
}
.low-credit-bar .lcb-close:hover { color: #fff; }

/* ── Support Chat Widget ─────────────────────────────────────────────────── */
.sw-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}

/* Bubble button */
.sw-bubble {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary);
  border: none; color: #fff; font-size: 1.4rem;
  box-shadow: 0 4px 20px rgba(26,115,232,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer; position: relative;
}
.sw-bubble:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(26,115,232,.5); }
.sw-bubble-badge {
  position: absolute; top: -4px; right: -4px;
  background: #EF4444; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: badgePop .3s cubic-bezier(.22,.68,0,1.4) both;
}
.sw-bubble-icon { line-height: 1; transition: transform .2s; }

/* Panel */
.sw-panel {
  width: 360px; max-height: 520px;
  background: var(--white); border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: swPanelIn .25s cubic-bezier(.22,.68,0,1.2) both;
  border: 1px solid var(--border);
}
@keyframes swPanelIn { from{opacity:0;transform:scale(.92) translateY(12px)} to{opacity:1;transform:none} }
@media (max-width: 480px) {
  .sw-widget { bottom: 16px; right: 16px; }
  .sw-panel  { width: calc(100vw - 32px); }
}

/* Header */
.sw-header {
  background: var(--primary);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.sw-header-info { display: flex; align-items: center; gap: 10px; }
.sw-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff; font-size: .8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.4);
}
.sw-title { color: #fff; font-size: .9rem; font-weight: 700; }
.sw-status { color: rgba(255,255,255,.8); font-size: .72rem; display: flex; align-items: center; gap: 5px; }
.sw-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10B981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.5);
  animation: pulse-dot 2s infinite;
}
.sw-close {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; font-size: .85rem;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.sw-close:hover { background: rgba(255,255,255,.3); }

/* Messages */
.sw-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.sw-msg {
  max-width: 82%; padding: 9px 13px;
  border-radius: 14px; font-size: .85rem; line-height: 1.55;
  word-break: break-word; animation: swMsgIn .2s ease both;
}
@keyframes swMsgIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.sw-msg--bot {
  background: var(--bg); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; align-self: flex-start;
  color: var(--text);
}
.sw-msg--user {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.sw-msg--typing { color: var(--text-muted); font-style: italic; }
.sw-msg-time {
  font-size: .68rem; color: var(--text-muted);
  margin-top: 2px; text-align: right;
}

/* Email capture */
.sw-email-row { padding: 6px 12px 0; }
.sw-email-input {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .82rem;
  font-family: var(--font); outline: none;
  transition: border-color .15s;
}
.sw-email-input:focus { border-color: var(--primary); }

/* Input row */
.sw-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.sw-input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .88rem;
  font-family: var(--font); outline: none;
  transition: border-color .15s;
}
.sw-input:focus { border-color: var(--primary); }
.sw-send {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.sw-send:hover { background: var(--primary-dark); }
.sw-send:disabled { background: var(--border); cursor: not-allowed; }

/* Footer */
.sw-footer {
  font-size: .72rem; color: var(--text-muted);
  text-align: center; padding: 6px 12px 10px;
  border-top: 1px solid var(--border);
}
.sw-footer a { color: var(--primary); }

/* Quick reply chips */
.sw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sw-chip {
  font-size: .75rem; background: var(--primary-light);
  color: var(--primary); border: 1px solid #BDD3F8;
  border-radius: 100px; padding: 4px 10px; cursor: pointer;
  transition: all .15s; font-family: var(--font);
}
.sw-chip:hover { background: var(--primary); color: #fff; }

/* ── Quiz tab ────────────────────────────────────────────────────────────── */
.quiz-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.quiz-settings {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1;
}
.quiz-settings .form-select {
  flex: 1; min-width: 120px; max-width: 180px;
}

/* Welcome / empty state */
.quiz-welcome {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.quiz-welcome-icon { font-size: 3rem; margin-bottom: 12px; }
.quiz-welcome h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.quiz-welcome p  { font-size: 0.88rem; margin-bottom: 20px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* Loading spinner */
.quiz-loading {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.quiz-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: quizSpin .7s linear infinite; margin: 0 auto 14px;
}
@keyframes quizSpin { to { transform: rotate(360deg); } }

/* Question card */
.quiz-question {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
  background: var(--white);
  transition: box-shadow .15s;
}
.quiz-question:hover { box-shadow: var(--shadow); }
.quiz-question-num {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--primary); margin-bottom: 6px;
}
.quiz-question-text {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  line-height: 1.5; margin-bottom: 14px;
}

/* Option buttons */
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .15s; background: var(--white);
  font-family: var(--font); font-size: 0.9rem; text-align: left;
  width: 100%;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--primary); background: var(--primary-light);
}
.quiz-option.selected {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary); font-weight: 500;
}
.quiz-option.correct {
  border-color: var(--success); background: #E6F4EA;
  color: #188038; font-weight: 500;
}
.quiz-option.wrong {
  border-color: var(--error); background: #FCE8E6;
  color: #D93025;
}
.quiz-option:disabled { cursor: default; }

.quiz-opt-letter {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  transition: all .15s;
}
.quiz-option.selected .quiz-opt-letter {
  background: var(--primary); color: #fff;
}
.quiz-option.correct .quiz-opt-letter {
  background: var(--success); color: #fff;
}
.quiz-option.wrong .quiz-opt-letter {
  background: var(--error); color: #fff;
}
.quiz-opt-text { flex: 1; line-height: 1.5; }

/* Explanation shown after submit */
.quiz-explanation {
  margin-top: 10px; padding: 10px 12px;
  background: var(--bg); border-radius: var(--radius-sm);
  font-size: 0.84rem; color: var(--text-muted); line-height: 1.6;
  border-left: 3px solid var(--primary);
}

/* Submit row */
.quiz-submit-row { display: flex; justify-content: center; margin: 20px 0; }

/* Score card */
.quiz-score-card {
  text-align: center; padding: 32px 20px 24px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--white); margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.quiz-score-icon { font-size: 3rem; margin-bottom: 8px; }
.quiz-score-num {
  font-size: 2.8rem; font-weight: 800; color: var(--primary); line-height: 1;
  margin-bottom: 4px;
}
.quiz-score-label {
  font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px;
}
.quiz-score-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Review section */
.quiz-review { margin-top: 8px; }
.quiz-review-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; font-size: 0.88rem;
}
.quiz-review-item.review-correct { border-left: 4px solid var(--success); background: #F6FBF7; }
.quiz-review-item.review-wrong   { border-left: 4px solid var(--error);   background: #FEF6F5; }
.quiz-review-q { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.quiz-review-answer { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; }
.quiz-review-correct { color: var(--success); font-weight: 600; }
.quiz-review-wrong   { color: var(--error);   font-weight: 600; }
.quiz-review-exp { margin-top: 6px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; }

/* ── Queue waiting UI ────────────────────────────────────────────────────── */
.queue-animation {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 20px;
}
.queue-robot {
  font-size: 3rem;
  animation: queue-robot-bounce 1s ease-in-out infinite alternate;
}
@keyframes queue-robot-bounce {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-8px) rotate(5deg); }
}
.queue-bubbles { display: flex; gap: 6px; align-items: flex-end; }
.queue-bubble {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); opacity: .7;
  animation: queue-bubble-pulse 1.2s ease-in-out infinite;
}
.queue-bubble--1 { animation-delay: 0s; }
.queue-bubble--2 { animation-delay: .2s; }
.queue-bubble--3 { animation-delay: .4s; }
@keyframes queue-bubble-pulse {
  0%, 100% { transform: scaleY(0.4); opacity: .4; }
  50%       { transform: scaleY(1.2); opacity: 1; }
}
#queue-waiting h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; text-align: center; }
.queue-msg { text-align: center; color: var(--text-muted); font-size: .92rem; margin-bottom: 16px; }
.queue-facts {
  background: var(--primary-light); border: 1px solid #BDD3F8;
  border-radius: 10px; padding: 12px 16px; margin-top: 8px;
}
.queue-fact-text {
  font-size: .85rem; color: var(--primary); text-align: center;
  margin: 0; animation: queue-fact-fade 6s ease-in-out infinite;
}
@keyframes queue-fact-fade {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1; }
}
