/* ============================================================
   BioClone App — Shared CSS
   Design language: copper + dark/light theme, Inter font
   ============================================================ */

:root {
  --bg:          #FAFAFA;
  --bg-deep:     #F2F2F2;
  --text:        #1A1A1A;
  --text-muted:  #666666;
  --copper:      #B87333;
  --copper-glow: rgba(184, 115, 51, 0.25);
  --copper-hover:#9A5F29;
  --border:      rgba(0, 0, 0, 0.09);
  --card:        #FFFFFF;
  --nav-bg:      rgba(250, 250, 250, 0.88);
  --input-bg:    #FFFFFF;
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.07);
  --radius:      14px;
}

[data-theme="dark"] {
  --bg:          #0A0A0A;
  --bg-deep:     #111111;
  --text:        #F0F0F0;
  --text-muted:  #999999;
  --copper:      #D4904D;
  --copper-glow: rgba(212, 144, 77, 0.2);
  --copper-hover:#E8A058;
  --border:      rgba(255, 255, 255, 0.08);
  --card:        #141414;
  --nav-bg:      rgba(10, 10, 10, 0.9);
  --input-bg:    #1A1A1A;
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Nav ────────────────────────────────────────────────────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 5%;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.nav-logo img { height: 36px; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--copper); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--copper);
  color: #fff;
  padding: 0.75rem 1.8rem;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover:not(:disabled) {
  background: var(--copper-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--copper-glow);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--copper);
  border: 1px solid var(--copper);
}
.btn-outline:hover:not(:disabled) {
  background: var(--copper);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  font-size: 0.78rem;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--copper);
  color: var(--copper);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.78rem; }

/* ── Theme toggle ───────────────────────────────────────────── */
.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.theme-btn:hover { border-color: var(--copper); color: var(--copper); }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 5% 4rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: var(--copper-glow);
  top: -200px;
  right: -200px;
  filter: blur(80px);
  pointer-events: none;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.auth-card .logo {
  display: block;
  height: 40px;
  margin: 0 auto 2rem;
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.5rem;
}
.auth-card h1 span { color: var(--copper); font-weight: 500; }

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.form-group {
  margin-bottom: 1.4rem;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--copper); }
.form-group input::placeholder { color: var(--text-muted); opacity: 0.6; }

.form-error {
  color: #e74c3c;
  font-size: 0.82rem;
  margin-top: 0.4rem;
  display: none;
}
.form-error.visible { display: block; }

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--copper);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

.form-submit { width: 100%; margin-top: 0.5rem; }

/* ── Assessment page ────────────────────────────────────────── */
.assessment-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 70px;
}

.assessment-header {
  padding: 1.5rem 5%;
  border-bottom: 1px solid var(--border);
}

.phase-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.phase-badge {
  background: var(--copper);
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-weight: 600;
}

.phase-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-bar-wrap {
  background: var(--border);
  border-radius: 50px;
  height: 4px;
  width: 100%;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--copper), #E8A058);
  border-radius: 50px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: right;
}

.assessment-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 5%;
}

.question-container {
  max-width: 720px;
  width: 100%;
}

.dr-nova-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.dr-nova-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.question-text {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 2.5rem;
  min-height: 80px;
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--copper);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.answer-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.answer-textarea {
  width: 100%;
  min-height: 130px;
  padding: 1rem 1.2rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.answer-textarea:focus { border-color: var(--copper); }
.answer-textarea::placeholder { color: var(--text-muted); opacity: 0.5; }

.answer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

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

/* Visual test images */
.visual-test {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.visual-test svg { max-width: 100%; height: auto; }

/* Choices grid */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.choice-btn {
  padding: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  transition: border-color 0.2s, background 0.2s;
}
.choice-btn:hover { border-color: var(--copper); background: var(--copper-glow); }
.choice-btn.selected { border-color: var(--copper); background: var(--copper-glow); }

/* Generating profile state */
.generating-state {
  text-align: center;
  padding: 4rem 2rem;
}
.generating-state h2 {
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 1rem;
}
.dna-spinner {
  width: 80px;
  height: 80px;
  margin: 2rem auto;
  border: 3px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-page {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--bg);
}

.dashboard-hero {
  padding: 3rem 5%;
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}

.dashboard-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 300;
  margin-bottom: 0.5rem;
}
.dashboard-hero h1 span { color: var(--copper); font-weight: 500; }
.dashboard-hero p { color: var(--text-muted); font-size: 1rem; max-width: 600px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

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

.dashboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.dashboard-card.full-width {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--copper);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Avatar canvas */
#avatar-canvas {
  width: 100%;
  height: 340px;
  border-radius: 10px;
  background: var(--bg-deep);
}

/* Summary */
.summary-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

.clone-name {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--copper);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

/* MBTI badge */
.mbti-badge {
  display: inline-block;
  background: var(--copper-glow);
  border: 1px solid var(--copper);
  color: var(--copper);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  letter-spacing: 3px;
  margin-bottom: 1.2rem;
}

/* Big Five radar */
#radar-canvas {
  display: block;
  margin: 0 auto;
  max-width: 360px;
  width: 100%;
  height: auto;
}

