/* Bir Sonraki Seçenek Studio - Tablet First CSS */
:root {
  --header-height: 76px;
  --bg-main: #0f141c;
  --bg-card: #18202c;
  --bg-input: #232d3d;
  --bg-hover: #2d3a4d;
  --border: #2e3c50;
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --touch-target: 48px;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: #e2e8f0;
  --border: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --success-hover: #047857;
  --warning: #d97706;
  --danger: #dc2626;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .story-title-input,
[data-theme="light"] .chapter-title-input,
[data-theme="light"] .story-item-title,
[data-theme="light"] .chapter-item-title,
[data-theme="light"] .btn-stepper,
[data-theme="light"] .stepper input,
[data-theme="light"] .auth-gate-card h2,
[data-theme="light"] .modal-header h3 {
  color: var(--text-main);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

[data-theme="light"] .json-editor-wrap textarea,
[data-theme="light"] .code-textarea {
  background: #f8fafc;
  color: #0369a1 !important;
  border-color: #cbd5e1;
}

[data-theme="light"] .card-header {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .alert-banner.warning {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}
[data-theme="light"] .alert-banner.info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1e40af;
}

[data-theme="light"] .detection-status.success {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}
[data-theme="light"] .detection-status.warning {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

[data-theme="light"] .login-error-alert {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
}

[data-theme="light"] .gate-status-alert.error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

[data-theme="light"] .gate-status-alert.warning {
  background: rgba(217, 119, 6, 0.09);
  border-color: rgba(217, 119, 6, 0.3);
  color: #92400e;
}

[data-theme="light"] .gate-status-alert.info {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1e40af;
}

[data-theme="light"] .auth-gate-card.full-app-gate {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .form-control {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .form-control:focus {
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18), inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .btn-toggle-pw:hover {
  background-color: #e2e8f0;
}

[data-theme="light"] .firebase-reset-panel {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] #btnBackToSignIn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] #btnBackToSignIn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

[data-theme="light"] .export-success-badge {
  color: #047857;
}

[data-theme="light"] .modal-card {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chapters-column,
[data-theme="light"] .chapter-editor-form {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .drop-zone {
  background: var(--bg-input);
}
[data-theme="light"] .step-num,
[data-theme="light"] .logo-badge,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-success {
  color: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 40px;
}

/* Header */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

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

.btn-theme-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-theme-toggle:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Container & Layout */
.container {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 16px;
}

/* Layout: İki Sütunlu Düzen (Normal Sayfa Akışı - Sabitleme Kapalı) */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 440px);
  gap: 24px;
  align-items: start;
}

.preview-panel {
  position: static;
  align-self: auto;
}

.preview-panel .card,
.sticky-card {
  position: static;
  max-height: none;
  overflow: visible;
  margin-bottom: 0;
}

/* Tablet ve Mobil: Tek Sütunlu Düzen */
@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.sub-header {
  margin-top: 18px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.card-body {
  padding: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-target);
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-touch-lg {
  min-height: 52px;
  font-size: 1.05rem;
  padding: 12px 24px;
  flex: 1;
}

.btn-touch-xl {
  min-height: 60px;
  font-size: 1.15rem;
  font-weight: 700;
  width: 100%;
  letter-spacing: 0.5px;
  margin-top: 14px;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* File Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 0.2s, background-color 0.2s;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone.compact {
  min-height: 80px;
  padding: 14px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.btn-file-label {
  position: relative;
  overflow: hidden;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.drop-icon {
  font-size: 28px;
}

.drop-text {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.drop-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grid controls */
.grid-controls {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 1;
  min-width: 180px;
}

.control-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-stepper {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper input {
  width: 44px;
  height: 38px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
}

/* Detection status */
.detection-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detection-status.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.detection-status.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Grid editor & touch handles */
.grid-editor-wrap {
  margin-top: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.grid-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.grid-editor-header strong {
  color: var(--text-main);
}

.grid-canvas-container {
  width: 100%;
  background: #090d14;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  touch-action: none; /* Tabletlerde kaydırmayı engelle */
  border: 1px solid var(--border);
}

/* Choice screen */
.badge-optional {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

.choice-preview-wrap {
  margin-top: 14px;
}

.choice-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.choice-preview-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.choice-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-main);
}

.btn-danger-outline {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  align-self: flex-start;
}
.btn-danger-outline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

/* Devam Bölümü Girişi */
.continuation-intro-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.continuation-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.continuation-section-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.continuation-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.continuation-audio-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.continuation-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.continuation-radio-label input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.continuation-radio-label .radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.continuation-radio-label .radio-content strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.continuation-radio-label .radio-content .radio-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.continuation-default-audio-info {
  margin-left: 24px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

.continuation-audio-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-main);
}

.continuation-custom-audio-area {
  margin-top: 4px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.continuation-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-audio-meta-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 140px;
}

.continuation-summary-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.continuation-summary-box .summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.continuation-dur-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: normal;
}

.continuation-hint-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.continuation-warning-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fbbf24;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Video Başlangıç Başlığı (Intro Title) */
.intro-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.2s ease;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-main);
  user-select: none;
}

.toggle-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.intro-title-controls {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro-section-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-section-title {
  font-size: 0.88rem;
  color: var(--text-main);
}

.intro-text-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
}
.intro-text-input:focus {
  outline: none;
  border-color: var(--primary);
}

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

@media (max-width: 600px) {
  .intro-sliders-grid {
    grid-template-columns: 1fr;
  }
}

.slider-control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.slider-val-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
}

.mini-slider {
  width: 100%;
  accent-color: var(--primary);
  height: 24px;
  cursor: pointer;
}

.intro-drag-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 6px;
}

#gridEditorCanvas {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
  cursor: crosshair;
}

/* Slides preview wrap */
.slides-preview-wrap {
  margin-top: 18px;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.76rem;
  border-radius: 4px;
}

.slides-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  min-height: 120px;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 30px 10px;
}

.slide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  cursor: grab;
}

.slide-card.dragging {
  opacity: 0.45;
  border: 2px dashed var(--primary);
  cursor: grabbing;
}

.slide-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  transform: scale(1.02);
}

.slide-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.55);
}

