:root {
  --bg: #f2f3f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.06);
  --text: #1c1c1e;
  --text-secondary: #6b6b70;
  --text-tertiary: #9a9aa1;
  --accent: #007aff;
  --accent-gradient: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
  --success: #34c759;
  --danger: #ff3b30;
  --warning: #ff9500;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: rgba(28, 28, 30, 0.72);
    --surface-solid: #1c1c1e;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6b6b70;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.25);
  }
}

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

html, body {
  height: 100%;
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(88, 86, 214, 0.18), transparent 40%),
    radial-gradient(circle at 85% 5%, rgba(0, 122, 255, 0.14), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255, 149, 0, 0.08), transparent 50%);
  pointer-events: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ============ HERO ============ */
.hero { margin-bottom: 28px; }
.hero-top { margin-bottom: 24px; }

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  flex-shrink: 0;
}
.logo-icon img { width: 100%; height: 100%; display: block; }

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.brand-ar {
  font-family: 'Amiri', 'Heebo', serif;
  font-weight: 700;
  font-size: 32px;
  background: linear-gradient(135deg, #1a73e8 0%, #c8a04d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.brand-divider { color: var(--text-tertiary); font-weight: 300; font-size: 24px; }
.brand-en {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.5;
}

.verse-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(200,160,77,0.12), rgba(200,160,77,0.06));
  border: 1px solid rgba(200,160,77,0.25);
  border-radius: 999px;
  font-family: 'Amiri', serif;
  font-size: 15px;
  color: #8a6d2f;
  font-weight: 400;
}
.verse-ar { letter-spacing: 0; }

@media (prefers-color-scheme: dark) {
  .verse-badge {
    background: linear-gradient(135deg, rgba(200,160,77,0.18), rgba(200,160,77,0.08));
    color: #e5c989;
  }
}

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.author-badge svg {
  color: #ff3b30;
  animation: heartbeat 1.6s ease-in-out infinite;
}
.author-badge strong {
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ SHARING ============ */
.hero-actions {
  display: flex;
  gap: 10px;
  margin: 18px 0 20px;
  justify-content: flex-end;
}
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all .15s;
}
.btn-share:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--accent); color: var(--accent); }
.btn-share svg { color: var(--accent); }

.share-modal-card { max-width: 820px; }

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 620px) { .share-grid { grid-template-columns: 1fr; } }

.share-option {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.share-option-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-option-title h4 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.share-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
}
.share-badge-lan { background: rgba(52,199,89,0.15); color: var(--success); }
.share-badge-remote { background: rgba(255,149,0,0.15); color: var(--warning); }
.share-option-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
.qr-wrap {
  background: white;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-width: 220px;
  margin: 4px auto;
  box-shadow: inset 0 0 0 1px var(--border);
}
.qr-wrap svg { width: 100%; height: 100%; display: block; }
.qr-loading, .qr-empty {
  color: var(--text-tertiary);
  font-size: 13px;
  font-style: italic;
}
.share-url {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text);
  direction: ltr;
  user-select: all;
  overflow-wrap: break-word;
}
.remote-controls { display: flex; gap: 8px; justify-content: center; }
.remote-controls .btn-primary, .remote-controls .btn-ghost { padding: 8px 16px; font-size: 13.5px; }

.share-tips {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(0,122,255,0.05);
  border: 1px solid rgba(0,122,255,0.12);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}
.share-tips strong { color: var(--text); display: block; margin-bottom: 6px; }
.share-tips ul { padding-inline-start: 20px; }
.share-tips li { margin-bottom: 4px; }

