/* ── Reset & Variables ───────────────────────────────────── */
:root {
  --c-primary: #6366f1;
  --c-primary-dark: #4f46e5;
  --c-primary-light: #e0e7ff;
  --c-accent: #8b5cf6;
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-danger: #ef4444;
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-hover: #f1f5f9;
  --c-border: #e2e8f0;
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --c-bg: #0f172a;
  --c-surface: #1e293b;
  --c-surface-hover: #334155;
  --c-border: #334155;
  --c-text: #f1f5f9;
  --c-text-secondary: #94a3b8;
  --c-text-muted: #64748b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.4);
  --c-primary-light: #312e81;
}

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

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--c-border);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-primary);
}

.logo-sub {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.sidebar-actions {
  padding: 16px 20px;
}

.topics-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.topics-nav::-webkit-scrollbar { width: 4px; }
.topics-nav::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }

.nav-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--c-text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }

.nav-empty p { font-size: 14px; }
.nav-empty .empty-hint { font-size: 12px; margin-top: 4px; }

.topic-nav-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 4px;
  transition: background var(--transition);
  position: relative;
}

.topic-nav-item:hover { background: var(--c-surface-hover); }
.topic-nav-item.active { background: var(--c-primary-light); color: var(--c-primary); }

.topic-nav-item .nav-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-nav-item .nav-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.topic-nav-item .nav-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.topic-nav-item:hover .nav-delete { opacity: 1; }
.topic-nav-item .nav-delete:hover { color: var(--c-danger); background: rgba(239,68,68,.1); }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
}

/* ── Main ───────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 6px; }

.main-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.welcome {
  text-align: center;
  max-width: 480px;
}

.welcome-icon { font-size: 64px; margin-bottom: 16px; }

.welcome h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.welcome p {
  color: var(--c-text-secondary);
  font-size: 15px;
  margin-bottom: 6px;
}

.welcome .btn { margin-top: 24px; }

/* ── Topic Detail ───────────────────────────────────────── */
.topic-detail { max-width: 860px; margin: 0 auto; }

.topic-header {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-border);
}

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

.topic-header .topic-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--c-text-secondary);
  flex-wrap: wrap;
}

.topic-meta span {
  background: var(--c-surface-hover);
  padding: 4px 12px;
  border-radius: 20px;
}

.progress-bar-wrap {
  margin-top: 16px;
  background: var(--c-surface-hover);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 8px;
  transition: width .5s ease;
}

/* ── Stage Card ─────────────────────────────────────────── */
.stages-container { display: flex; flex-direction: column; gap: 16px; }

.stage-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.stage-card:hover { box-shadow: var(--shadow); }

.stage-card.completed { border-left: 4px solid var(--c-success); }

.stage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
}

.stage-header:hover { background: var(--c-surface-hover); }

.stage-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.stage-card.completed .stage-number {
  background: #d1fae5;
  color: var(--c-success);
}

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

.stage-info h4 { font-size: 15px; font-weight: 600; }

.stage-info .stage-duration {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.stage-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
}