.slide-card-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.slide-card-actions {
  display: flex;
  gap: 2px;
  align-items: center;
}

.btn-card-action {
  background: transparent;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  transition: opacity 0.15s, background 0.15s;
}

.btn-card-action:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-card-action:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.slide-card-img-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #000;
  display: block;
  overflow: hidden;
}

.slide-card-img-wrap img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #000;
  display: block;
}

.slide-card-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
}

.slide-card-bottom .btn {
  font-size: 0.72rem;
  padding: 4px 2px;
  text-align: center;
  white-space: nowrap;
}

.slide-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Audio Player Row */
.audio-player-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.audio-player-row audio {
  flex: 1;
  min-width: 220px;
  height: 40px;
}

.audio-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Timing & JSON */
.timing-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.json-editor-toggle {
  margin-top: 10px;
}

.json-editor-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.json-editor-actions {
  display: flex;
  justify-content: flex-end;
}

.json-editor-wrap textarea {
  width: 100%;
  background: #0b0f15;
  color: #38bdf8;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

/* SES DALGA FORMU VE İNTERAKTİF ZAMAN ÇİZELGESİ */
.timeline-interactive-container {
  margin-top: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-meta-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.timeline-icon {
  font-size: 1.1rem;
}

.timeline-status-badge {
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.18);
  color: var(--primary);
  font-weight: 600;
}

.timeline-current-time-badge {
  font-size: 0.82rem;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.timeline-viewport {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  background: #090d14;
  border: 1px solid var(--border);
}

.timeline-canvas-wrapper {
  position: relative;
  width: 100%;
  min-width: 640px;
  height: 110px;
  user-select: none;
  cursor: pointer;
}

#timelineWaveformCanvas {
  width: 100%;
  height: 110px;
  display: block;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  pointer-events: none;
  z-index: 10;
  transform: translateX(0);
}

.timeline-playhead-cap {
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

.timeline-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* UYARI VE ÇAKIŞMA BİLDİRİMİ */
.timing-warning-banner {
  margin-top: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--warning);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

[data-theme="light"] .timing-warning-banner {
  background: #fffbeb;
  color: #b45309;
}

/* EDİTÖR SEKMELERİ */
.timing-subtabs {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.timing-subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.timing-subtab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.timing-subtab-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.timing-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.toggle-control-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-main);
  user-select: none;
}

.toggle-control-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.toolbar-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* GÖRSEL ZAMANLAMA LİSTESİ */
.slides-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slide-editor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-wrap: wrap;
}

.slide-editor-row:hover {
  border-color: var(--primary);
}

.slide-editor-row.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px var(--primary);
}

.slide-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #090d14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

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

