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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

h1 { margin-bottom: 16px; }
p { margin-bottom: 12px; }

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
}

textarea { resize: vertical; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin-top: 16px;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  background: #e5e7eb;
  color: #333;
}

.btn-small {
  padding: 4px 12px;
  font-size: 14px;
  margin-top: 0;
}

.login-page {
  text-align: center;
  margin-top: 100px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goals-preview {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goals-content {
  margin-top: 8px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

.goals-content.collapsed {
  max-height: 0;
  margin-top: 0;
}

.sessions-section {
  margin-top: 24px;
}

.sessions-section h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.session-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

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

.session-card-header h3 {
  font-size: 16px;
  margin: 0;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-draft { background: #e5e7eb; color: #6b7280; }
.status-generating_audio { background: #fef3c7; color: #92400e; }
.status-ready { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.session-meta {
  font-size: 13px;
  color: #6b7280;
}

.session-error {
  margin-top: 8px;
  font-size: 13px;
  color: #991b1b;
}

.empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 32px 0;
}

/* Player */

.player-page {
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.player-loading,
.player-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 18px;
}

.player-error a { color: #60a5fa; }

.player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0,0,0,0.3);
}

.player-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: #e0e0e0;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.player-topic {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 20px;
}

.player-section-info {
  text-align: center;
}

.player-section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.player-progress-text {
  font-size: 14px;
  color: #9ca3af;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.player-toggle-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.player-toggle-btn:hover { background: #1d4ed8; }
.player-toggle-btn:active { background: #1e40af; }

.player-skip-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #e0e0e0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.player-skip-btn:hover { background: rgba(255,255,255,0.1); }
.player-skip-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.player-skip-btn:disabled:hover { background: transparent; }

.player-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-time {
  font-size: 16px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.player-restart-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.player-restart-btn:hover { background: rgba(255,255,255,0.1); }

.player-highwater-btn {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96,165,250,0.4);
  background: rgba(96,165,250,0.1);
  color: #60a5fa;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s;
}

.player-highwater-btn:hover { background: rgba(96,165,250,0.25); }

.player-seek-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.player-seek-btn:hover { background: rgba(255,255,255,0.1); }

/* Voice Notes */

.hidden { display: none !important; }

.player-note-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.player-note-btn {
  padding: 10px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #e0e0e0;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.player-note-btn:hover { background: rgba(255,255,255,0.1); }

.player-note-btn.recording {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.player-recording-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(220,38,38,0.15);
  border-radius: 8px;
  font-size: 14px;
  color: #fca5a5;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes pulse-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

.player-cancel-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: #e0e0e0;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
}

.player-cancel-btn:hover { background: rgba(255,255,255,0.1); }

.player-note-status {
  font-size: 14px;
  color: #86efac;
  text-align: center;
}

.player-notes-section {
  width: 100%;
  max-width: 400px;
}

.player-notes-toggle {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  width: 100%;
  text-align: left;
}

.player-notes-toggle:hover { color: #e0e0e0; }

.player-notes-list {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-item {
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 8px 12px;
}

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

.note-time {
  font-size: 12px;
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}

.note-text {
  font-size: 14px;
  color: #d1d5db;
  line-height: 1.4;
}

.note-delete-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.note-delete-btn:hover { color: #ef4444; }

.note-pending { opacity: 0.7; }

.note-status-label {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
}
