/* ===== Design Tokens ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);

  --accent-teal: #6ee7b7;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-glow: 0 0 30px rgba(110, 231, 183, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);

  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(110, 231, 183, 0.06), transparent);
}

/* ===== Glass Effect ===== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ===== Screen Layout ===== */
.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.hidden {
  display: none;
}

/* ===== Connect Card ===== */
.connect-card {
  max-width: 440px;
  width: 90%;
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-area {
  margin-bottom: 32px;
}

.logo-icon {
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-area h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-area h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

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

/* ===== Feature Chips ===== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 32px;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.feature-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(110, 231, 183, 0.2);
  transform: translateY(-1px);
}

.feature-icon {
  font-size: 1rem;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 28px;
  background: var(--gradient-primary);
  color: #0a0e1a;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(110, 231, 183, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(110, 231, 183, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.hint {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== App Section Layout ===== */
#app-section {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}

/* ===== Header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status.connecting::before { background: #f59e0b; animation: pulse 1.5s infinite; }
.status.connected::before { background: var(--accent-teal); box-shadow: 0 0 8px rgba(110, 231, 183, 0.5); }
.status.disconnected::before { background: #ef4444; }
.status.error::before { background: #ef4444; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.model-badge {
  font-size: 0.68rem;
  padding: 3px 10px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lang-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.lang-select:focus {
  border-color: var(--accent-teal);
}

.lang-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-only:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ===== Chat Area ===== */
.chat-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.chat-log::-webkit-scrollbar {
  width: 4px;
}

.chat-log::-webkit-scrollbar-track {
  background: transparent;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.6;
  animation: msgAppear 0.25s ease-out;
  word-wrap: break-word;
}

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

.message.user {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.message.gemini {
  align-self: flex-start;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.15);
  color: #d1fae5;
}

.message.system {
  align-self: center;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--text-secondary);
  font-size: 0.78rem;
  max-width: 90%;
}

/* ===== Controls Footer ===== */
.controls {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  flex-shrink: 0;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-mic {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-mic:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-mic.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-mic.active .mic-pulse {
  display: block;
}

.mic-pulse {
  display: none;
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.4);
  animation: micPulse 1.5s ease-out infinite;
}

@keyframes micPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ===== Voice Visualizer ===== */
.voice-visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.3s;
}

.voice-visualizer.active {
  opacity: 1;
}

.viz-bar {
  width: 3px;
  height: 6px;
  background: var(--accent-teal);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.voice-visualizer.active .viz-bar {
  animation: vizBounce 0.6s ease-in-out infinite alternate;
}

.voice-visualizer.active .viz-bar:nth-child(1) { animation-delay: 0s; }
.voice-visualizer.active .viz-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-visualizer.active .viz-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-visualizer.active .viz-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-visualizer.active .viz-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes vizBounce {
  0% { height: 6px; }
  100% { height: 28px; }
}

/* ===== Text Input ===== */
.text-input-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  transition: border-color 0.2s;
}

.text-input-area:focus-within {
  border-color: rgba(110, 231, 183, 0.3);
}

#textInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

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

.btn-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #0a0e1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(110, 231, 183, 0.3);
}

/* ===== Scenario Selection ===== */
.select-container {
  max-width: 720px;
  width: 92%;
  margin: 0 auto;
  padding: 40px 0;
  max-height: 100vh;
  overflow-y: auto;
}

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

.select-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scenario-card-select {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}