.slide-thumb-placeholder {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.slide-meta-info {
  display: flex;
  flex-direction: column;
  min-width: 80px;
}

.slide-num-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.slide-zoom-badge {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.slide-inputs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.time-input-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-input-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timing-num-input {
  width: 82px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: ui-monospace, monospace;
  font-weight: 600;
}

.timing-num-input:focus {
  outline: none;
  border-color: var(--primary);
}

.slide-duration-badge {
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.slide-zoom-select,
.slide-transition-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* KARE SES EFEKTİ VE SÜRESİ KONTROLLERİ */
.slide-sfx-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.slide-sfx-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 2px 0;
  max-width: 145px;
  outline: none;
  cursor: pointer;
  font-weight: 500;
}

.slide-sfx-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.slide-sfx-duration-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid var(--border);
  padding-left: 6px;
  margin-left: 2px;
}

.slide-sfx-duration-wrap.hidden {
  display: none !important;
}

.slide-sfx-duration-input {
  width: 58px;
  padding: 2px 4px;
  font-size: 0.8rem;
  height: 24px;
  text-align: center;
  border-radius: 4px;
}

.sfx-sec-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  user-select: none;
  font-family: ui-monospace, monospace;
}

.btn-sfx-play {
  padding: 2px 7px !important;
  font-size: 0.72rem !important;
  height: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-seek-slide {
  margin-left: auto;
}

/* SEÇİM EKRANI ZAMANLAMA KUTUSU */
.choice-timing-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.choice-timing-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #a855f7;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ALTYAZI ZAMANLAMA LİSTESİ */
.subtitles-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subtitle-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  transition: border-color 0.15s ease;
}

.subtitle-editor-row:hover {
  border-color: var(--primary);
}

.subtitle-editor-row.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 1px #38bdf8;
}

.subtitle-seq-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
}

.sub-text-input {
  flex: 2;
  min-width: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  min-height: 38px;
  line-height: 1.4;
}

.sub-text-input:focus {
  outline: none;
  border-color: var(--primary);
}

.sub-timing-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-listen-sub {
  color: var(--primary);
  border-color: var(--border);
}

.btn-del-sub {
  color: var(--danger);
  border-color: transparent;
  padding: 6px 10px;
}

.btn-del-sub:hover {
  background: rgba(239, 68, 68, 0.15);
}

@media (max-width: 768px) {
  .slide-editor-row,
  .subtitle-editor-row {
    flex-direction: column;
    align-items: stretch;
  }
  .slide-inputs-group,
  .sub-timing-group {
    justify-content: space-between;
  }
}

.timing-summary {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.timing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.timing-tag {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
}

/* SFX Pills */
.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sfx-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sfx-pill {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sfx-pill:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.custom-sfx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.license-link {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
}

/* PREVIEW PANEL */
.sticky-card::-webkit-scrollbar {
  width: 6px;
}
.sticky-card::-webkit-scrollbar-track {
  background: transparent;
}
.sticky-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.sticky-card::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}
[data-theme="light"] .sticky-card::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .sticky-card::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

.preview-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.video-canvas-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--border);
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 0.95rem;
}

.overlay-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preview-controls {
  width: 100%;
  margin-top: 10px;
}

.scrubber-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrubber-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  height: 22px;
  cursor: pointer;
}