/* ============ ABOUT ============ */
.about-card { padding: 0; }
.about-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.about-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow-md); }
.about-name-ar {
  font-family: 'Amiri', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #1a73e8 0%, #c8a04d 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.about-name-en { font-size: 18px; font-weight: 600; color: var(--text); }
.about-version { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

.about-verse {
  font-family: 'Amiri', serif;
  text-align: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(200,160,77,0.1), rgba(200,160,77,0.04));
  border: 1px solid rgba(200,160,77,0.25);
  border-radius: var(--radius-md);
  color: #8a6d2f;
  font-size: 16px;
  margin-bottom: 18px;
}
@media (prefers-color-scheme: dark) { .about-verse { color: #e5c989; } }

.about-section { margin-bottom: 18px; }
.about-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.about-section ul { padding-inline-start: 22px; font-size: 14px; color: var(--text); line-height: 1.65; }
.about-section li { margin-bottom: 4px; }
.about-hint { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.about-creds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.about-creds code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: white;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  user-select: all;
  direction: ltr;
  display: inline-block;
}
.cred-label { color: var(--text-secondary); font-size: 13px; }
.cred-copy { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cred-copy:hover { background: rgba(0,122,255,0.05); border-radius: 6px; }
.copy-hint { font-size: 12px; color: var(--text-tertiary); margin-inline-start: auto; }

.about-url {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  direction: ltr;
  user-select: all;
}

.about-credits { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 0; }
.about-credits p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 4px; }
.about-credits strong { color: var(--text); }

/* ============ REFERENCES ============ */
.refs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.refs-intro {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
}
.refs-intro p { margin-bottom: 6px; }
.refs-hint { color: var(--text-secondary); font-size: 13px; }

.refs-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 18px;
  background: rgba(0,0,0,0.02);
}
.refs-dropzone:hover, .refs-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0,122,255,0.04);
}
.refs-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.refs-dropzone svg { color: var(--accent); }
.refs-dropzone button { margin-inline-start: 6px; font-size: 13px; }
.refs-formats { font-size: 12px; color: var(--text-tertiary); }

.refs-newer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255,149,0,0.1), rgba(255,149,0,0.05));
  border: 1px solid rgba(255,149,0,0.3);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.refs-newer-banner strong { color: var(--warning); font-size: 15px; }
.refs-newer-banner div > div { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }
.refs-newer-banner button { flex-shrink: 0; }

.refs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.refs-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 13.5px;
}
.ref-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ref-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.05em;
  color: white;
  min-width: 56px;
}
.ref-ext-pdf { background: #e74c3c; }
.ref-ext-docx { background: #2b579a; }
.ref-ext-pptx { background: #d24726; }
.ref-ext-txt { background: #7f8c8d; }
.ref-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-size {
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.ref-delete { width: 28px; height: 28px; font-size: 14px; }

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

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* ============ UPLOAD ============ */
.upload-card {
  background: var(--surface-solid);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 28px;
  text-align: center;
  cursor: pointer;
  transition: all .25s cubic-bezier(.2,.9,.3,1);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.upload-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.upload-card.dragover {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.05);
  transform: scale(1.01);
}

.upload-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0,122,255,.12), rgba(88,86,214,.12));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-icon svg { width: 32px; height: 32px; }

.upload-card h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.upload-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.lang-picker {
  display: inline-flex;
  background: rgba(0,0,0,0.05);
  padding: 3px;
  border-radius: 999px;
  margin-bottom: 16px;
  gap: 2px;
}
.lang-picker button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.lang-picker button:hover { color: var(--text); }
.lang-picker button.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.url-row { margin-top: 18px; }
.url-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 0 auto 12px;
  max-width: 260px;
}
.url-divider::before,
.url-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.url-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  max-width: 560px;
  margin: 0 auto;
  transition: border-color .15s, background .15s;
}
.url-input-wrap:focus-within {
  background: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}
.url-input-wrap > svg { color: var(--text-tertiary); flex-shrink: 0; }
.url-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 8px 4px;
  min-width: 0;
}
.url-input-wrap input::placeholder { color: var(--text-tertiary); font-family: 'Heebo', inherit; }
.btn-url { padding: 9px 20px; font-size: 14px; }

.upload-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff3b30, #ff6b5c);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
  transition: transform .15s, box-shadow .15s;
}
.btn-record:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4); }
.btn-record:active { transform: translateY(0); }