.traits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.trait-tag {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.values-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.values-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}
.values-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  flex-shrink: 0;
}

.big5-bars { display: flex; flex-direction: column; gap: 1rem; }
.big5-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.big5-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}
.big5-bar-label span:last-child { color: var(--copper); font-weight: 600; }
.big5-bar-track {
  background: var(--bg-deep);
  border-radius: 50px;
  height: 6px;
  overflow: hidden;
}
.big5-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--copper), #E8A058);
  border-radius: 50px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.philosophy-text {
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
  border-left: 3px solid var(--copper);
  padding-left: 1.2rem;
  margin-top: 0.5rem;
}

.ei-score {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.ei-number {
  font-size: 3.5rem;
  font-weight: 200;
  color: var(--copper);
  line-height: 1;
}
.ei-label { font-size: 0.85rem; color: var(--text-muted); }

/* ── Loading overlay ────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1rem;
}
.loading-overlay.hidden { display: none; }
.loading-overlay p { color: var(--text-muted); font-size: 0.88rem; letter-spacing: 1px; text-transform: uppercase; }

/* ── Notification toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.8rem 1.8rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: #e74c3c; color: #e74c3c; }
.toast.success { border-color: #27ae60; color: #27ae60; }

/* ── Language switcher ──────────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s;
  line-height: 1.4;
}
.lang-btn.active {
  background: var(--copper);
  color: #fff;
}
.lang-btn:hover:not(.active) {
  color: var(--copper);
}

/* ── RTL support (Arabic) ───────────────────────────────────── */
[dir="rtl"] body { font-family: 'Inter', 'Segoe UI', sans-serif; }

[dir="rtl"] nav {
  flex-direction: row-reverse;
}
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-right  { flex-direction: row-reverse; }

[dir="rtl"] .auth-page::before {
  right: auto;
  left: -200px;
}

[dir="rtl"] .answer-actions { flex-direction: row-reverse; }

[dir="rtl"] .philosophy-text {
  border-left: none;
  border-right: 3px solid var(--copper);
  padding-left: 0;
  padding-right: 1.2rem;
}

[dir="rtl"] .values-list li::before {
  margin-left: 0.8rem;
  margin-right: 0;
}

[dir="rtl"] .dr-nova-label { flex-direction: row-reverse; }

[dir="rtl"] .phase-track { flex-direction: row-reverse; }

[dir="rtl"] .progress-label { text-align: left; }

[dir="rtl"] .big5-bar-label { flex-direction: row-reverse; }

[dir="rtl"] .dashboard-hero h1 { direction: rtl; }

[dir="rtl"] .ei-score { flex-direction: row-reverse; }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-copper { color: var(--copper); }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* ══════════════════════════════════════════════════════════════
   Clinical Profile Cards
   ══════════════════════════════════════════════════════════════ */

/* Section sub-label */
.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  font-weight: 600;
}

/* Small muted description text */
.clinical-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-top: 0.7rem;
}