.stage-status.pending { background: var(--c-surface-hover); color: var(--c-text-secondary); }
.stage-card.in-progress .stage-status { background: #fef3c7; color: #92400e; }
.stage-card.completed .stage-status { background: #d1fae5; color: #065f46; }

.stage-arrow {
  font-size: 12px;
  color: var(--c-text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.stage-card.open .stage-arrow { transform: rotate(180deg); }

/* ── Stage Body ─────────────────────────────────────────── */
.stage-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
}

.stage-card.open .stage-body { max-height: 5000px; }

.stage-body-inner {
  padding: 0 24px 24px;
  border-top: 1px solid var(--c-border);
}

/* Content */
.stage-content {
  padding: 20px 0;
  border-bottom: 1px solid var(--c-border);
}

.markdown-body { line-height: 1.8; font-size: 15px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 16px 0 8px; }
.markdown-body h1 { font-size: 1.4em; }
.markdown-body h2 { font-size: 1.2em; }
.markdown-body h3 { font-size: 1.05em; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin: 8px 0; }
.markdown-body li { margin: 4px 0; }
.markdown-body code { background: var(--c-surface-hover); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.markdown-body pre { background: var(--c-surface-hover); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; margin: 12px 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 4px 16px;
  color: var(--c-text-secondary);
  margin: 12px 0;
}
.markdown-body strong { color: var(--c-primary); }

/* ── Thinking Section ───────────────────────────────────── */
.thinking-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--c-border);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.thinking-input {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.thinking-input textarea {
  flex: 1;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
  background: var(--c-bg);
  color: var(--c-text);
}

.thinking-input textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

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

.qa-item {
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.qa-question {
  font-weight: 600;
  font-size: 14px;
  color: var(--c-primary);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--c-primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.qa-question::before { content: '❓'; flex-shrink: 0; }

.qa-answer {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--c-text);
}

.qa-answer .markdown-body { font-size: 14px; }

/* ── Quiz Section ───────────────────────────────────────── */
.quiz-section { padding: 20px 0; }

.quiz-history { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.quiz-history-item {
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
}

.quiz-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 13px;
}

.quiz-score.high { background: #d1fae5; color: #065f46; }
.quiz-score.mid { background: #fef3c7; color: #92400e; }
.quiz-score.low { background: #fee2e2; color: #991b1b; }

/* ── Methodology ────────────────────────────────────────── */
.methodology-section {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  padding: 24px 32px;
  margin-top: 24px;
}

.methodology-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.methodology-section textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  background: var(--c-bg);
  color: var(--c-text);
  margin-bottom: 12px;
}

.methodology-section textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

.methodology-actions { display: flex; gap: 8px; margin-bottom: 16px; }

.ai-feedback {
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 12px;
  border-left: 3px solid var(--c-accent);
}

.ai-feedback h4 { font-size: 15px; margin-bottom: 8px; color: var(--c-accent); }

.ai-feedback .feedback-section { margin-bottom: 12px; }
.ai-feedback .feedback-label { font-weight: 600; font-size: 13px; color: var(--c-text-secondary); margin-bottom: 4px; }
.ai-feedback ul { padding-left: 20px; font-size: 14px; }
.ai-feedback li { margin: 4px 0; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
  border-color: var(--c-border);
}

.btn-ghost:hover { background: var(--c-surface-hover); color: var(--c-text); }

.btn-success {
  background: var(--c-success);
  color: #fff;
}

.btn-success:hover { filter: brightness(1.1); }

.btn-sm { font-size: 13px; padding: 6px 12px; }
.btn-lg { font-size: 16px; padding: 12px 28px; }
.btn-full { width: 100%; }

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

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.modal {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .3s ease;
}

.modal-wide { width: 580px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
}

.modal-header h3 { font-size: 17px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--c-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover { background: var(--c-surface-hover); color: var(--c-text); }

.modal-body {
  padding: 20px 24px;
}

.modal-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: 6px;
  margin-top: 14px;
}

.modal-body label:first-child { margin-top: 0; }

.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color var(--transition);
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.modal-body textarea { resize: vertical; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--c-border);
}

.setting-hint {
  margin-top: 12px;
  font-size: 12px;
}

.setting-hint a { color: var(--c-primary); }

/* ── Score Modal ────────────────────────────────────────── */
.score-display {
  text-align: center;
  padding: 20px;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  animation: scoreBounce .6s ease;
}

@keyframes scoreBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.score-circle.high { background: #d1fae5; color: #065f46; }
.score-circle.mid { background: #fef3c7; color: #92400e; }
.score-circle.low { background: #fee2e2; color: #991b1b; }

.score-feedback {
  font-size: 15px;
  color: var(--c-text-secondary);
  margin-bottom: 12px;
  text-align: left;
}

.score-encouragement {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-primary);
  padding: 12px;
  background: var(--c-primary-light);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  max-width: 360px;
}

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

.toast-success { background: #d1fae5; color: #065f46; }
.toast-error { background: #fee2e2; color: #991b1b; }
.toast-info { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* ── Loading ────────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--c-text-secondary);
  font-size: 15px;
}

/* ── Hidden ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Confetti ───────────────────────────────────────────── */
.confetti {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; max-height: 40vh; }
  .main { padding: 20px; }
  .topic-header { padding: 20px; }
  .stage-header { padding: 12px 16px; }
  .stage-body-inner { padding: 0 16px 16px; }
  .methodology-section { padding: 16px 20px; }
}

/* ── Highlight new elements ─────────────────────────────── */
@keyframes highlight {
  0% { box-shadow: 0 0 0 0 rgba(99,102,241,.4); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

.highlight-new { animation: highlight 1.5s ease; }

/* ── Floating Search Button ─────────────────────────────── */
.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.45);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(99,102,241,.55);
}

.fab:active { transform: scale(.95); }

/* ── Selection Popover ──────────────────────────────────── */
.selection-popover {
  position: fixed;
  transform: translate(-50%, -100%);
  z-index: 160;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  animation: popIn .15s ease;
}

.selection-popover.show { display: block; }

.selection-popover button {
  border: none;
  background: var(--c-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
}

.selection-popover button:hover { background: var(--c-primary-dark); }
.selection-popover button:disabled { opacity: .6; cursor: not-allowed; }

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -90%) scale(.9); }
  to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

/* ── Practice Section ───────────────────────────────────── */
.practice-section {
  padding: 20px 0;
  border-top: 1px solid var(--c-border);
}

.section-hint {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 10px;
}

/* ── Small / Extra-small Buttons ────────────────────────── */
.btn-xs { font-size: 12px; padding: 4px 10px; margin-top: 8px; }

/* ── Answer Reveal ──────────────────────────────────────── */
.answer-reveal { text-align: left; }

.quiz-answer-reveal { text-align: left; }

#search-result,
#practice-body { font-size: 15px; }

/* ── Auth Overlay (login / register) ─────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  background-size: 200% 200%;
  animation: authBg 12s ease infinite;
  padding: 20px;
}
@keyframes authBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--c-surface, #fff);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: popInCard .4s cubic-bezier(.16,1,.3,1);
}
@keyframes popInCard {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--c-text, #1f2937);
}
.auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-muted, #9ca3af);
  margin: 6px 0 22px;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  background: var(--c-bg, #f3f4f6);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-secondary, #6b7280);
  cursor: pointer;
  transition: all .2s ease;
}
.auth-tab.active {
  background: var(--c-surface, #fff);
  color: var(--c-primary, #6366f1);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-secondary, #6b7280);
  margin-top: 10px;
}
.auth-form input {
  padding: 12px 14px;
  border: 1.5px solid var(--c-border, #e5e7eb);
  border-radius: 10px;
  font-size: 14px;
  background: var(--c-bg, #f9fafb);
  color: var(--c-text, #1f2937);
  outline: none;
  transition: border-color .2s ease;
}
.auth-form input:focus { border-color: var(--c-primary, #6366f1); }
.auth-hint {
  font-size: 12px;
  color: var(--c-text-muted, #9ca3af);
  text-align: center;
  margin-top: 18px;
  line-height: 1.6;
}

/* ── User Bar (sidebar footer) ───────────────────────────── */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 8px;
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text, #1f2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