.scenario-card-select:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(110, 231, 183, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.scenario-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.scenario-card-body {
  flex: 1;
  min-width: 0;
}

.scenario-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.scenario-card-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.scenario-card-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.scenario-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-leicht { background: rgba(110, 231, 183, 0.15); color: var(--accent-teal); }
.badge-mittel { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-schwer { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-duration { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.scenario-category {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.loading-text,
.error-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px 0;
}

.error-text { color: #ef4444; }

/* ===== Secondary Button ===== */
.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* ===== Scenario Card ===== */
.scenario-card {
  max-width: 540px;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}

.scenario-card .logo-area {
  text-align: center;
}

.scenario-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.scenario-briefing {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-md);
}

.scenario-briefing h3,
.learning-goals h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scenario-briefing p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.scenario-detail {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-label {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.learning-goals {
  margin-bottom: 24px;
}

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(110, 231, 183, 0.05);
  border: 1px solid rgba(110, 231, 183, 0.1);
  border-radius: var(--radius-sm);
}

.tip-item strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tip-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.tip-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent-teal);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== Role Indicator ===== */
.role-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.role-separator {
  color: var(--text-muted);
}

.role-label {
  white-space: nowrap;
}

/* ===== End Scenario Button ===== */
.btn-end-scenario {
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: #f59e0b;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-end-scenario:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* ===== Message Roles ===== */
.message-role {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message.user .message-role {
  color: rgba(59, 130, 246, 0.7);
}

.message.gemini .message-role {
  color: rgba(110, 231, 183, 0.7);
}

.message-text {
  display: block;
}

/* ===== Evaluation Card ===== */
.evaluation-card {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.evaluation-loading {
  text-align: center;
  padding: 40px 0;
}

.evaluation-loading p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Evaluation Content ===== */
.evaluation-content {
  text-align: center;
}

.eval-score {
  margin-bottom: 24px;
}

.score-circle {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

.score-circle.score-good {
  background: rgba(110, 231, 183, 0.12);
  border: 1px solid rgba(110, 231, 183, 0.25);
}

.score-circle.score-ok {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.score-circle.score-low {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.score-number {
  font-size: 2.5rem;
  font-weight: 700;
}

.score-good .score-number { color: var(--accent-teal); }
.score-ok .score-number { color: #f59e0b; }
.score-low .score-number { color: #ef4444; }

.score-max {
  font-size: 1rem;
  color: var(--text-muted);
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Category Scores ===== */
.eval-categories {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.eval-category {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

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

.cat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-score {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.cat-score.score-good { background: rgba(110, 231, 183, 0.15); color: var(--accent-teal); }
.cat-score.score-ok { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cat-score.score-low { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.cat-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.cat-bar-fill.score-good { background: var(--accent-teal); }
.cat-bar-fill.score-ok { background: #f59e0b; }
.cat-bar-fill.score-low { background: #ef4444; }

.cat-feedback {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Summary & Tips ===== */
.eval-summary,
.eval-tips {
  text-align: left;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.eval-summary h3,
.eval-tips h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: 8px;
}

.eval-summary p,
.eval-tips li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.eval-tips ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eval-tips li::before {
  content: "→ ";
  color: var(--accent-teal);
}

/* ===== Stage Indicators ===== */
.stage-indicator {
  font-size: 0.72rem;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  max-width: fit-content;
}

.stage-indicator.stage-high {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.stage-indicator.stage-mid {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.stage-indicator.stage-low {
  background: rgba(110, 231, 183, 0.1);
  border-color: rgba(110, 231, 183, 0.2);
  color: var(--accent-teal);
}

/* ===== Coach Hint ===== */
.coach-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 4px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px dashed rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #93c5fd;
  line-height: 1.5;
  animation: hintAppear 0.3s ease-out;
  align-self: center;
  max-width: 90%;
}

.hint-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

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

/* ===== Hints Toggle ===== */
.hints-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
}

.hints-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.hints-toggle input:checked + .toggle-slider {
  background: rgba(110, 231, 183, 0.25);
}

.hints-toggle input:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: var(--accent-teal);
}

.toggle-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ===== Failed Banner ===== */
.failed-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  margin-top: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  animation: msgAppear 0.4s ease-out;
}

.failed-icon {
  font-size: 1.5rem;
  color: #ef4444;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  font-weight: 700;
}

.failed-banner strong {
  display: block;
  font-size: 0.88rem;
  color: #fca5a5;
  margin-bottom: 2px;
}

.failed-banner p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.eval-failed-header {
  text-align: center;
  margin-bottom: 20px;
}

.failed-icon-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.eval-failed-header p {
  font-size: 0.85rem;
  color: #fca5a5;
}

/* ===== Resolved Banner ===== */
.resolved-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  margin-top: 12px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: var(--radius-md);
  animation: msgAppear 0.4s ease-out;
}

.resolved-icon {
  font-size: 1.5rem;
  color: var(--accent-teal);
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(110, 231, 183, 0.15);
  border-radius: 50%;
}

.resolved-banner strong {
  display: block;
  font-size: 0.88rem;
  color: var(--accent-teal);
  margin-bottom: 2px;
}

.resolved-banner p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.btn-eval-now {
  margin-left: auto;
  padding: 8px 16px;
  background: var(--gradient-primary);
  color: #0a0e1a;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-eval-now:hover {
  transform: scale(1.05);
}

.btn-end-resolved {
  background: rgba(110, 231, 183, 0.2);
  border-color: rgba(110, 231, 183, 0.4);
  color: var(--accent-teal);
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.2); }
  50% { box-shadow: 0 0 12px 2px rgba(110, 231, 183, 0.3); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .connect-card {
    padding: 36px 24px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .controls {
    flex-direction: column;
    gap: 12px;
  }
  .voice-controls {
    width: 100%;
    justify-content: center;
  }
  .text-input-area {
    width: 100%;
  }
}