.time-display {
  display: flex;
  justify-content: flex-end;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

.playback-buttons {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.playback-buttons .btn {
  flex: 1;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

/* 6. MP4 Export Section */
.export-section {
  width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.export-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.export-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-header-title h2 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.export-header-title .step-num {
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
  margin: 0;
}

.export-res-wrap {
  display: flex;
  align-items: center;
}

.select-input-sm {
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn-generate-video {
  width: 100%;
  min-height: 44px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-generate-video:hover {
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Subtitle Position Control (Açılır/Kapanır Kompakt Kart) */
.subtitle-pos-card {
  width: 100%;
  margin-top: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: border-color 0.2s ease;
}

.subtitle-pos-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.subtitle-pos-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.subtitle-pos-summary::-webkit-details-marker {
  display: none;
}

.subtitle-pos-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.pos-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.subtitle-pos-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtitle-pos-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

details[open] .subtitle-pos-chevron {
  transform: rotate(180deg);
}

.reels-safe-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
  user-select: none;
}
[data-theme="light"] .reels-safe-badge {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
}

.subtitle-pos-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.subtitle-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle-slider {
  flex: 1;
  accent-color: var(--primary);
  height: 22px;
  cursor: pointer;
}

.slider-edge-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.subtitle-presets-row {
  display: flex;
  gap: 6px;
}

.btn-preset {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-preset:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}
.btn-preset.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.subtitle-drag-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.progress-wrap {
  margin-top: 14px;
  background: var(--bg-input);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-card);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.1s linear;
}

/* Export Result Area */
.export-result {
  margin-top: 16px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.export-success-badge {
  color: #34d399;
  font-weight: 700;
  font-size: 0.95rem;
}

#renderedVideoPreview {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.export-action-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 36px;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-content p {
  margin: 0;
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-sep {
  color: var(--border);
  user-select: none;
}

.modal-legal-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 4px 0;
}

.modal-legal-note .legal-link {
  color: var(--color-primary);
  text-decoration: underline;
}

/* App Nav Tabs */
.app-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 38px;
}
.nav-tab:hover {
  color: var(--text-main);
}
.nav-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Auth Header */
.auth-logged-in {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-main);
  max-width: 180px;
}

.user-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  width: 100%;
}
.modal-input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.w-100 {
  width: 100%;
}

/* Auth Gate Card (Giriş yapılmamışsa) */
.auth-gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 50px 24px;
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.auth-gate-icon {
  font-size: 48px;
}

.auth-gate-card h2 {
  font-size: 1.3rem;
  color: var(--text-main);
}

.auth-gate-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
}

/* Stories Layout */
.stories-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .stories-layout {
    grid-template-columns: 1fr;
  }
}

.stories-sidebar {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
  font-size: 1rem;
  color: var(--text-main);
}

.stories-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 550px;
}

.story-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.story-item:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}
.story-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
}

.story-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.story-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stories Content Area */
.stories-content {
  min-height: 550px;
  padding: 20px;
}

.empty-selection-view {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 0.95rem;
}
.empty-selection-view.compact {
  padding: 30px 10px;
}
.empty-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.story-header-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.story-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.story-title-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.story-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .story-meta-row {
    grid-template-columns: 1fr;
  }
}

.story-meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-meta-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.story-desc-input,
.story-voice-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
}

.story-desc-input:focus,
.story-voice-input:focus {
  border-color: var(--primary);
  outline: none;
}

.input-with-status {
  position: relative;
  display: flex;
  align-items: center;
}

.voice-save-status {
  position: absolute;
  right: 12px;
  color: #34d399;
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: none;
}

/* Chapters Grid (Split columns) */
.chapters-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .chapters-grid {
    grid-template-columns: 1fr;
  }
}

.chapters-column {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.chapters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chapters-header h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chapter-item:hover {
  border-color: var(--primary);
}
.chapter-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
}