.btn-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0a84ff, #5856d6);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.btn-live:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(10, 132, 255, 0.4); }
.live-pulse {
  width: 8px; height: 8px;
  background: #ff3b30;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.8);
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* ============ LIVE PANEL ============ */
.live-panel {
  margin-bottom: 24px;
  background: var(--surface-solid);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(10,132,255,0.2);
  overflow: hidden;
  animation: pop .3s cubic-bezier(.2,.9,.3,1.2);
}
.live-panel[hidden] { display: none; }
.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(10,132,255,0.08), rgba(88,86,214,0.08));
  border-bottom: 1px solid var(--border);
}
.live-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.live-status .rec-dot {
  width: 12px; height: 12px;
  animation: rec-pulse 1.3s ease-in-out infinite;
}
.live-timer {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-inline-start: 6px;
}
.live-body {
  display: flex;
  flex-direction: column;
}
.live-transcript {
  max-height: 300px;
  overflow-y: auto;
  padding: 20px 22px;
  font-size: 16px;
  line-height: 1.75;
}
.live-transcript .live-segment {
  padding: 6px 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  animation: slideIn .3s ease;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.live-transcript .live-segment:last-child { border-bottom: none; }
.live-transcript .live-seg-time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  flex-shrink: 0;
}
.live-transcript .live-seg-text { color: var(--text); flex: 1; }
.live-empty {
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}
.live-meta {
  padding: 12px 22px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.02);
  border-top: 1px solid var(--border);
  text-align: center;
  font-weight: 500;
}
.live-processing {
  color: var(--accent);
  animation: pulse-fade 1.2s ease-in-out infinite;
}
@keyframes pulse-fade { 50% { opacity: 0.5; } }

/* ============ RECORDING PANEL ============ */
.recording-panel {
  margin-bottom: 24px;
  animation: pop .3s cubic-bezier(.2,.9,.3,1.2);
}
.recording-panel[hidden] { display: none; }

.rec-inner {
  background: linear-gradient(135deg, rgba(255,59,48,0.08), rgba(255,107,92,0.08));
  border: 1px solid rgba(255, 59, 48, 0.15);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(255,59,48,0.0);
  animation: rec-glow 2s ease-in-out infinite;
}
@keyframes rec-glow {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(255,59,48,0); }
  50% { box-shadow: var(--shadow-md), 0 0 0 6px rgba(255,59,48,0.08); }
}

.rec-pulse {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.rec-dot {
  width: 16px; height: 16px;
  background: #ff3b30;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  animation: rec-pulse 1.3s ease-in-out infinite;
}
.rec-dot::before {
  content: "";
  position: absolute;
  inset: -12px;
  background: #ff3b30;
  border-radius: 50%;
  opacity: 0.3;
  animation: rec-ring 1.3s ease-out infinite;
}
@keyframes rec-pulse { 50% { transform: scale(0.85); } }
@keyframes rec-ring {
  0% { transform: scale(0.6); opacity: 0.4; }
  100% { transform: scale(1.8); opacity: 0; }
}

.rec-info .rec-label {
  font-size: 13px;
  font-weight: 600;
  color: #ff3b30;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rec-timer {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: var(--text);
  margin-top: 2px;
}

.rec-waves {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-self: start;
  height: 36px;
}
.rec-waves span {
  display: inline-block;
  width: 3px;
  background: linear-gradient(180deg, #ff3b30, #ff6b5c);
  border-radius: 999px;
  height: 6px;
  transition: height 80ms ease;
  opacity: 0.6;
}

.rec-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-rec-stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s;
}
.btn-rec-stop:hover { transform: translateY(-1px); }
.btn-rec-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 999px;
}
.btn-rec-cancel:hover { background: rgba(0,0,0,0.05); color: var(--text); }

@media (max-width: 620px) {
  .rec-inner { grid-template-columns: auto 1fr; }
  .rec-waves { grid-column: 1/-1; justify-self: stretch; }
  .rec-actions { grid-column: 1/-1; justify-content: stretch; }
  .btn-rec-stop { flex: 1; justify-content: center; }
}

/* ============ SUMMARY ============ */
.summary-section {
  font-size: 15px;
  line-height: 1.7;
}
.summary-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.summary-section h2:first-child { margin-top: 0; }
.summary-section ul { padding-inline-start: 20px; margin-bottom: 10px; }
.summary-section li { margin-bottom: 4px; }
.summary-section p { margin-bottom: 10px; }
.summary-section .cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s infinite;
  margin-inline-start: 2px;
  border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.share-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  background: rgba(0,0,0,0.02);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn svg { width: 16px; height: 16px; }

.share-whatsapp { background: #25d366; color: white; }
.share-whatsapp:hover { background: #20bd5a; box-shadow: 0 4px 10px rgba(37,211,102,0.35); }
.share-mail { background: var(--accent); color: white; }
.share-mail:hover { background: #0062cc; box-shadow: 0 4px 10px rgba(0,122,255,0.35); }
.share-copy { background: rgba(0,0,0,0.06); color: var(--text); }
.share-copy:hover { background: rgba(0,0,0,0.1); }
.share-regen { background: rgba(255,149,0,0.15); color: var(--warning); margin-inline-start: auto; }
.share-regen:hover { background: rgba(255,149,0,0.25); }

.summary-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
}
.summary-empty .big-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(0,122,255,.12), rgba(88,86,214,.12));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.summary-empty .big-icon svg { width: 28px; height: 28px; }
.summary-empty .btn-primary { margin-top: 16px; }

/* ============ BUTTONS ============ */
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(0, 122, 255, 0.18); }

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }

.btn-danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--danger);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(255, 59, 48, 0.2); }

.icon-btn {
  background: rgba(0,0,0,0.04);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.icon-btn:hover { background: rgba(0,0,0,0.08); }

/* ============ ACTIVE JOBS — 3-PANEL LIVE VIEW ============ */
.active-jobs { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.active-jobs:empty { display: none; }

.job-card {
  background: var(--surface-solid);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  animation: pop .3s cubic-bezier(.2,.9,.3,1.2);
}
.job-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,122,255,0.04), rgba(88,86,214,0.04));
  pointer-events: none;
}

.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.job-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.job-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.job-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.job-close:hover { background: rgba(0,0,0,0.06); color: var(--text); }

.job-panels {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.3fr;
  gap: 0;
  position: relative;
  z-index: 1;
  min-height: 320px;
  max-height: 520px;
}
.panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-inline-start: 1px solid var(--border);
}
.panel:first-child { border-inline-start: none; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.panel-header svg { width: 14px; height: 14px; }
.panel-header.panel-source { color: var(--accent); }
.panel-header.panel-transcript { color: #5856d6; }
.panel-header.panel-summary { color: #ff9500; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  min-height: 0;
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }

/* Source panel */
.source-info { display: flex; flex-direction: column; gap: 10px; }
.source-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: flex-start;
}
.source-row .label {
  color: var(--text-tertiary);
  font-weight: 500;
  min-width: 58px;
  flex-shrink: 0;
}
.source-row .value { color: var(--text); word-break: break-word; }

.source-visual {
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0,122,255,0.06), rgba(88,86,214,0.06));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  height: 90px;
}
.source-visual svg { width: 48px; height: 48px; opacity: 0.7; }

