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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

.container { max-width: 700px; margin: 0 auto; padding: 24px 16px 100px; }

/* Hero */
.hero {
  text-align: center;
  padding: 32px 0 28px;
  margin-bottom: 8px;
}
.hero-logo {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #818cf8, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.hero-tagline {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 8px;
}
.hero-cta {
  font-size: 0.85rem;
  color: #6366f1;
  font-weight: 600;
}

/* Nav */
nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: space-around;
  padding: 10px 0 14px;
  z-index: 50;
}
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.72rem;
  transition: color 0.15s;
}
nav a .icon { font-size: 1.4rem; }
nav a.active { color: #818cf8; }
nav a:hover { color: #a5b4fc; }

/* Cards */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Typography */
h1 { font-size: 1.6rem; font-weight: 700; color: #f8fafc; margin-bottom: 4px; }
.subtitle { color: #64748b; font-size: 0.88rem; margin-bottom: 24px; }

/* Buttons */
.btn {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #4338ca; }
.btn:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
.btn.secondary {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
}
.btn.secondary:hover { background: #334155; color: #e2e8f0; }
.btn.danger { background: #ef4444; }
.btn.danger:hover { background: #dc2626; }
.btn.full { width: 100%; }

/* Form elements */
label { display: block; font-size: 0.83rem; color: #64748b; margin-bottom: 5px; }
input[type="text"], select, input[type="url"] {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e2e8f0;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
input:focus, select:focus { outline: none; border-color: #6366f1; }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag {
  background: #1e3a5f;
  color: #7dd3fc;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.tag.active { background: #1d4ed8; color: #fff; border-color: #3b82f6; }
.tag:hover { border-color: #3b82f6; }

/* Status */
.status {
  text-align: center;
  padding: 10px;
  font-size: 0.88rem;
  color: #64748b;
  display: none;
}
.status.show { display: block; }

/* Add row */
.add-row { display: flex; gap: 8px; }
.add-row input, .add-row select { margin-bottom: 0; flex: 1; }

/* List items */
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
}
.list-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .remove-btn {
  background: none; border: none;
  color: #ef4444; cursor: pointer;
  font-size: 1rem; line-height: 1;
  padding: 2px 4px;
}

/* Badge */
.badge {
  display: inline-block;
  background: #312e81;
  color: #a5b4fc;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.premium { background: #78350f; color: #fcd34d; }

/* Player */
.player-card {
  background: linear-gradient(135deg, #1e1b4b, #1e293b);
  border: 1px solid #4f46e5;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}
.player-date {
  font-size: 0.8rem;
  color: #6366f1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.player-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 20px;
}
.play-circle {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #6366f1;
  color: #a5b4fc;
  font-size: 1.8rem;
  cursor: pointer;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.play-circle:hover { border-color: #a5b4fc; color: #f1f5f9; transform: scale(1.05); }
.play-circle.playing { border-color: #a5b4fc; color: #f1f5f9; }
.progress-bar {
  width: 100%;
  height: 4px;
  background: #334155;
  border-radius: 2px;
  margin: 12px 0;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s linear;
}
.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

/* Transcript */
.transcript {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #94a3b8;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.transcript-toggle {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
}

/* History list */
.history-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 14px;
}
.history-item:hover { border-color: #6366f1; }
.history-item.active { border-color: #4f46e5; background: #1a1f3a; }
.history-date {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}
.history-meta {
  font-size: 0.78rem;
  color: #6366f1;
  margin-bottom: 4px;
}
.history-preview {
  font-size: 0.83rem;
  color: #64748b;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.history-play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #4f46e5;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-play:hover { background: #4338ca; }

/* Mic button */
.voice-ctrl {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 100;
}
.mic-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: none;
  background: #1e293b;
  border: 2px solid #334155;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  transition: all 0.15s;
}
.mic-btn:hover { border-color: #6366f1; color: #a5b4fc; }
.mic-btn.listening {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}
.mic-label {
  font-size: 0.68rem;
  color: #475569;
  text-align: center;
  white-space: nowrap;
}
.voice-feedback {
  position: fixed;
  bottom: 152px;
  right: 20px;
  background: #1e293b;
  border: 1px solid #4f46e5;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #a5b4fc;
  max-width: 200px;
  text-align: center;
  display: none;
  z-index: 100;
}
.voice-feedback.show { display: block; }

/* Generate button */
.generate-card {
  text-align: center;
  padding: 40px 20px;
}
.generate-card p {
  color: #64748b;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #64748b;
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Premium section */
.premium-section { display: none; }
.premium-section.show { display: block; }
.lock-icon { font-size: 1rem; margin-right: 4px; }

/* Insights */
.insights-section {
  margin-top: 14px;
  border-top: 1px solid #1e293b;
  padding-top: 14px;
}
.insight-item {
  margin-bottom: 10px;
}
.insight-story {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 3px;
}
.insight-why {
  font-size: 0.83rem;
  color: #cbd5e1;
  line-height: 1.5;
}
.insight-label {
  color: #fbbf24;
  font-weight: 600;
  margin-right: 4px;
}

/* Sources */
.sources-section {
  margin-top: 14px;
  border-top: 1px solid #1e293b;
  padding-top: 14px;
}
.source-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.source-link {
  display: inline-block;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #6366f1;
  text-decoration: none;
  transition: border-color 0.15s;
}
.source-link:hover { border-color: #6366f1; color: #a5b4fc; }
.source-link.no-link { color: #475569; cursor: default; }

/* Perspectives */
.perspectives {
  margin-top: 14px;
  border-top: 1px solid #1e293b;
  padding-top: 14px;
}
.perspectives-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.perspective-story {
  margin-bottom: 12px;
}
.perspective-story-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}
.perspective-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.perspective-source-name {
  font-size: 0.78rem;
  color: #64748b;
  width: 80px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tone-bar-wrap {
  flex: 1;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}
.tone-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.tone-label {
  font-size: 0.7rem;
  width: 54px;
  flex-shrink: 0;
  text-align: right;
}
.tone-positive { color: #4ade80; }
.tone-neutral  { color: #94a3b8; }
.tone-negative { color: #f87171; }
.perspective-note {
  font-size: 0.72rem;
  color: #475569;
  margin-left: 88px;
  margin-bottom: 2px;
  line-height: 1.4;
}

/* Country toggles */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.country-btn {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.country-btn.active { background: #1e3a5f; border-color: #3b82f6; color: #7dd3fc; }