.chapter-order-badge {
  width: 24px;
  height: 24px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chapter-item-info {
  flex: 1;
  min-width: 0;
}

.chapter-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chapter-actions-inline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-order-move {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 9px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.btn-order-move:hover {
  color: var(--primary);
}

/* Chapter Editor Form */
.chapter-editor-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.chapter-editor-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chapter-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-touch-md {
  min-height: 42px;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 700;
}

.alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.alert-banner.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.alert-banner.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.alert-actions {
  display: flex;
  gap: 8px;
}

.chapter-title-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  min-width: 200px;
}

.save-status-wrap {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.saved {
  background: #10b981;
}
.status-dot.dirty {
  background: #f59e0b;
}
.status-dot.saving {
  background: #3b82f6;
  animation: pulse 1s infinite;
}
.status-dot.error {
  background: #ef4444;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

.label-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.code-textarea {
  font-family: ui-monospace, Menlo, Monaco, Consolas, monospace !important;
  color: #38bdf8 !important;
  font-size: 0.82rem !important;
}

.chapter-bottom-actions {
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

/* Loading Spinners & Pagination */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

.load-more-btn {
  width: 100%;
  margin: 10px 0 4px 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border-color: var(--border);
}
.load-more-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
}

/* Oluşturma Adımları & Prompt Rehberi */
.steps-container {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.steps-header-card {
  padding: 22px 24px;
  margin-bottom: 20px;
}

.steps-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.steps-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.steps-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.steps-progress-area {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.steps-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.steps-progress-label {
  color: var(--text-muted);
}

.steps-progress-text {
  color: var(--primary);
  font-weight: 700;
}

.steps-progress-track {
  height: 10px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.steps-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.35s ease;
  border-radius: 999px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.step-card {
  padding: 20px 24px;
  margin-bottom: 0;
  transition: all 0.25s ease;
}

.step-card.completed {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.03);
}

[data-theme="light"] .step-card.completed {
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(5, 150, 105, 0.04);
}

/* Accordion / Toggle Kapalı (Collapsed) Durumu */
.step-card.collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
}

.step-card.collapsed .step-card-header {
  margin-bottom: 0;
}

.step-card.collapsed .step-card-body {
  display: none;
}

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
  transition: margin-bottom 0.2s ease;
}

.step-card-header:hover .step-title {
  color: var(--primary);
}

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

.btn-step-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-step-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

.step-toggle-icon {
  display: inline-block;
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.step-card.collapsed .step-toggle-icon {
  transform: rotate(-90deg);
}

.step-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.step-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.step-badge.step-badge-optional {
  background: #64748b;
}

.step-tag-optional {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  user-select: none;
}

.btn-step-skip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-step-skip:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.step-card.skipped {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.04);
}

[data-theme="light"] .step-card.skipped {
  border-color: rgba(100, 116, 139, 0.4);
  background: rgba(100, 116, 139, 0.05);
}

.step-card.skipped .btn-step-skip {
  background: rgba(148, 163, 184, 0.18);
  border-color: var(--text-muted);
  color: var(--text-main);
  font-weight: 700;
}

.step-card.skipped .step-badge-optional {
  background: #475569;
}

.step-card.completed .step-badge {
  background: var(--success);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.step-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  min-height: 40px;
  transition: all 0.2s ease;
}

.step-checkbox-label:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.step-card.completed .step-checkbox-label {
  border-color: var(--success);
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.step-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
}

.step-card-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.step-prompt-area {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.step-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

[data-theme="light"] .step-prompt-header {
  background: rgba(0, 0, 0, 0.02);
}

.step-prompt-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border);
}

[data-theme="light"] .step-prompt-footer {
  background: rgba(0, 0, 0, 0.02);
}

.step-prompt-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-copy-prompt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.btn-copy-prompt:hover {
  background: var(--primary);
  color: #fff;
}

.btn-copy-prompt.copied {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

.step-prompt-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e2e8f0;
  background: #090d14;
  min-height: 130px;
  display: block;
}

[data-theme="light"] .step-prompt-textarea {
  background: #f8fafc;
  color: #0f172a;
}

.step-guide-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.step-guide-list {
  margin-left: 20px;
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 16px;
}

.step-guide-action {
  display: flex;
  gap: 12px;
}

.link-external {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Bitiriş Kartı */
.steps-finish-card {
  padding: 24px;
  border: 1.5px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
}

[data-theme="light"] .steps-finish-card {
  border-color: rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(5, 150, 105, 0.06));
}

.finish-card-content {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.finish-icon {
  font-size: 2.6rem;
  flex-shrink: 0;
}

.finish-info {
  flex: 1;
  min-width: 260px;
}

.finish-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.finish-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.finish-checklist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.finish-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.finish-checklist .check-icon {
  color: var(--success);
  font-weight: 800;
}

.btn-finish-action {
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .steps-header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .step-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .step-checkbox-label {
    width: 100%;
    justify-content: flex-start;
  }
  .finish-card-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-finish-action {
    width: 100%;
    justify-content: center;
  }
}

/* GOOGLE DRIVE & HESAP ENTEGRASYONU */
.btn-google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff !important;
  color: #3c4043 !important;
  border: 1px solid #dadce0 !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.btn-google-signin:hover {
  background: #f8f9fa !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.google-icon {
  flex-shrink: 0;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

.btn-pill-action {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-pill-action:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.15);
}

/* Kullanıcı Profili ve Drive Durum Kartları */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.user-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-icon-lg {
  font-size: 1.5rem;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-profile-info strong {
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-status-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.drive-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.drive-folder-id-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.drive-folder-id-line code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
}

.modal-signed-actions {
  display: flex;
  gap: 10px;
}

.modal-signed-actions button {
  flex: 1;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link-action:hover {
  opacity: 0.8;
}

/* BÖLÜM DOSYALARI (CHAPTER ASSETS) */
.chapter-assets-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-assets-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter-assets-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.chapter-assets-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chapter-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.asset-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.asset-card-wide {
  grid-column: 1 / -1;
}

.asset-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-icon {
  font-size: 1.2rem;
}

.asset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.asset-info strong {
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-status {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-status.ready {
  color: #34d399;
  font-weight: 600;
}

.asset-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.asset-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.progress-text-sm {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 32px;
}

/* ==========================================================================
   APP AUTH GATE (Uygulama Giriş Ekranı - Tek Hesap Koruması)
   ========================================================================== */
.auth-gate-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  position: relative;
  overflow-x: hidden;
}

.auth-gate-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-gate-brand .brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}

.auth-gate-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-gate-card.full-app-gate {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 44px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-gate-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
  margin-bottom: 6px;
}

.auth-gate-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-gate-desc {
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 22px;
  line-height: 1.6;
  text-align: left;
}

.gate-status-alert {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 18px;
  text-align: left;
}

.gate-status-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.gate-status-alert.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.gate-status-alert.info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.btn-gate-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-gate-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

.gate-setup-area {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.gate-setup-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gate-setup-buttons,
.gate-authorize-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.gsi-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.gsi-button-container > div {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

.gsi-button-container iframe {
  margin: 0 auto !important;
}

.btn-switch-account {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-gate-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  width: 100%;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.gate-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 10px;
  gap: 14px;
  width: 100%;
}

.gate-loading-state.hidden {
  display: none !important;
}

.gate-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.gate-loading-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.gate-stage-identity,
.gate-stage-drive {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gate-stage-identity.hidden,
.gate-stage-drive.hidden {
  display: none !important;
}

.gate-account-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.gate-avatar-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gate-avatar-wrap .user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.gate-avatar-wrap .user-icon-lg {
  font-size: 2rem;
  line-height: 1;
}

.gate-account-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-grow: 1;
}

.gate-account-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.gate-user-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gate-user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .auth-gate-card.full-app-gate {
    padding: 32px 20px;
  }
  .auth-gate-title {
    font-size: 1.35rem;
  }
}

/* Firebase Auth Form & Modern Input Styling */
.firebase-auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 6px;
  animation: authFadeIn 0.25s ease-out;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.firebase-auth-form .form-group,
.firebase-reset-panel .form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.form-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  user-select: none;
  transition: color 0.2s ease;
}

.form-group:focus-within .form-label {
  color: var(--primary);
}

/* Modern Input Controls (Email & Password) */
.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  min-height: 48px;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.98rem;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}

.form-control:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.08);
  background-color: var(--bg-card);
}

/* Autofill Polish */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-main);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  box-shadow: 0 0 0 1000px var(--bg-input) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Password Input Wrapper & Toggle Button */
.password-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-control {
  padding-right: 48px;
}