.panel-progress {
  margin-top: auto;
  padding-top: 16px;
  flex-shrink: 0;
}
.panel-progress .progress-bar { margin-bottom: 6px; }
.panel-progress .progress-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Empty states */
.panel-empty {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 13.5px;
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.panel-empty svg { width: 28px; height: 28px; opacity: 0.4; }

@media (max-width: 900px) {
  .job-panels {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .panel { border-inline-start: none; border-top: 1px solid var(--border); }
  .panel:first-child { border-top: none; }
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0, 122, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 999px;
  width: 0%;
  transition: width .3s ease;
}
.progress-fill.indeterminate {
  width: 40%;
  animation: indet 1.5s ease-in-out infinite;
}
@keyframes indet {
  0% { margin-right: -40%; }
  100% { margin-right: 100%; }
}

.segments-stream {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  position: relative;
}
.segments-stream::-webkit-scrollbar { width: 8px; }
.segments-stream::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }

.segment {
  padding: 6px 0;
  font-size: 14.5px;
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: baseline;
  animation: slideIn .3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.segment-time {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.segment-text { color: var(--text); flex: 1; }

/* ============ HISTORY ============ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.transcript-card {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.transcript-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.transcript-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.transcript-meta {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.transcript-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transcript-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  background: var(--surface-solid);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.65;
  font-size: 15px;
  flex: 1 1 auto;
  min-height: 0;
}
.share-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-solid, #fff);
}
.modal-body p { margin-bottom: 10px; }
.modal-body p.meta { color: var(--text-secondary); font-style: italic; font-size: 13.5px; margin-bottom: 16px; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28,28,30,.95);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ============ CREDITS ============ */
.credits {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.credits-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.credits-inner svg {
  color: #ff3b30;
  flex-shrink: 0;
  animation: heartbeat 1.6s ease-in-out infinite;
}
.credits-inner strong {
  color: var(--text);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

/* ============ AUTH / LOGIN ============ */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-wrap {
  padding: 20px;
  max-width: 460px;
  width: 100%;
}
.auth-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-lg);
  animation: pop .4s cubic-bezier(.2,.9,.3,1.2);
}
.auth-logo-wrap { text-align: center; margin-bottom: 24px; }
.auth-logo { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 12px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-title .brand-ar { font-size: 28px; }
.auth-title .brand-en { font-size: 20px; }
.auth-tag { color: var(--text-secondary); font-size: 13.5px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 13px; font-weight: 600; color: var(--text); }
.auth-field input {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
  background: white;
}
.auth-error {
  padding: 10px 14px;
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: var(--radius-md);
  font-size: 13.5px;
}
.auth-submit { width: 100%; padding: 13px 16px; font-size: 15px; }

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(0,122,255,0.05);
  border: 1px solid rgba(0,122,255,0.12);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.auth-note svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.auth-verse {
  text-align: center;
  font-family: 'Amiri', serif;
  color: #8a6d2f;
  font-size: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.auth-credit {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11.5px;
  margin-top: 6px;
}

/* ============ ADMIN ============ */
.admin-section {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.admin-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: center;
}
.admin-form input[type="email"], .admin-form input[type="text"], .admin-form input[type="password"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}
.admin-form input:focus { border-color: var(--accent); }
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text);
}
.admin-note { margin-top: 10px; font-size: 13px; }
.admin-note.ok { color: var(--success); }
.admin-note.err { color: var(--danger); }

.users-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.user-card.is-admin { border-color: rgba(200,160,77,0.3); background: rgba(200,160,77,0.04); }
.user-info { flex: 1; min-width: 200px; }
.user-email { font-weight: 600; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 13.5px; }
.user-meta { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.admin-tag { background: #c8a04d; color: white; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 10px; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-actions button { padding: 6px 12px; font-size: 12.5px; }

/* ============ USER BADGE (in dashboard) ============ */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.user-badge:hover { background: rgba(0,122,255,0.08); color: var(--accent); }
.user-badge-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ============ LIVE STREAMING ============ */
.btn-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.btn-live:hover { filter: brightness(1.08); }
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff;
  animation: liveBlink 1.2s infinite;
}
.live-dot-big { width: 12px; height: 12px; background: #ef4444; }
@keyframes liveBlink { 0%,100%{opacity:1} 50%{opacity:0.35} }
.live-modal-card { max-width: 820px; }
.live-timer {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-inline-start: auto;
  padding-inline-end: 12px;
  font-variant-numeric: tabular-nums;
}
.live-status {
  padding: 10px 14px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}
.live-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .live-split { grid-template-columns: 1fr; }
}
.live-col { display: flex; flex-direction: column; min-width: 0; }
.live-col-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  padding: 4px 8px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-summary-ts {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.live-transcript {
  min-height: 180px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  line-height: 1.8;
  font-size: 16px;
}
.live-summary {
  min-height: 180px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  line-height: 1.7;
  font-size: 14.5px;
  background: rgba(103, 126, 234, 0.04);
}
.live-summary h2 { font-size: 16px; margin-top: 12px; margin-bottom: 6px; }
.live-summary h2:first-child { margin-top: 0; }
.live-summary ul { padding-inline-start: 20px; margin-bottom: 8px; }
.live-summary li { margin-bottom: 4px; }
.live-summary p { margin-bottom: 8px; }
.live-seg { padding: 4px 0; }
.live-partial { opacity: 0.55; font-style: italic; }
.live-controls { justify-content: center; }

/* ============ INVITE FRIENDS ============ */
.invite-url {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13.5px;
  cursor: pointer;
  direction: ltr;
  text-align: start;
  margin-bottom: 10px;
  transition: background 0.15s;
}
.invite-url:hover { background: rgba(0,0,0,0.07); }
.invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.invite-actions .btn-primary,
.invite-actions .btn-secondary {
  text-decoration: none;
  padding: 8px 14px;
  font-size: 13px;
}

/* ============ UI LANG PICKER ============ */
.ui-lang-picker {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
}
.ui-lang-picker button {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.55;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 28px;
  transition: all 0.15s;
}
.ui-lang-picker button:hover { opacity: 0.9; }
.ui-lang-picker button.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  opacity: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 620px) {
  .container { padding: 20px 14px 40px; }
  .hero h1 { font-size: 24px; }
  .stats-row { gap: 8px; }
  .stat-card { padding: 14px 14px; }
  .stat-value { font-size: 20px; }
  .upload-card { padding: 32px 16px; }
  .history-grid { grid-template-columns: 1fr; }
}