/* Attachment style badge */
.attachment-badge {
  display: inline-block;
  padding: 0.38rem 1.1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.attachment-badge.secure    { background: rgba(39,174,96,0.12);  color: #27ae60; border: 1px solid rgba(39,174,96,0.3); }
.attachment-badge.anxious   { background: rgba(230,126,34,0.12); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.attachment-badge.avoidant  { background: rgba(52,152,219,0.12); color: #3498db; border: 1px solid rgba(52,152,219,0.3); }
.attachment-badge.fearful   { background: rgba(142,68,173,0.12); color: #8e44ad; border: 1px solid rgba(142,68,173,0.3); }
.attachment-badge:not(.secure):not(.anxious):not(.avoidant):not(.fearful) {
  background: var(--copper-glow); color: var(--copper); border: 1px solid var(--copper);
}

/* Enneagram badge */
.enneagram-badge {
  display: inline-block;
  padding: 0.38rem 1.1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  letter-spacing: 0.5px;
}

/* Therapeutic modality badges */
.modality-badge {
  padding: 0.45rem 1.2rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-block;
  background: var(--copper-glow);
  border: 1px solid var(--copper);
  color: var(--copper);
}
.modality-badge:not(.primary) {
  background: var(--bg-deep);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Clinical observation list */
.clinical-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.clinical-list li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}
.clinical-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--copper);
  font-weight: 700;
}
.clinical-list.shadow li { color: var(--text-muted); font-style: italic; }
.clinical-list.shadow li::before { content: '◦'; }

/* Schema tags */
.schema-tag {
  background: rgba(142,68,173,0.08);
  border-color: rgba(142,68,173,0.25);
  color: #8e44ad;
}
[data-theme="dark"] .schema-tag { color: #c39bd3; }

/* Session notes */
.session-notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.session-note-item {
  border-left: 2px solid var(--copper);
  padding-left: 1rem;
}
.session-note-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.session-note-date {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--copper);
  font-weight: 600;
}
.session-note-trigger {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}
.session-note-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════════
   Mobile & Touch — Responsive Design
   ══════════════════════════════════════════════════════════════ */

/* ── Global touch improvements ──────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
button, [role="button"] { touch-action: manipulation; }

/* Safe area variables — notched phones (iPhone X+, Android) */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* Prevent iOS zoom on inputs (needs 16px minimum) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  .voice-text-input { font-size: 16px !important; }
}

/* ── Hamburger button ────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ───────────────────────────────────────── */
.nav-drawer {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 57px;   /* matches nav height on mobile */
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1rem 1.2rem;
  z-index: 999;
  gap: 0.3rem;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
}
.nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer-user {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.nav-drawer-user:empty { display: none; }

.nav-drawer-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.72rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.nav-drawer-btn:hover { background: var(--border); }
.nav-drawer-btn--lv   { color: #22c55e; }
.nav-drawer-btn--danger { color: #e04040; margin-top: 0.2rem; }

.nav-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.8rem;
}

.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 57px;
  z-index: 998;
  background: rgba(0,0,0,0.25);
}
.nav-drawer-backdrop.show { display: block; }

/* ── Nav — tablet (≤768px) ───────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0.9rem 4%; }
  .nav-right { gap: 0.6rem; }
}

/* ── Nav — phone (≤640px): show hamburger, hide right items ───── */
@media (max-width: 640px) {
  nav { padding: 0.7rem 4%; gap: 0; }
  .nav-links { display: none; }
  .nav-right  { display: none; }
  .nav-hamburger { display: flex; }
  .nav-drawer { display: flex; }
}

/* ── Auth pages ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-page { padding: 72px 4% 2rem; }
  .auth-page::before { width: 300px; height: 300px; }
  .auth-card {
    padding: 1.8rem 1.3rem;
    border-radius: 16px;
  }
  .auth-card h1 { font-size: 1.35rem; }
  .auth-subtitle { font-size: 0.85rem; margin-bottom: 1.8rem; }
  .form-group input { padding: 0.75rem 0.9rem; }
  .form-submit { padding: 0.85rem; }
}

/* ── Assessment page ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .assessment-header { padding: 1.1rem 4%; }
  .assessment-body   { padding: 2rem 4%; }
  .question-text     { margin-bottom: 2rem; }
  .answer-textarea   { min-height: 110px; }
}

@media (max-width: 560px) {
  .assessment-body { padding: 1.2rem 4% 2rem; }
  .answer-textarea { min-height: 100px; }
  .answer-actions {
    flex-direction: column-reverse;
    gap: 0.6rem;
    align-items: stretch;
  }
  .answer-actions .btn {
    width: 100%;
    padding: 0.9rem;
    justify-content: center;
  }
  .char-count { text-align: right; }
  .choices-grid { grid-template-columns: 1fr; }
  .choice-btn { min-height: 52px; padding: 0.9rem; }
  .generating-state { padding: 3rem 1.2rem; }
  .generating-state h2 { font-size: 1.4rem; }
  .phase-track { gap: 0.5rem; flex-wrap: wrap; }
}

/* ── Dashboard ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dashboard-hero { padding: 2rem 4%; }
  .dashboard-grid { padding: 1.5rem 4%; gap: 1.2rem; }
  .dashboard-card { padding: 1.6rem; }
  #avatar-canvas  { height: 260px; }
}

@media (max-width: 560px) {
  .dashboard-hero  { padding: 1.4rem 4%; }
  .dashboard-grid  { padding: 1rem 3%; gap: 1rem; }
  .dashboard-card  { padding: 1.2rem 1.1rem; }
  #avatar-canvas   { height: 220px; }
  .clone-name      { font-size: 1.4rem; }
  .ei-number       { font-size: 2.6rem; }
  .summary-text    { font-size: 0.96rem; }
  .philosophy-text { font-size: 1rem; }
}

/* ── Toast — mobile safe area ────────────────────────────────── */
@media (max-width: 600px) {
  .toast {
    bottom: calc(1rem + var(--safe-bottom));
    font-size: 0.82rem;
    padding: 0.65rem 1.2rem;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════════════════
   Voice Mode
   ══════════════════════════════════════════════════════════════ */

/* Nav voice button */
.btn-voice-open {
  background: linear-gradient(135deg, var(--copper), var(--copper-hover));
  color: #fff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-voice-open:hover { opacity: 0.88; transform: scale(1.02); }

/* Fullscreen overlay modal */
.voice-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.voice-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.voice-modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  width: 100%;
  max-width: 440px;
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
}

/* Header row */
.voice-modal-header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.voice-status-badge {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  transition: background 0.3s;
}
.voice-status-badge.online  { background: rgba(68,255,170,0.15); color: #44ffaa; }
.voice-status-badge.offline { background: rgba(255,68,68,0.12);  color: #ff6644; }

.voice-close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.voice-close-btn:hover { background: rgba(255,255,255,0.2); }

/* Orb canvas wrapper */
.voice-orb-wrap {
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-orb-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Dr. NOVA response text */
.voice-nova-text {
  color: #f0f0f0;
  font-size: 1.05rem;
  line-height: 1.65;
  text-align: center;
  min-height: 3em;
  max-width: 380px;
  word-break: break-word;
}

/* User transcript */
.voice-transcript {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  text-align: center;
  font-style: italic;
  min-height: 1.4em;
  max-width: 340px;
}

/* Hold-to-talk button */
.voice-hold-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: rgba(184, 115, 51, 0.18);
  border: 2px solid var(--copper);
  color: var(--copper);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.voice-hold-btn:not(:disabled):hover {
  background: rgba(184, 115, 51, 0.28);
  transform: scale(1.04);
}
.voice-hold-btn:not(:disabled):active,
.voice-hold-btn.recording {
  background: rgba(255, 68, 68, 0.22);
  border-color: #ff4444;
  color: #ff4444;
  transform: scale(1.08);
}
.voice-hold-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Text input row */
.voice-text-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 380px;
}
.voice-text-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s;
}
.voice-text-input::placeholder { color: rgba(255,255,255,0.3); }
.voice-text-input:focus { border-color: var(--copper); }

/* Compact orb for conversation mode */
.voice-orb-compact {
  width: 140px !important;
  height: 140px !important;
}

/* Exchange counter badge */
.voice-exchange-count {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

/* Multi-turn chat thread */
.nova-chat-thread {
  width: 100%;
  max-width: 400px;
  max-height: 260px;
  min-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.4rem 0.2rem;
  scroll-behavior: smooth;
}
.nova-chat-thread::-webkit-scrollbar { width: 4px; }
.nova-chat-thread::-webkit-scrollbar-track { background: transparent; }
.nova-chat-thread::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nova-thread-empty {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  font-style: italic;
  padding: 1rem 0;
}

/* Chat bubbles */
.nova-msg {
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 88%;
  word-break: break-word;
  animation: bubbleIn 0.2s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nova-msg--nova {
  background: rgba(184, 115, 51, 0.2);
  border: 1px solid rgba(184, 115, 51, 0.25);
  color: #f0f0f0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.nova-msg--nova::before {
  content: 'Dr. NOVA';
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.25rem;
}
.nova-msg--user {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.nova-msg--streaming {
  background: rgba(184, 115, 51, 0.1);
  border: 1px dashed rgba(184, 115, 51, 0.35);
}

/* RTL voice layout */
[dir="rtl"] .voice-modal-header { flex-direction: row-reverse; }
[dir="rtl"] .voice-text-row     { flex-direction: row-reverse; }
[dir="rtl"] .nova-msg--user     { align-self: flex-start; border-radius: 14px; border-bottom-left-radius: 4px; }
[dir="rtl"] .nova-msg--nova     { align-self: flex-end;   border-radius: 14px; border-bottom-right-radius: 4px; }

/* ── Voice modal — bottom sheet on mobile ────────────────────── */
@media (max-width: 600px) {
  .voice-modal { align-items: flex-end; }

  .voice-modal-inner {
    max-width: 100%;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 1.2rem 1.1rem calc(1.4rem + var(--safe-bottom));
    max-height: 90vh;
    overflow-y: auto;
    gap: 0.9rem;
    animation: voiceSlideUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

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

  /* Drag handle pill */
  .voice-modal-inner::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    margin: 0 auto -0.4rem;
  }

  .voice-orb-compact  { width: 90px !important; height: 90px !important; }
  .voice-hold-btn     { width: 88px; height: 88px; }
  .nova-chat-thread   { max-height: 36vh; }
  .voice-text-row     { max-width: 100%; }
  .voice-text-input   { font-size: 16px !important; }
}

/* ── Microphone permission overlay ───────────────────────────── */
.mic-perm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.97);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 1rem;
  z-index: 20;
  animation: micPermFadeIn 0.22s ease;
}
@keyframes micPermFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.mic-perm-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(184, 115, 51, 0.12);
  border: 2px solid rgba(184, 115, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  animation: micPulse 2.4s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,115,51,0.35); }
  50%       { box-shadow: 0 0 0 12px rgba(184,115,51,0); }
}

.mic-perm-title {
  color: #f0f0f0;
  font-size: 1.15rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: -0.2px;
}

.mic-perm-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.75;
  max-width: 280px;
}
.mic-perm-desc strong { color: rgba(255,255,255,0.82); font-weight: 500; }

.mic-perm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 230px;
  margin-top: 0.4rem;
}
.mic-perm-actions .btn      { width: 100%; justify-content: center; }
.mic-perm-actions .btn-ghost { width: 100%; justify-content: center; }

/* Voice nav dot indicator */
.voice-nav-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: rgba(255,255,255,0.3);
  vertical-align: middle;
  transition: background 0.4s;
}
.voice-nav-dot.online  { background: #44ffaa; box-shadow: 0 0 6px #44ffaa; }
.voice-nav-dot.offline { background: #ff6644; }

/* Assessment voice hint */
.voice-assessment-hint {
  color: rgba(255,255,255,0.4);
  font-size: 0.78rem;
  text-align: center;
  margin: -0.5rem 0 0;
}

/* ============================================================
   Dr Nova Live Voice Mode
   Full-screen dark overlay with orb, captions, history
   ============================================================ */

/* ── Nav button ─────────────────────────────────────────────── */
.btn-lv-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 1rem;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.30);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-lv-open:hover {
  background: rgba(16, 185, 129, 0.20);
  border-color: rgba(16, 185, 129, 0.55);
  color: #10B981;
}

.lv-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: background 0.4s, box-shadow 0.4s;
}
.lv-nav-dot.online  { background: #10B981; box-shadow: 0 0 7px #10B981; }
.lv-nav-dot.offline { background: rgba(255,255,255,0.2); }

/* ── Modal overlay ──────────────────────────────────────────── */
.lv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.lv-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Inner layout ───────────────────────────────────────────── */
.lv-inner {
  width: 100%;
  max-width: 540px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1.5rem 2.5rem;
  gap: 0.8rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.lv-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lv-name {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.lv-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lv-mode-btn {
  font-size: 0.72rem;
  padding: 0.3rem 0.8rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.lv-mode-btn:hover { background: rgba(255,255,255,0.11); color: rgba(255,255,255,0.85); }

.lv-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.lv-ctrl-btn:hover { background: rgba(255,255,255,0.13); color: rgba(255,255,255,0.9); }
.lv-ctrl-btn:active { transform: scale(0.90); }
.lv-close-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── Orb ────────────────────────────────────────────────────── */
.lv-orb-wrap {
  flex-shrink: 0;
  width: min(220px, 40vw);
  height: min(220px, 40vw);
  position: relative;
}

#lv-orb-canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: block;
  border-radius: 50%;
}

/* ── Animation switcher ─────────────────────────────────────── */
.lv-anim-switcher {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
}

.lv-anim-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(184, 115, 51, 0.35);
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.1s;
  user-select: none;
}
.lv-anim-btn:hover {
  border-color: rgba(184, 115, 51, 0.7);
  color: rgba(255, 255, 255, 0.85);
  transform: scale(1.08);
}
.lv-anim-btn--active {
  background: rgba(184, 115, 51, 0.18);
  border-color: #B87333;
  color: #B87333;
}

/* ── State label ────────────────────────────────────────────── */
.lv-state-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  text-align: center;
  min-height: 1.3em;
  flex-shrink: 0;
}

/* ── Caption (Nova speaking) ────────────────────────────────── */
.lv-caption {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  text-align: center;
  max-width: 460px;
  min-height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  opacity: 0.3;
  transition: opacity 0.35s ease;
  padding: 0 1rem;
}

/* ── Transcript / history ───────────────────────────────────── */
.lv-transcript {
  flex: 1;
  width: 100%;
  max-width: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  min-height: 0;
}
.lv-transcript::-webkit-scrollbar { width: 3px; }
.lv-transcript::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.lv-transcript-empty {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.22);
  text-align: center;
  padding: 1rem 0;
  font-style: italic;
}

.lv-msg {
  font-size: 0.83rem;
  line-height: 1.55;
  padding: 0.5rem 0.85rem;
  border-radius: 14px;
  max-width: 88%;
  word-break: break-word;
}
.lv-msg--user {
  align-self: flex-end;
  background: rgba(184,115,51,0.20);
  border: 1px solid rgba(184,115,51,0.28);
  color: rgba(255,255,255,0.82);
}
.lv-msg--nova {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.78);
}
.lv-msg--error {
  align-self: center;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: rgba(255,120,120,0.9);
  font-size: 0.8rem;
  text-align: center;
  max-width: 90%;
}

/* ── Bottom controls ────────────────────────────────────────── */
.lv-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.lv-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.8rem;
  background: rgba(184,115,51,0.75);
  border: none;
  border-radius: 28px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  user-select: none;
}
.lv-speak-btn:hover { background: rgba(184,115,51,1); }
.lv-speak-btn:active,
.lv-speak-btn--active { background: rgba(239,68,68,0.8); transform: scale(0.97); }

