/* TL;DR4me - Mobile-first styles */
/* Design: Linear/Vercel inspired - sharp, minimal, confident */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --bg-primary: #000000;
  --bg-secondary: #000000;
  --bg-card: #0a0a0a;
  --bg-hover: #141414;
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-text: #000000;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #262626;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);

  /* Spacing & Sizing */
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 56px;

  /* Typography */
  --font-display: 36px;
  --font-h1: 24px;
  --font-h2: 20px;
  --font-body: 14px;
  --font-small: 12px;
  --letter-tight: -0.02em;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-top: var(--header-height);
}

/* Lucide Icons - Global styling */
[data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  display: inline-block;
  vertical-align: middle;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-title {
  font-size: var(--font-h2);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
  color: var(--accent);
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  padding: 16px;
  padding-bottom: 32px;
  max-width: 600px;
  margin: 0 auto;
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 16px;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-header img {
  margin-bottom: 16px;
}

.auth-tagline {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 400;
}

.auth-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
}

.auth-form-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 24px 0;
  text-align: center;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .form-group:last-of-type {
  margin-bottom: 24px;
}

.auth-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--success);
  font-size: 13px;
  margin-bottom: 20px;
}

.forgot-password-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.forgot-password-link .btn-link {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

.forgot-password-link .btn-link:hover {
  color: var(--accent);
}

.auth-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 16px;
}

.password-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  transition: color 0.2s ease;
}

.password-hint.error {
  color: #ef4444;
}

.password-hint.valid {
  color: #22c55e;
}

.auth-switch {
  text-align: center;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-switch .btn-link {
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  font-weight: 500;
}

.auth-switch .btn-link:hover {
  text-decoration: underline;
}

/* ============================================
   ONBOARDING
   ============================================ */

.onboarding-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: calc(100vh - 32px);
}

@media (min-width: 480px) {
  .onboarding-container {
    padding: 32px 24px;
  }
}

/* Progress Bar */
.onboarding-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  padding: 0 20px;
}

.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.progress-step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.progress-step.completed {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 60px;
  transition: background 0.3s ease;
}

.progress-line.completed {
  background: var(--accent);
}

/* Onboarding Step */
.onboarding-step {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.onboarding-header {
  text-align: center;
  margin-bottom: 32px;
}

.onboarding-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.onboarding-header p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* Onboarding Packs Grid */
.onboarding-packs-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.onboarding-pack-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  width: calc(50% - 6px);
  max-width: 160px;
  min-height: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.onboarding-pack-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.onboarding-pack-card.selected {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.08);
}

.onboarding-pack-card.selected::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
}

.onboarding-pack-card .pack-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-pack-card .pack-icon [data-lucide] {
  width: 32px;
  height: 32px;
}

.onboarding-pack-card .pack-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

/* Custom Topic Section in Onboarding */
.onboarding-custom-topic {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.onboarding-custom-topic label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

/* Onboarding Sources List */
.onboarding-sources-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.onboarding-source-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.onboarding-source-item:last-child {
  border-bottom: none;
}

.onboarding-source-item:hover {
  background: var(--bg-hover);
}

.onboarding-source-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.onboarding-source-info {
  flex: 1;
  min-width: 0;
}

.onboarding-source-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.onboarding-source-category {
  font-size: 12px;
  color: var(--text-muted);
}

.onboarding-custom-source {
  margin-bottom: 24px;
}

/* Onboarding Goals */
.onboarding-goals {
  margin-bottom: 24px;
}

.onboarding-goals textarea {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.onboarding-goals textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.onboarding-goals textarea::placeholder {
  color: var(--text-muted);
}

/* Onboarding Generate */
.onboarding-generate {
  text-align: center;
  padding: 48px 24px;
}

.generate-illustration {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
}

.generate-illustration [data-lucide] {
  width: 40px;
  height: 40px;
}

.onboarding-generate-progress,
.onboarding-saving-progress {
  margin-top: 32px;
}

.spinner-container {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
}

.spinner-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  animation: spin 1s linear infinite;
}

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

.generate-step-text {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Onboarding Complete Section */
.onboarding-complete-section {
  margin-top: 24px;
}

.complete-header {
  text-align: center;
  margin-bottom: 32px;
}

.complete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-icon [data-lucide] {
  width: 32px;
  height: 32px;
  color: var(--success);
}

.complete-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.complete-subheading {
  color: var(--text-secondary);
  font-size: 16px;
}

.what-to-expect {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.what-to-expect h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.expect-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expect-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.expect-list li [data-lucide] {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.complete-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
}

/* Onboarding Footer */
.onboarding-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.onboarding-footer span {
  color: var(--text-muted);
  font-size: 13px;
}

/* Progress Wrapper with Label */
.onboarding-progress-wrapper {
  margin-bottom: 32px;
}

.onboarding-step-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* Skip Button */
.btn-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  font-family: inherit;
  transition: color 0.15s ease;
}

.btn-skip:hover {
  color: var(--text-secondary);
}

/* Onboarding Input Section */
.onboarding-input-section {
  margin-bottom: 32px;
}

/* Pill List for Topics */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-primary);
}