.btn-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.btn-toggle-pw:hover {
  opacity: 1;
  background-color: var(--bg-hover);
  transform: translateY(-50%) scale(1.08);
}

.btn-toggle-pw:active {
  transform: translateY(-50%) scale(0.95);
}

.btn-toggle-pw:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Şifremi Unuttum Link */
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-link:hover {
  color: var(--primary-hover);
  background-color: rgba(59, 130, 246, 0.1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Giriş Butonu */
.btn-gate-signin {
  margin-top: 4px;
  min-height: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gate-signin:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-gate-signin:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-gate-signin:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Şifre Sıfırlama Paneli */
.firebase-reset-panel {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: authFadeIn 0.25s ease-out;
}

.firebase-reset-panel .panel-subtitle {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.firebase-reset-panel .panel-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}

.btn-group-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

#btnSendPasswordReset {
  min-height: 48px;
  font-weight: 600;
}

#btnBackToSignIn {
  min-height: 44px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  transition: all 0.15s ease;
}

#btnBackToSignIn:hover {
  background: var(--bg-hover);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Header Session Badges & Pills */
.drive-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.drive-status-pill.disconnected {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.drive-status-pill.connected {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.drive-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.drive-status-badge.write-idle {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.drive-status-badge.write-ready {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* Dual Session Modal Styles */
.modal-card.dual-session-modal {
  max-width: 580px;
  width: 100%;
}

.session-section-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  text-align: left;
}

.session-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.session-section-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.session-desc-sm {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.session-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.firebase-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.read-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.write-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.session-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-top: 6px;
  padding: 2px 0;
}

.detail-label {
  color: var(--text-muted);
}

.detail-value {
  color: var(--text-main);
}

.detail-code {
  font-family: monospace;
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-main);
}

.status-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-pill.status-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-pill.status-disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-pill.status-idle {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
}

.status-pill.status-ready {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.modal-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Utilities */
.hidden {
  display: none !important;
}