/* ── Text fallback ──────────────────────────────────────────── */
.lv-text-row {
  flex-shrink: 0;
  width: 100%;
  max-width: 440px;
  display: flex;
  gap: 0.5rem;
}
.lv-text-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 24px;
  padding: 0.55rem 1rem;
  color: #fff;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.lv-text-input::placeholder { color: rgba(255,255,255,0.25); }
.lv-text-input:focus { border-color: rgba(184,115,51,0.5); }

.lv-text-send {
  padding: 0.55rem 1.1rem;
  background: rgba(184,115,51,0.6);
  border: none;
  border-radius: 24px;
  color: #fff;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lv-text-send:hover { background: rgba(184,115,51,0.9); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-height: 700px) {
  .lv-orb-wrap { width: 150px; height: 150px; }
  .lv-caption  { min-height: 2.5em; font-size: 0.92rem; }
}
@media (max-width: 400px) {
  .lv-inner { padding: 1.4rem 1rem 2rem; }
  .lv-mode-btn { display: none; }
}

/* ── Settings Modal ──────────────────────────────────────────── */
.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.settings-inner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.settings-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.settings-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.settings-close-btn:hover { background: var(--hover-bg); }

.settings-section {
  padding-bottom: 1.8rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
}

.settings-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.settings-field label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.settings-field input {
  background: var(--input-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.settings-field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Danger Zone */
.settings-danger-zone h3 { color: #e04040; }

.settings-danger-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-danger-item:last-child { border-bottom: none; padding-bottom: 0; }

.settings-danger-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.settings-danger-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-danger-outline {
  background: none;
  border: 1.5px solid #e04040;
  color: #e04040;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn-danger-outline:hover { background: rgba(224,64,64,0.1); }

.btn-danger {
  background: #e04040;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-danger:hover { background: #c43030; }

/* Confirm overlay */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.confirm-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
}

.confirm-box p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 1.2rem;
}

#confirm-extra-field {
  margin-bottom: 1.2rem;
}

#confirm-password-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--input-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
}
#confirm-password-input:focus {
  outline: none;
  border-color: var(--accent);
}

.confirm-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

@media (max-width: 520px) {
  .settings-danger-item { flex-direction: column; }
  .settings-danger-item button { align-self: flex-start; }
}