.pill button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill button:hover {
  color: var(--danger);
}

.pill button [data-lucide] {
  width: 14px;
  height: 14px;
}

/* Selected Pack Sources */
.selected-pack-sources {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.pack-sources-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.pack-sources-header span {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.pack-sources-header .btn-link {
  font-size: 13px;
}

/* Source Add Form */
.source-add-form {
  margin-bottom: 16px;
}

.source-result {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.source-result.success {
  border-color: var(--success);
}

.source-result.error {
  border-color: var(--danger);
}

.source-result.warning {
  border-color: var(--warning);
}

.source-result .warning-message {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.source-not-found {
  display: flex;
  flex-direction: column;
}

.source-result .source-found {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-result .source-info {
  flex: 1;
}

.source-result .source-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.source-result .source-url {
  font-size: 12px;
  color: var(--text-muted);
}

.source-result .error-message {
  color: var(--danger);
  font-size: 13px;
}

/* Custom Sources List */
.custom-sources-list {
  margin-top: 16px;
}

.custom-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.custom-source-item:last-child {
  margin-bottom: 0;
}

.custom-source-item .source-info {
  flex: 1;
}

.custom-source-item .source-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.custom-source-item .source-category {
  font-size: 12px;
  color: var(--text-muted);
}

.custom-source-item button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.custom-source-item button:hover {
  color: var(--danger);
}

.custom-source-item button [data-lucide] {
  width: 16px;
  height: 16px;
}

/* About You - Step 4 Conversational */

/* Intent Cards */
.intent-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.intent-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.intent-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.intent-card.selected {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.1);
}

.intent-icon {
  width: 48px;
  height: 48px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.intent-icon [data-lucide] {
  width: 24px;
  height: 24px;
}

.intent-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.intent-content p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Context Questions */
.context-questions {
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.context-section-header {
  margin-bottom: 20px;
}

.context-section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.context-hint {
  font-size: 14px;
  color: var(--text-muted);
}

.context-fields {
  animation: fadeIn 0.3s ease;
}

/* Checkbox Pills */
.checkbox-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-pill input[type="checkbox"] {
  display: none;
}

.checkbox-pill span {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.checkbox-pill:hover span {
  border-color: var(--accent);
}

.checkbox-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* More Details Section */
.more-details {
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.expand-more-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
  font-family: inherit;
}

.expand-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.expand-more-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.more-fields {
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

/* Form Row (shared) */
.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-row input[type="text"],
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--text-muted);
}

.form-row textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Radio Group (legacy, keeping for settings) */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.radio-option:hover {
  border-color: var(--accent);
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option span {
  font-size: 14px;
  color: var(--text-primary);
}

.radio-option:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
}

.radio-option:has(input:checked) span {
  color: var(--accent-text);
}

/* Advanced Toggle */
.advanced-toggle {
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.advanced-toggle .btn-link {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.advanced-toggle .btn-link [data-lucide] {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.advanced-toggle .btn-link.expanded [data-lucide] {
  transform: rotate(180deg);
}

.advanced-section {
  padding-top: 16px;
}

/* ============================================
   EPISODE CARD & PLAYER
   ============================================ */

.episode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.episode-title {
  font-size: var(--font-h2);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
  flex: 1;
}

.episode-duration {
  font-size: var(--font-small);
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-left: 12px;
}

/* Audio Player */
.player {
  margin-bottom: 16px;
}

.player.audio-unavailable .player-controls,
.player.audio-unavailable .player-progress {
  opacity: 0.3;
  pointer-events: none;
}

.player.audio-unavailable .episode-duration {
  color: var(--warning);
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.player-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-btn:hover {
  background: var(--bg-hover);
}

.play-btn {
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: var(--accent-text);
}

.play-btn:hover {
  background: var(--accent-hover);
}

.play-btn [data-lucide] {
  width: 28px;
  height: 28px;
}

.play-btn .play-icon {
  margin-left: 3px;
}

.skip-btn {
  position: relative;
}

.skip-btn [data-lucide] {
  width: 24px;
  height: 24px;
}

.skip-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* Progress Slider */
.player-progress {
  margin-bottom: 12px;
}

.progress-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.progress-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Speed Control */
.player-speed {
  display: flex;
  justify-content: center;
}

.speed-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--font-small);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* No Episode State */
.no-episode {
  text-align: center;
  padding: 32px 0;
}

.no-episode p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Ad-hoc Section */
.adhoc-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.adhoc-section label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.adhoc-input-group {
  display: flex;
  gap: 8px;
}

.adhoc-input-group input {
  flex: 1;
}

.adhoc-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.adhoc-current span {
  font-size: var(--font-body);
  font-weight: 500;
}

.adhoc-current .btn-icon {
  color: var(--accent-text);
}

.adhoc-current .btn-icon [data-lucide] {
  width: 18px;
  height: 18px;
}

/* Section Titles */
.section-title {
  font-size: var(--font-body);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: var(--font-small);
}

/* Show Notes */
.show-notes-section {
  margin-bottom: 20px;
}

.show-notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.show-note-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.show-note-item:last-child {
  border-bottom: none;
}

.show-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.show-note-source {
  font-size: var(--font-small);
  color: var(--accent);
  font-weight: 500;
}

.show-note-title {
  font-size: var(--font-body);
  font-weight: 500;
  margin-bottom: 4px;
}

.show-note-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.show-note-title a:hover {
  color: var(--accent);
}

.show-note-summary {
  font-size: var(--font-small);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Story Feedback Buttons */
.story-feedback-buttons {
  display: flex;
  gap: 4px;
}

.story-feedback-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all 0.15s ease;
  border-radius: 4px;
}

.story-feedback-btn:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.story-feedback-btn.active {
  opacity: 1;
}

.story-feedback-btn[data-rating="up"].active {
  color: var(--accent);
}

.story-feedback-btn[data-rating="down"].active {
  color: #ef4444;
}

.story-feedback-btn svg {
  width: 14px;
  height: 14px;
}

/* Episode Feedback Section */
.episode-feedback-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.feedback-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-question {
  font-size: var(--font-body);
  color: var(--text-secondary);
}

.feedback-buttons {
  display: flex;
  gap: 8px;
}

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.feedback-btn.active {
  border-color: var(--accent);
}

.feedback-btn[data-rating="up"].active {
  color: var(--accent);
  background: rgba(6, 182, 212, 0.1);
}

.feedback-btn[data-rating="down"].active {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.feedback-btn svg {
  width: 18px;
  height: 18px;
}

.feedback-btn.submitted {
  pointer-events: none;
  opacity: 0.5;
}

.feedback-btn.submitted.active {
  opacity: 1;
}

.feedback-comment-section {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.feedback-comment-textarea {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: var(--font-small);
  font-family: inherit;
  resize: none;
}

.feedback-comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-comment-textarea::placeholder {
  color: var(--text-muted);
}

.feedback-thanks {
  margin-top: 12px;
  color: var(--accent);
  font-size: var(--font-small);
  line-height: 1.4;
  opacity: 0;
  animation: feedbackFadeIn 0.4s ease forwards;
}

@keyframes feedbackFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Previous Episodes */
.previous-section {
  margin-bottom: 20px;
}

.previous-episodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.previous-episode {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.previous-episode:hover {
  border-color: var(--accent);
}

.previous-episode-icon {
  color: var(--text-muted);
}

.previous-episode-title {
  font-size: 14px;
  flex: 1;
}

.previous-episode-duration {
  font-size: 12px;
  color: var(--text-muted);
}

.previous-episode.audio-unavailable {
  opacity: 0.5;
  cursor: default;
}

.previous-episode.audio-unavailable:hover {
  background: transparent;
}

.previous-episode.audio-unavailable .previous-episode-duration {
  color: var(--warning);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: var(--font-body);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn [data-lucide] {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: #1a1a1a;
  border: 1px solid #333;
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: #222;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  gap: 12px;
}

.btn-large [data-lucide] {
  width: 22px;
  height: 22px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-sm [data-lucide] {
  width: 14px;
  height: 14px;
}

.btn-icon {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link [data-lucide] {
  width: 16px;
  height: 16px;
}

/* ============================================
   FORMS
   ============================================ */

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--font-body);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: var(--font-small);
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ============================================
   SETTINGS VIEW
   ============================================ */

.settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.settings-header h2 {
  font-size: var(--font-h2);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-section {
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: var(--font-body);
  font-weight: 600;
  letter-spacing: var(--letter-tight);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section h3 [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.section-desc {
  font-size: var(--font-small);
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Settings List (Sources) */
.settings-list {
  margin-bottom: 12px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.source-item:last-child {
  margin-bottom: 0;
}

.source-toggle {
  width: 40px;
  height: 22px;
  background: #333;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.source-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #666;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.15s ease;
}

.source-toggle.active {
  background: var(--accent);
}

.source-toggle.active::after {
  left: 20px;
  background: white;
}

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

.source-name {
  font-size: var(--font-body);
  font-weight: 500;
}

.source-category {
  font-size: var(--font-small);
  color: var(--text-muted);
}

.source-actions {
  display: flex;
  gap: 6px;
}

.source-actions button {
  background: #0a0a0a;
  border: 1px solid #333;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: var(--font-small);
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-actions button:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.source-actions button.delete:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
}

/* Chip List */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* When chip-list contains topic-interest-items, use column layout */
.chip-list:has(.topic-interest-item) {
  flex-direction: column;
  gap: 0;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip button:hover {
  color: var(--danger);
}

.chip button [data-lucide] {
  width: 14px;
  height: 14px;
}

.add-input-group {
  display: flex;
  gap: 8px;
}

.add-input-group input {
  flex: 1;
  padding: 10px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-input-group input::placeholder {
  color: var(--text-muted);
}

.add-input-group input:hover {
  border-color: #444;
}

.add-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.add-input-group .btn {
  background: #1a1a1a;
  border: 1px solid #333;
}

.add-input-group .btn:hover {
  border-color: var(--accent);
  background: #222;
}

.add-input-group .btn [data-lucide] {
  width: 18px;
  height: 18px;
}

/* Topic Interest Items with Controls */
.topic-interest-item {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  max-width: 100%;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.topic-interest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.topic-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0; /* Allow flex item to shrink */
}

.topic-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.topic-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.topic-delete-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.topic-interest-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topic-control-full {
  width: 100%;
}

.topic-control label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 480px) {
  .topic-control label {
    white-space: nowrap;
  }
}

/* Settings depth pills */
.topic-interest-item .depth-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-interest-item .depth-pill {
  cursor: pointer;
}

.topic-interest-item .depth-pill input {
  display: none;
}

.topic-interest-item .depth-pill span {
  display: block;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.topic-interest-item .depth-pill:hover span {
  border-color: var(--accent);
}

.topic-interest-item .depth-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Settings framing pills - slightly smaller than onboarding */
.topic-interest-item .framing-pill .framing-text {
  padding: 5px 8px;
  font-size: 11px;
}

@media (min-width: 480px) {
  .topic-interest-item .framing-pill .framing-text {
    padding: 6px 10px;
    font-size: 12px;
  }
}

.topic-control select {
  /* Remove native OS styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Compact flat dark styling */
  padding: 5px 26px 5px 10px;
  font-size: 12px;
  font-family: inherit;
  background-color: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;

  /* Custom dropdown arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
}

.topic-control select:hover {
  border-color: #444;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.topic-control select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Style the dropdown options */
.topic-control select option {
  background-color: #1a1a1a;
  color: var(--text-primary);
  padding: 8px;
}

/* Account Section in Settings */
.account-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0;
}

.account-name-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-name-row label {
  font-size: 13px;
  color: var(--text-muted);
}

.name-edit-group {
  display: flex;
  gap: 8px;
}

.name-edit-group input {
  flex: 1;
  padding: 10px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.name-edit-group input:hover {
  border-color: #444;
}

.name-edit-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
  outline: none;
}

/* Goals List */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  gap: 12px;
}

.goal-item.editing {
  gap: 8px;
}

.goal-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.goal-edit-input {
  flex: 1;
  padding: 6px 10px;
  background: #0a0a0a;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.goal-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.goal-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.goal-actions button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.goal-edit-btn:hover {
  color: var(--accent) !important;
}

.goal-delete-btn:hover,
.goal-cancel-btn:hover {
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

.goal-save-btn:hover {
  color: var(--success) !important;
  background: rgba(34, 197, 94, 0.1) !important;
}

.goal-actions [data-lucide] {
  width: 16px;
  height: 16px;
}

/* Context / About Me Section */
.context-edit-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-edit-container textarea {
  width: 100%;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.context-edit-container textarea:hover {
  border-color: #444;
}

.context-edit-container textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
  outline: none;
}

.context-edit-container textarea::placeholder {
  color: var(--text-muted);
}

.context-edit-container .btn {
  align-self: flex-start;
}

.name-edit-group .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  background: #1a1a1a;
  border: 1px solid #333;
}

/* Timezone Settings */
.timezone-edit-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.timezone-select {
  flex: 1;
  padding: 10px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.timezone-select:hover {
  border-color: #444;
}

.timezone-select:focus {
  border-color: var(--accent);
  outline: none;
}

.timezone-current {
  font-size: 12px;
}

.user-email {
  color: var(--text-primary);
  font-size: var(--font-body);
}

/* Search Input with Icon */
.starter-packs-search,
.all-packs-search {
  position: relative;
  margin-bottom: 12px;
}

.starter-packs-search .search-icon,
.all-packs-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.starter-packs-search input,
.all-packs-search input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

/* ============================================
   STARTER PACKS
   ============================================ */

.starter-packs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.starter-pack-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.starter-pack-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.pack-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.pack-icon [data-lucide] {
  width: 20px;
  height: 20px;
}

.pack-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pack-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pack-preview {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Starter Pack Modal */
.pack-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 14px;
}

.pack-sources-list {
  margin-bottom: 16px;
}

.pack-source-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pack-source-item:hover {
  background: var(--bg-hover);
}

.pack-source-item.already-added {
  opacity: 0.5;
  cursor: not-allowed;
}

.pack-source-item.already-added:hover {
  background: var(--bg-primary);
}

.pack-source-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.pack-source-checkbox:disabled {
  cursor: not-allowed;
}

.pack-source-info {
  flex: 1;
  min-width: 0;
}

.pack-source-name {
  font-size: 14px;
  color: var(--text-primary);
}

.pack-source-category {
  font-size: 11px;
  color: var(--text-muted);
}

.pack-source-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pack-add-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
}

.pack-add-result.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.pack-add-result.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.pack-add-result.info {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent);
}

/* All Packs Modal */
.all-packs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.starter-pack-card-large {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.starter-pack-card-large:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.pack-icon-large {
  font-size: 32px;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.pack-icon-large [data-lucide] {
  width: 32px;
  height: 32px;
}

.pack-info-large {
  flex: 1;
}

.pack-info-large .pack-name {
  font-size: 15px;
  margin-bottom: 4px;
}

.pack-info-large .pack-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pack-info-large .pack-preview {
  font-size: 12px;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 100vw;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-small {
  max-width: 400px;
  border-radius: var(--radius);
  margin: auto;
}

.modal-large {
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close [data-lucide] {
  width: 24px;
  height: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
}

/* Test Result */
.test-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.test-result.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.test-result.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.test-result code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

.test-result small {
  color: var(--text-muted);
}

.test-result.success small {
  color: rgba(34, 197, 94, 0.8);
}

.test-result.error small {
  color: rgba(239, 68, 68, 0.7);
}

.feed-found {
  display: block;
  margin-bottom: 4px;
}

.feed-not-found {
  display: block;
  margin-bottom: 4px;
}

/* Source Details Section */
.source-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.source-details.hidden {
  display: none;
}

.source-details input[readonly] {
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Generation Progress */
.generate-progress {
  text-align: center;
  padding: 24px 0;
}

.generate-progress h3 {
  margin: 16px 0 12px;
  font-size: 16px;
}

.progress-bar {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Legacy Spinner (for non-Lucide spinners) */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* Toast */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  animation: slideDown 0.2s ease;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

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

/* Utilities */
.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 768px) {
  .modal-content {
    max-width: 480px;
    margin: auto;
    border-radius: var(--radius);
  }

  .modal-large {
    max-width: 600px;
  }

  .starter-packs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .onboarding-pack-card {
    width: calc(33.333% - 8px);
    max-width: 150px;
  }
}

/* ============================================
   BUTTON LOADING STATE
   ============================================ */

.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading .btn-text {
  visibility: hidden;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
}

/* Delivery info note */
.delivery-note {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.delivery-note [data-lucide] {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.delivery-note p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ============================================
   NEW ONBOARDING STYLES
   ============================================ */

/* Goal & Context Textareas */
.goal-textarea,
.context-textarea {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.goal-textarea:focus,
.context-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.goal-textarea::placeholder,
.context-textarea::placeholder {
  color: var(--text-muted);
}

/* Skip link for optional steps */
.skip-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.skip-link:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* Name Input (onboarding step 1) */
#onboarding-step-1 .onboarding-input-section {
  display: flex;
  justify-content: center;
}

.name-input {
  width: 100%;
  max-width: 300px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 18px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.name-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.name-input::placeholder {
  color: var(--text-muted);
}

/* Topic Boxes */
.topic-boxes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.topic-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topic-box .topic-input {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topic-box .topic-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.topic-box .topic-input::placeholder {
  color: var(--text-muted);
}

.topic-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.topic-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.topic-remove-btn [data-lucide] {
  width: 18px;
  height: 18px;
}

.btn-add-topic {
  width: 100%;
  justify-content: center;
}

/* Calibration List */
.calibration-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-x: hidden;
}

.calibration-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: hidden;
}

@media (min-width: 480px) {
  .calibration-item {
    padding: 20px;
  }
}

.calibration-topic-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.calibration-topic-name::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.calibration-section {
  margin-bottom: 16px;
}

.calibration-section:last-child {
  margin-bottom: 0;
}

.calibration-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: block;
}

/* Framing Options (Multi-select pills with ranking) */
.framing-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.framing-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.framing-pill .framing-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .framing-pill .framing-text {
    padding: 8px 12px;
    font-size: 13px;
  }
}

.framing-pill:hover .framing-text {
  border-color: var(--accent);
}

.framing-pill.selected .framing-text {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.framing-rank {
  display: none;
  min-width: 16px;
  height: 16px;
  background: var(--accent-text);
  color: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.framing-pill.selected .framing-rank {
  display: inline-flex;
}

/* Depth Options (Single-select pills) */
.depth-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.depth-pill {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.depth-pill input[type="radio"] {
  display: none;
}

.depth-pill span {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

@media (min-width: 480px) {
  .depth-pill span {
    padding: 8px 14px;
    font-size: 13px;
  }
}

.depth-pill:hover span {
  border-color: var(--accent);
}

.depth-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Sources Section */
.sources-section {
  margin-bottom: 24px;
}

.sources-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sources-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Sources Only Toggle */
.sources-only-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Summary Section */
.onboarding-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.summary-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.summary-section:first-child {
  padding-top: 0;
}

.summary-section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.summary-value .summary-topic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
  margin: 2px 4px 2px 0;
}

/* Topic cards with depth and framing tags */
.summary-topic-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.summary-topic-card:last-child {
  margin-bottom: 0;
}

.summary-topic-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.summary-topic-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-tag {
  display: inline-block;
  background: #0a0a0a;
  border: 1px solid #333;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.summary-value .summary-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 13px;
  margin-right: 8px;
}

/* ============================================
   STEP 5: SOURCES UI STYLES
   ============================================ */

.sources-prompt {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.source-add-section {
  margin-bottom: 16px;
}

.btn-add-source {
  width: 100%;
  justify-content: center;
}

.source-helper-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Mobile source find button - ensure proper touch target */
.source-add-form .add-input-group {
  display: flex;
  gap: 8px;
}

.source-add-form .add-input-group .btn {
  min-width: 70px;
  min-height: 44px; /* Minimum touch target for mobile */
  padding: 10px 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.source-add-form .add-input-group input {
  min-height: 44px; /* Match button height */
}

@media (max-width: 480px) {
  .source-add-form .add-input-group {
    flex-direction: column;
  }

  .source-add-form .add-input-group .btn {
    width: 100%;
    min-height: 48px;
  }

  .source-add-form .add-input-group input {
    min-height: 48px;
  }
}

.sources-footer-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
  text-align: center;
}

/* ============================================
   STEP 6: SIGNUP SECTION STYLES
   ============================================ */

/* Centered header for step 8 (account creation) */
.onboarding-header-centered {
  text-align: center;
}

.onboarding-header-centered h2 {
  font-size: 28px;
}

.onboarding-header-centered p {
  font-size: 16px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.onboarding-signup-section {
  margin-top: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.onboarding-complete-setup-section {
  margin-top: 32px;
}

.onboarding-signup-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}

.onboarding-signup-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
}

.onboarding-signup-form .form-group {
  margin-bottom: 20px;
}

.onboarding-signup-form .form-group:last-of-type {
  margin-bottom: 24px;
}

.onboarding-signup-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.onboarding-signup-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
}

.onboarding-signup-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.onboarding-signup-section .auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Generate Section (for logged-in users) */
.onboarding-generate-section {
  margin-top: 24px;
  text-align: center;
}

/* ============================================
   SUBSCRIPTION UI
   ============================================ */

.subscription-info {
  padding: 12px 0;
}

.subscription-status {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.subscription-status.active {
  color: var(--success);
}

.subscription-status.trialing {
  color: var(--accent);
}

.subscription-status.expired {
  color: var(--danger);
}

.subscription-detail {
  font-size: 12px;
}

.subscription-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Upgrade Modal */
.upgrade-modal-content {
  text-align: center;
  max-width: 420px;
}

.upgrade-header {
  margin-bottom: 24px;
}

.upgrade-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
}

.upgrade-icon [data-lucide] {
  width: 32px;
  height: 32px;
}

.upgrade-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

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

.upgrade-pricing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.price-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 20px;
}

.price-currency {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.price-period {
  font-size: 16px;
  color: var(--text-muted);
}

.upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.upgrade-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
}

.upgrade-features li [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--success);
  flex-shrink: 0;
}

.upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-actions .btn-link {
  color: var(--text-muted);
}

/* Trial banner */
.trial-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trial-banner-text {
  font-size: 13px;
  color: var(--text-primary);
}

.trial-banner-text strong {
  color: var(--accent);
}

.trial-banner .btn {
  flex-shrink: 0;
}

/* Trial Ended Banner */
.trial-ended-banner {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 16px -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.trial-ended-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.trial-ended-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.trial-ended-banner .btn-small {
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
}

.trial-ended-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.trial-ended-dismiss:hover {
  color: var(--text-primary);
}

.trial-ended-dismiss [data-lucide] {
  width: 18px;
  height: 18px;
}

/* Locked Episode */
.locked-icon {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.locked-episode-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.locked-episode-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.locked-episode-stories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.locked-episode-stories li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.locked-episode-stories li [data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Previous episode with lock icon */
.previous-episode.locked {
  opacity: 0.7;
}

.previous-episode.locked .previous-episode-icon {
  color: var(--warning);
}

/* ============================================
   FEEDBACK
   ============================================ */

.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.feedback-fab:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.feedback-fab svg {
  width: 20px;
  height: 20px;
}

/* Hide FAB on settings/onboarding views and login */
.view.active#settings-view ~ .feedback-fab,
.view.active#onboarding-view ~ .feedback-fab,
.view.active#login-view ~ .feedback-fab,
.view.active#signup-view ~ .feedback-fab {
  display: none;
}

.feedback-textarea {
  width: 100%;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-textarea::placeholder {
  color: var(--text-muted);
}

#feedback-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  color: var(--success);
}

#feedback-success svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .feedback-fab {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* App Footer */
.app-footer {
  padding: 24px 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--text-secondary);
}

.footer-dot {
  margin: 0 8px;
  opacity: 0.5;
}

/* Auth Terms Agreement */
.auth-terms {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.auth-terms a {
  color: var(--accent);
  text-decoration: none;
}

.auth-terms a:hover {
  text-decoration: underline;
}
